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

Python packages: name normalization #3064

Closed
Mikcl opened this issue Jul 24, 2024 · 0 comments · Fixed by #3069
Closed

Python packages: name normalization #3064

Mikcl opened this issue Jul 24, 2024 · 0 comments · Fixed by #3069
Labels
bug Something isn't working

Comments

@Mikcl
Copy link
Contributor

Mikcl commented Jul 24, 2024

The pypi components that syft generates does not normalize the python package names.

As per the python packaging documentation, the following are the same:

    friendly-bard (normalized form)
    Friendly-Bard
    FRIENDLY-BARD
    friendly.bard
    friendly_bard
    friendly--bard
    FrIeNdLy-._.-bArD (a terrible way to write a name, but it is valid)

And so python packaging tools such as pip would understand how to treat these packages.

With normalization applied to syft sboms, it would make querying for packages less reliant on the specific display name that happens to be used. However, currently without normalization applied, consumers of syft sboms are at risk of not using the correct package names, and thus missing any checks that may happen afterward.

What you expected to happen:

I would expect the python package names to be normalized according to the docs/specification above.

Additionally this is mentioned in the PURL documentation: https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst#pypi

So i would expect this to be applied to the purl and the name


Is this something the syft team are will to consider adopting?
Are there any consumer of syft that explictly require the denormalized form and would not work with the normalized form?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant