Skip to content

Commit

Permalink
Remove none-check from publication_date (#75)
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
shenanigansd authored Feb 4, 2024
1 parent 766121b commit bfb875b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 3 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Changelog
=========

- :release:`5.0.2 <3rd February 2024>`
- :bug:`74` Remove none-check from publication_date

- :release:`5.0.1 <3rd February 2024>`
- :bug:`67` Use a single function to get versioned package metadata

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "letsbuilda-pypi"
version = "5.0.1"
version = "5.0.2"
description = "A wrapper for PyPI's API and RSS feed"
authors = [
{ name = "Bradley Reynolds", email = "[email protected]" },
Expand Down
4 changes: 1 addition & 3 deletions src/letsbuilda/pypi/models/models_rss.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@ def build_from(cls: type[Self], data: dict[str, str]) -> Self:
title = split_title[0]
version = split_title[1] if len(split_title) == 2 else None # noqa: PLR2004 - is not magic

publication_date = parsedate_to_datetime(data.get("pubDate")) if data.get("pubDate") is not None else None

return cls(
title=title,
version=version,
package_link=data["link"],
guid=data.get("guid"),
description=data.get("description"),
author=data.get("author"),
publication_date=publication_date, # type: ignore[arg-type]
publication_date=parsedate_to_datetime(data["pubDate"]),
)

0 comments on commit bfb875b

Please sign in to comment.