refactor!: remove packageurl-python dependency#939
Open
saquibsaifee wants to merge 1 commit intoCycloneDX:mainfrom
Open
refactor!: remove packageurl-python dependency#939saquibsaifee wants to merge 1 commit intoCycloneDX:mainfrom
saquibsaifee wants to merge 1 commit intoCycloneDX:mainfrom
Conversation
Documentation build overview
5 files changed ·
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | -4 |
| Duplication | 1 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes. Give us feedback
Removes packageurl-python entirely — no runtime dependency, no dev dependency. The library now treats PURL as an opaque string, which matches the CycloneDX specification (PURL is a plain string field in the schema). Changes: - Component.purl accepts and returns Optional[str] only - Bom.get_component_by_purl() now takes Optional[str] - Removed PackageUrl serialization helper and ComparablePackageURL utility - Removed all packageurl imports from source and test files - Updated test fixtures to use PURL string format directly - Regenerated snapshots with updated PURL string representation BREAKING CHANGE: Component.purl type changed from Optional[PackageURL] to Optional[str]. Users who need structured PURL access should parse the string themselves using the packageurl-python library directly. Signed-off-by: Saquib Saifee <saquibsaifee2@gmail.com> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
60e4665 to
31fccbf
Compare
Contributor
Author
|
@jkowalleck, what do you think? |
jkowalleck
requested changes
Apr 22, 2026
Member
jkowalleck
left a comment
There was a problem hiding this comment.
Thank you so much for championing the topic.
there are some minor remarks
| <name>dummy</name> | ||
| <version>2.3.5</version> | ||
| <purl>pkg:pypi/pathlib2@2.3.5?vcs_url=git%2Bhttps://github.com/jazzband/pathlib2.git%405a6a88db3cc1d08dbc86fbe15edfb69fb5f5a3d6</purl> | ||
| <purl>pkg:pypi/pathlib2@2.3.5?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2Fjazzband%2Fpathlib2.git%405a6a88db3cc1d08dbc86fbe15edfb69fb5f5a3d6</purl> |
Member
There was a problem hiding this comment.
Suggested change
| <purl>pkg:pypi/pathlib2@2.3.5?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2Fjazzband%2Fpathlib2.git%405a6a88db3cc1d08dbc86fbe15edfb69fb5f5a3d6</purl> | |
| <purl>pkg:pypi/pathlib2@2.3.5?vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Fjazzband%2Fpathlib2.git%405a6a88db3cc1d08dbc86fbe15edfb69fb5f5a3d6</purl> |
| <name>dummy</name> | ||
| <version>2.3.5</version> | ||
| <purl>pkg:pypi/pathlib2@2.3.5?vcs_url=git%2Bhttps://github.com/jazzband/pathlib2.git%405a6a88db3cc1d08dbc86fbe15edfb69fb5f5a3d6</purl> | ||
| <purl>pkg:pypi/pathlib2@2.3.5?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2Fjazzband%2Fpathlib2.git%405a6a88db3cc1d08dbc86fbe15edfb69fb5f5a3d6</purl> |
Member
There was a problem hiding this comment.
Suggested change
| <purl>pkg:pypi/pathlib2@2.3.5?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2Fjazzband%2Fpathlib2.git%405a6a88db3cc1d08dbc86fbe15edfb69fb5f5a3d6</purl> | |
| <purl>pkg:pypi/pathlib2@2.3.5?vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Fjazzband%2Fpathlib2.git%405a6a88db3cc1d08dbc86fbe15edfb69fb5f5a3d6</purl> |
| affects=[ | ||
| BomTarget( | ||
| ref=component.purl.to_string(), | ||
| ref=str(component.purl), |
Member
There was a problem hiding this comment.
no need to cast to a string - is is expected to be a string already, right?
| } | ||
| ) | ||
| purl='pkg:pypi/pathlib2@2.3.5' | ||
| '?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2Fjazzband%2Fpathlib2.git' |
Member
There was a problem hiding this comment.
Suggested change
| '?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2Fjazzband%2Fpathlib2.git' | |
| '?vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Fjazzband%2Fpathlib2.git' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Removes
packageurl-pythonas a dependency (both runtime and dev). The library now treats PURL as an opaque string per the CycloneDX specification — PURL is a string field in the schema, not a structured object.Component.purlnow stores and returnsOptional[str]Bom.get_component_by_purl()acceptsOptional[str]PackageUrlserialization helper,ComparablePackageURLBreaking Changes
Component.purltype changed fromOptional[PackageURL]toOptional[str]Resolves or fixes issue: #919
AI Tool Disclosure
CLAUDE4.5Affirmation