Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

url2purl: handle pypi.org urls #128

Merged
merged 2 commits into from
Dec 8, 2023
Merged

url2purl: handle pypi.org urls #128

merged 2 commits into from
Dec 8, 2023

Conversation

schischi
Copy link
Contributor

@schischi schischi commented Oct 2, 2023

pypi.org replaced pypi.python.org in 2017 and so most urls are now using this.
See: https://packaging.python.org/en/latest/glossary/#term-pypi.org

Make sure we route this domain properly so that we don't generate generic purls.

Input: https://pypi.org/packages/source/z/zc.recipe.egg/zc.recipe.egg-2.0.0.tar.gz
Before: pkg:generic/zc.recipe.egg-2.0.0.tar.gz?download...
After: pkg:pypi/zc.recipe.egg@2.0.0

pypi.org replaced pypi.python.org in 2017 and so most urls are now using
this.
See: https://packaging.python.org/en/latest/glossary/#term-pypi.org

Make sure we route this domain properly so that we don't generate
generic purls.

Input: https://pypi.org/packages/source/z/zc.recipe.egg/zc.recipe.egg-2.0.0.tar.gz
Before: pkg:generic/zc.recipe.egg-2.0.0.tar.gz?download...
After: pkg:pypi/zc.recipe.egg@2.0.0
Some tools are reporting `https://pypi.org/project/<name>/<version>` urls for pypi packages, let's make sure we can generate proper purls.

Input: https://pypi.org/project/widgetsnbextension/3.0.7
Before: pkg:generic/3.0.7?download_url=...
After: pkg:pypi/widgetsnbextension@3.0.7
Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat and clean....and works nicely with package-url/purl-spec#250 (review)
Thank you ++

@tdruez tdruez merged commit b3ed6ac into package-url:main Dec 8, 2023
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Dec 11, 2023
0.12.0 (2023-12-08)
-------------------

- Modified `PackageURL.from_string` to properly handle golang purls.
  package-url/packageurl-python#115

- Improve support for PyPI URLs in `url2purl`.
  package-url/packageurl-python#128

- Return the "gem" type instead of "rubygems" for "https://rubygems.org/" URLs in
  `url2purl`. The `pkg:rubygems/` purls are backward-compatible in `purl2url`.
  package-url/packageurl-python#114

0.11.3 (2023-12-08)
--------------------

- Add support for GitLab "/archive/" URLs in `url2purl`.
  package-url/packageurl-python#133
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants