Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/fetchcode/package_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def _get_github_packages(purl, version_regex, ignored_tag_regex, default_package

download_url = archive_download_url.format(org=purl.namespace, name=purl.name, tag_name=tag)

date = date.strftime("%Y-%m-%dT%H:%M:%S")
date = date.strftime("%Y-%m-%dT%H:%M:%S") if date else None
package_dict.update(
{
"download_url": download_url,
Expand Down
15 changes: 15 additions & 0 deletions tests/test_github_missing_date.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from packageurl import PackageURL

from fetchcode import package_util
from fetchcode.packagedcode_models import Package
Comment thread
codewithfourtix marked this conversation as resolved.


def test_github_package_without_release_date(monkeypatch):
monkeypatch.setattr(
package_util.utils, "fetch_github_tags_gql", lambda purl: [("v1.2.3", None)]
)
purl = PackageURL("github", "example", "project")
packages = list(package_util.get_github_packages(purl, None, None, Package(**purl.to_dict())))
assert len(packages) == 1
assert packages[0].version == "1.2.3"
assert packages[0].release_date is None