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

ansible-builer is not able to parse multiple conditions for requirements.txt #601

Closed
hiyokotaisa opened this issue Sep 4, 2023 · 1 comment

Comments

@hiyokotaisa
Copy link

Description

When specifying multiple conditions for requirements.txt as below, ansible-builder will return error.

cryptography>=3.3.2; python_version == '2.7'
cryptography>=3.0,<3.1; python_version == '3.5'
cryptography>=3.4.7,<37.0.0; python_version == '3.6'
cryptography>=41.0.0; python_version >= '3.7' 

When specifying single condition like this, it will work.

cryptography>=41.0.0; python_version >= '3.7'  

Or adding extra ";" to the previous line works too.

ansible-core>=2.14.2; 
cryptography>=3.3.2; python_version == '2.7' 
cryptography>=3.0,<3.1; python_version == '3.5' 
cryptography>=3.4.7,<37.0.0; python_version == '3.6' 
cryptography>=41.0.0; python_version >= '3.7' 

Steps to Reproduce

[root@ctr1 ~]# cat execution-environment.yml
---
version: 1
build_arg_defaults:
  EE_BASE_IMAGE: registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:latest
  EE_BUILDER_IMAGE: registry.redhat.io/ansible-automation-platform-24/ansible-builder-rhel8:latestdependencies:
  python: requirements.txt 

[root@ctr1 ~]# cat requirements.txt
ansible-core>=2.14.2
cryptography>=3.3.2; python_version == '2.7' 
cryptography>=3.0,<3.1; python_version == '3.5' 
cryptography>=3.4.7,<37.0.0; python_version == '3.6' 
cryptography>=41.0.0; python_version >= '3.7'

Actual Behavior

ERROR: Could not find a version that satisfies the requirement cryptography<3.1,<37.0.0,>=3.0,>=3.1,>=3.3.2,>=3.4.7,>=41.0.0 (from -r /tmp/src/requirements.txt (line 23)) (from versions: 0.1, 0.2, 0.2.1, 0.2.2, 0.3, 0.4, 0.5, 0.5.1, 0.5.2, 0.5.3, 0.5.4, 0.6, 0.6.1, 0.7, 0.7.1, 0.7.2, 0.8, 0.8.1, 0.8.2, 0.9, 0.9.1, 0.9.2, 0.9.3, 1.0, 1.0.1, 1.0.2, 1.1, 1.1.1, 1.1.2, 1.2, 1.2.1, 1.2.2, 1.2.3, 1.3, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.4, 1.5, 1.5.1, 1.5.2, 1.5.3, 1.6, 1.7, 1.7.1, 1.7.2, 1.8, 1.8.1, 1.8.2, 1.9, 2.0, 2.0.1, 2.0.2, 2.0.3, 2.1, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.2, 2.2.1, 2.2.2, 2.3, 2.3.1, 2.4, 2.4.1, 2.4.2, 2.5, 2.6, 2.6.1, 2.7, 2.8, 2.9, 2.9.1, 2.9.2, 3.0, 3.1, 3.1.1, 3.2, 3.2.1, 3.3, 3.3.1, 3.3.2, 3.4, 3.4.1, 3.4.2, 3.4.3, 3.4.4, 3.4.5, 3.4.6, 3.4.7, 3.4.8, 35.0.0, 36.0.0, 36.0.1, 36.0.2, 37.0.0, 37.0.1, 37.0.2, 37.0.3, 37.0.4, 38.0.0, 38.0.1, 38.0.2, 38.0.3, 38.0.4, 39.0.0, 39.0.1, 39.0.2, 40.0.0, 40.0.1, 40.0.2, 41.0.0, 41.0.1, 41.0.2, 41.0.3)
ERROR: No matching distribution found for cryptography<3.1,<37.0.0,>=3.0,>=3.1,>=3.3.2,>=3.4.7,>=41.0.0 (from -r /tmp/src/requirements.txt (line 23))
Error: building at STEP "RUN /output/scripts/assemble": while running runtime: exit status 1 

Expected Behavior

Build should be completed without error.

@github-actions github-actions bot added the needs_triage New item that needs to be triaged label Sep 4, 2023
@Shrews
Copy link
Contributor

Shrews commented Sep 5, 2023

Duplicate of issue #319

This is a limitation of the requirements parsing library used by builder. We are aware of the issue and hope to address it in the future. For now, only very basic features of the the requirements.txt file are supported.

@Shrews Shrews closed this as completed Sep 5, 2023
@Shrews Shrews removed the needs_triage New item that needs to be triaged label Sep 5, 2023
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

No branches or pull requests

2 participants