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

Normalize python package names during sanitization #359

Merged
merged 1 commit into from
Mar 21, 2022

Conversation

Shrews
Copy link
Contributor

@Shrews Shrews commented Mar 8, 2022

Fixes #351

Older versions of pip cannot handle duplicate entries of a python package within a requirements file. E.g.,

python-dateutil>=2.8.2
python_dateutil

Newer versions of pip can handle this fine.

ansible-builder sanitizes requirements from multiple sources (collections) by removing duplicates. However, it doesn't currently account for package names that are not normalized (python-dateutil should be the same as python_dateutil). So in an EE environment with older versions of pip, the pip install portion could fail with an error similar to:

ERROR: Double requirement given: python-dateutil>=2.8.2 (from -r /tmp/r.txt (line 2)) (already in python_dateutil (from -r /tmp/r.txt (line 1)), name='python-dateutil')

This change normalizes the package names (since the underlying parsing library is not doing that for us).

@github-actions github-actions bot added the needs_triage New item that needs to be triaged label Mar 8, 2022
@softwarefactory-project-zuul
Copy link

Build succeeded.

@softwarefactory-project-zuul
Copy link

Build succeeded.

@Shrews Shrews changed the title Test Normalize python package names Mar 9, 2022
@softwarefactory-project-zuul
Copy link

Build succeeded.

@Shrews Shrews changed the title Normalize python package names Normalize python package names during sanitization Mar 9, 2022
@Shrews Shrews marked this pull request as ready for review March 9, 2022 15:57
@Shrews Shrews requested a review from a team as a code owner March 9, 2022 15:57
Co-authored-by: Matt Martz <matt@sivel.net>
@softwarefactory-project-zuul
Copy link

Build succeeded.

@Shrews
Copy link
Contributor Author

Shrews commented Mar 9, 2022

@shanemcd When you return from PTO, can you review this for us?

Copy link
Member

@shanemcd shanemcd left a comment

Choose a reason for hiding this comment

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

Nice

@Shrews Shrews added gate and removed needs_triage New item that needs to be triaged labels Mar 21, 2022
@ansible-zuul ansible-zuul bot merged commit db9e74a into ansible:devel Mar 21, 2022
@Shrews Shrews deleted the junk branch March 21, 2022 15:01
Shrews added a commit to Shrews/ansible-builder that referenced this pull request Mar 21, 2022
Normalize python package names during sanitization

Fixes ansible#351
Older versions of pip cannot handle duplicate entries of a python package within a requirements file. E.g.,
python-dateutil>=2.8.2
python_dateutil

Newer versions of pip can handle this fine.
ansible-builder sanitizes requirements from multiple sources (collections) by removing duplicates. However, it doesn't currently account for package names that are not normalized (python-dateutil should be the same as python_dateutil). So in an EE environment with older versions of pip, the pip install portion could fail with an error similar to:
ERROR: Double requirement given: python-dateutil>=2.8.2 (from -r /tmp/r.txt (line 2)) (already in python_dateutil (from -r /tmp/r.txt (line 1)), name='python-dateutil')

This change normalizes the package names (since the underlying parsing library is not doing that for us).

Reviewed-by: Matt Martz <matt@sivel.net>
Reviewed-by: Shane McDonald <me@shanemcd.com>
(cherry picked from commit db9e74a)
Shrews added a commit that referenced this pull request Mar 21, 2022
Normalize python package names during sanitization

Fixes #351
Older versions of pip cannot handle duplicate entries of a python package within a requirements file. E.g.,
python-dateutil>=2.8.2
python_dateutil

Newer versions of pip can handle this fine.
ansible-builder sanitizes requirements from multiple sources (collections) by removing duplicates. However, it doesn't currently account for package names that are not normalized (python-dateutil should be the same as python_dateutil). So in an EE environment with older versions of pip, the pip install portion could fail with an error similar to:
ERROR: Double requirement given: python-dateutil>=2.8.2 (from -r /tmp/r.txt (line 2)) (already in python_dateutil (from -r /tmp/r.txt (line 1)), name='python-dateutil')

This change normalizes the package names (since the underlying parsing library is not doing that for us).

Reviewed-by: Matt Martz <matt@sivel.net>
Reviewed-by: Shane McDonald <me@shanemcd.com>
(cherry picked from commit db9e74a)
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.

ansible-builder failed to build EE for cisco.aci because of Double requirement given
3 participants