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 requirements.txt cataloger: allow dots in python package names #3070

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

Mikcl
Copy link
Contributor

@Mikcl Mikcl commented Jul 24, 2024

Its perfectly valid for python packages to have dots in their name
https://packaging.python.org/en/latest/specifications/name-normalization/

It seems like #1966 introduced a regex match which did not include the dot. This results in silently skipping packages with dots in their requirements.txt.

This PR accepts the dot and adds a test.

Noticed this whilst doing #3069 (which does the normalization of the name)

(its possible that this bug may exist in the other parsers but did not investigate that)

Signed-off-by: mikcl <mikesmikes400@gmail.com>
@Mikcl Mikcl changed the title python cataloger: allow dots in python package names python requirements.txt cataloger: allow dots in python package names Jul 24, 2024
@spiffcs spiffcs added the bug Something isn't working label Jul 25, 2024
@spiffcs
Copy link
Contributor

spiffcs commented Jul 25, 2024

@Mikcl thank you so much for the two PR regarding the python cataloger

These will help a lot going into next release and we really appreciate the time and good PR description/submissions.

@spiffcs spiffcs merged commit b3848f7 into anchore:main Jul 25, 2024
11 checks passed
@Mikcl
Copy link
Contributor Author

Mikcl commented Jul 25, 2024

Thanks for the quick review turn around @spiffcs

note the test case in this pr should now be updated since the name and purl are normalised, from the other pr made.

Thanks again

@Mikcl
Copy link
Contributor Author

Mikcl commented Jul 25, 2024

put up a pr to fix it
#3073

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
None yet
Development

Successfully merging this pull request may close these issues.

Syft Not reading components with Dots in Names from requirements.txt
2 participants