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

Add support for Composer in purl2url #144

Merged
merged 1 commit into from
Mar 18, 2024
Merged

Conversation

camillem
Copy link
Contributor

Hi,

I have tried to add support for Composer to purl2url.
It might be relevant to #143

Cheers,
Camille

@tdruez
Copy link
Collaborator

tdruez commented Mar 4, 2024

@camillem That's great! Could you add the url2purl side as well?

@camillem camillem changed the title Add support for Composer in purl2url Draft: Add support for Composer in purl2url Mar 4, 2024
@camillem
Copy link
Contributor Author

camillem commented Mar 4, 2024

@camillem That's great! Could you add the url2purl side as well?

Yep, I'll do that.

"""
purl_data = PackageURL.from_string(purl)

name = (purl_data.name or "").replace("_", "-")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed. I just directly copy/pasted it from https://github.com/camillem/packageurl-python/blob/e0d180d1ce23f289230a970c2d1e560456300bb8/src/packageurl/contrib/purl2url.py#L219
I should also check if the replace("_", "-") makes sense in this context.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I simplified this part, as the replace("_", "-") seemed to be linked to an old pypi.org oddity.

@camillem camillem changed the title Draft: Add support for Composer in purl2url Add support for Composer in purl2url Mar 5, 2024
@tdruez tdruez merged commit ea4ad00 into package-url:main Mar 18, 2024
19 checks passed
tdruez added a commit that referenced this pull request Mar 18, 2024
@tdruez
Copy link
Collaborator

tdruez commented Mar 18, 2024

Thanks @camillem for your contribution 🚀

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.

2 participants