Skip to content

Commit f79606d

Browse files
authored
Fix golang purl issue (#200)
* Fix golang purl issue We shoul add a leading v in version for golang purls download URL where purl's version misses a leading v Signed-off-by: Tushar Goel <[email protected]> * Add changelog and bump version Signed-off-by: Tushar Goel <[email protected]> --------- Signed-off-by: Tushar Goel <[email protected]>
1 parent 24ea308 commit f79606d

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

CHANGELOG.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Changelog
22
=========
33

4+
0.17.3 (2025-08-01)
5+
-------------------
6+
7+
- Add support for getting download URL for Luarocks, Conda, Alpm in ``purl2url``.
8+
https://github.com/package-url/packageurl-python/pull/199
9+
- Fix Incorrect download url from build_golang_download_url()
10+
https://github.com/package-url/packageurl-python/issues/198
11+
412
0.17.2 (2025-07-29)
513
-------------------
614

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = packageurl-python
3-
version = 0.17.2
3+
version = 0.17.3
44
license = MIT
55
description = A purl aka. Package URL parser and builder
66
long_description = file:README.rst

src/packageurl/contrib/purl2url.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,9 @@ def build_golang_download_url(purl):
478478
ename = escape_golang_path(name)
479479
eversion = escape_golang_path(version)
480480

481+
if not eversion.startswith("v"):
482+
eversion = "v" + eversion
483+
481484
if name and version:
482485
return f"https://proxy.golang.org/{ename}/@v/{eversion}.zip"
483486

tests/contrib/test_purl2url.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def test_purl2url_get_download_url():
102102
"pkg:golang/xorm.io/[email protected]": "https://proxy.golang.org/xorm.io/xorm/@v/v0.8.2.zip",
103103
"pkg:golang/gopkg.in/[email protected]": "https://proxy.golang.org/gopkg.in/ldap.v3/@v/v3.1.0.zip",
104104
"pkg:golang/example.com/[email protected]": "https://proxy.golang.org/example.com/!m.v3/@v/v3.1.0.zip",
105+
"pkg:golang/golang.org/x/[email protected]": "https://proxy.golang.org/golang.org/x/oauth2/@v/v0.29.0.zip",
105106
"pkg:pub/[email protected]": "https://pub.dev/api/archives/http-0.13.3.tar.gz",
106107
"pkg:swift/github.com/Alamofire/[email protected]": "https://github.com/Alamofire/Alamofire/archive/5.4.3.zip",
107108
"pkg:swift/github.com/RxSwiftCommunity/[email protected]": "https://github.com/RxSwiftCommunity/RxFlow/archive/2.12.4.zip",

0 commit comments

Comments
 (0)