-
Notifications
You must be signed in to change notification settings - Fork 98
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
Expose a way to exclude dependencies #664
Conversation
Hi, thanks for working on this!
|
@kurokobo that is correct. We discussed this when architecting the functionality, and should a package that is excluded have a backslash with a newline, it will likely cause problems. We don't plan to add any specific functionality to permit or deny newlines, but we do intend to add documentation that states that it is in the best interest of everyone for collection maintainers, and EE creators to use pep508 formatted requirements files. We may be going so far to add linting rules, potentially via |
@sivel If we strictly follow pep508, even any comments ( F.Y.I., to support line continuations, we need just one modification (I don't think it will be adopted, but I'll write it down as I think of it😅 ). diff --git a/src/ansible_builder/_target_scripts/introspect.py b/src/ansible_builder/_target_scripts/introspect.py
index 553cf81..c32d121 100644
--- a/src/ansible_builder/_target_scripts/introspect.py
+++ b/src/ansible_builder/_target_scripts/introspect.py
@@ -26,7 +26,7 @@ def read_req_file(path):
def pip_file_data(path):
- pip_content = read_req_file(path)
+ pip_content = read_req_file(path).replace('\\\n', '')
pip_lines = []
for line in pip_content.split('\n'): |
214ab87
to
482de8d
Compare
Comments will be allowed. Any non-pep508 compliant entries are going to be passed through without change, unchecked and unverified. We plan to update the docs that using such non-compliant entries will be considered undefined/unsupported behavior. |
fc1d218
to
254ef4b
Compare
Hi there, unfortunately #664 appears to be breaking numerous previously known-good custom EE builds that I am seeing in a variety of different user environments recently, even those which had already been migrated to v3 spec files, etc. While I'm sure it was well-intentioned, if even a relatively simple custom EE for something like Palo Alto will no longer build if the paloaltonetworks.panos collection itself is given in its galaxy requirements alongside its underlying python requirements (pan-python and pan-os-python), which certainly appears to be the case in ansible-builder 3.1.0, then it probably should be reviewed. Based on the changelog, it seems like it was anticipated that it might "cause build issues in images with older versions of pip that cannot handle duplicate requirement entries". However, even on pip latest, this change (to expectations for the Ansible Builder community on how any duplicate Python dependencies will be handled and resolved at build time) is breaking things, and evidently without any definitive, prescriptive guidance so far on what exactly everyone should do going forward.
|
Hello @djgoosen. In the future, it's better to open a new issue than to comment on a closed PR since we may not always notice these types of comments. The In your particular case, upgrading If that does not resolve your issue, you also have the option of using the new If both of those solutions fail for you, please open a new issue and provide the EE file where you are seeing the problem. |
Based on #647
Changes
requirements_parser
Python dependency.--sanitize
option still exists, but is hidden, and it does nothing.EXCLUDE_REQUIREMENTS
only applied to pip before, simply because sanitize_requirements was only ever used for pip, but it now applies to system as well.requirements.txt
entries are simply pushed down topip
(-r
still causes recursive inclusion inline).exclude
schema keyword is added to version3
EE format and requiresansible-builder
version3.1
or higher. Using an older builder version simply errors.Bug Fixes
#
anchor from requirement URLs (e.g.,git+https://git.repo/some_pkg.git#egg=SomePackage
)Example
TODO:
all_from_collection
orfrom_collection
?)