Skip to content

Commit

Permalink
Update GitHub generated Download URL for maximum compatibility #157
Browse files Browse the repository at this point in the history
Signed-off-by: tdruez <[email protected]>
  • Loading branch information
tdruez committed Jul 4, 2024
1 parent b744d07 commit aa217f1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Changelog
0.16.0 (unreleased)
-------------------

0.15.2 (2024-07-04)
-------------------

- Update GitHub generated Download URL for maximum compatibility.
https://github.com/package-url/packageurl-python/issues/157

0.15.1 (2024-06-13)
-------------------

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = packageurl-python
version = 0.15.1
version = 0.15.2
license = MIT
description = A purl aka. Package URL parser and builder
long_description = file:README.rst
Expand Down
2 changes: 1 addition & 1 deletion src/packageurl/contrib/purl2url.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get_repo_download_url_by_package_type(
raise ValueError("Only zip and tar.gz extensions are supported")

download_url_by_type = {
"github": f"https://github.com/{namespace}/{name}/archive/refs/tags/{version}.{archive_extension}",
"github": f"https://github.com/{namespace}/{name}/archive/{version}.{archive_extension}",
"bitbucket": f"https://bitbucket.org/{namespace}/{name}/get/{version}.{archive_extension}",
"gitlab": f"https://gitlab.com/{namespace}/{name}/-/archive/{version}/{name}-{version}.{archive_extension}",
}
Expand Down
3 changes: 2 additions & 1 deletion tests/contrib/test_purl2url.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ def test_purl2url_get_download_url():
"pkg:npm/[email protected]": "http://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz",
"pkg:hackage/[email protected]": "https://hackage.haskell.org/package/cli-extras-0.2.0.0/cli-extras-0.2.0.0.tar.gz",
"pkg:nuget/[email protected]": "https://www.nuget.org/api/v2/package/System.Text.Json/6.0.6",
"pkg:github/nexb/[email protected]?version_prefix=v": "https://github.com/nexb/scancode-toolkit/archive/refs/tags/v3.1.1.tar.gz",
"pkg:github/nexb/[email protected]?version_prefix=v": "https://github.com/nexb/scancode-toolkit/archive/v3.1.1.tar.gz",
"pkg:github/StonyShi/reactor-netty-jersey@ac525d91ff1724395640531df08e3e4eabef207d": "https://github.com/stonyshi/reactor-netty-jersey/archive/ac525d91ff1724395640531df08e3e4eabef207d.tar.gz",
"pkg:bitbucket/robeden/[email protected]": "https://bitbucket.org/robeden/trove/get/3.0.3.tar.gz",
"pkg:bitbucket/robeden/[email protected]?version_prefix=v": "https://bitbucket.org/robeden/trove/get/v3.0.3.tar.gz",
"pkg:gitlab/tg1999/firebase@1a122122": "https://gitlab.com/tg1999/firebase/-/archive/1a122122/firebase-1a122122.tar.gz",
Expand Down

0 comments on commit aa217f1

Please sign in to comment.