Skip to content

evaluate env markers for requirements #59

Merged
ido50 merged 2 commits into
python-morgan:mainfrom
RISEFX:fix-environment-markers-on-requirements
Dec 29, 2025
Merged

evaluate env markers for requirements #59
ido50 merged 2 commits into
python-morgan:mainfrom
RISEFX:fix-environment-markers-on-requirements

Conversation

@grische
Copy link
Copy Markdown
Contributor

@grische grische commented Oct 22, 2025

This allows specifying requirements with env markers to be evaluated for
the actually defined envs.

For example, this file with with both Python 3.13+3.7 will pull in importlib-metadata:

[env.linux-py313]
os_name = posix
sys_platform = linux
platform_machine = x86_64
platform_python_implementation = CPython
platform_system = Linux
python_version = 3.13
python_full_version = 3.13.5
implementation_name = cpython

[env.linux-py37]
os_name = posix
sys_platform = linux
platform_machine = x86_64
platform_python_implementation = CPython
platform_system = Linux
python_version = 3.7
python_full_version = 3.7.1
implementation_name = cpython

[requirements]
importlib-metadata = ~=4.5.0; python_version < "3.8"

and once you drop the linux-py37 env, it will stop mirroring it without having to adjust the requirements list as well:

[env.linux-py313]
os_name = posix
sys_platform = linux
platform_machine = x86_64
platform_python_implementation = CPython
platform_system = Linux
python_version = 3.13
python_full_version = 3.13.5
implementation_name = cpython

[requirements]
importlib-metadata = ~=4.5.0; python_version < "3.8"

This allows specifying requirements with env markers to be evaluated for
the actually defined envs.
@ido50 ido50 merged commit 4a1a376 into python-morgan:main Dec 29, 2025
6 checks passed
@grische grische deleted the fix-environment-markers-on-requirements branch January 5, 2026 09:36
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.

2 participants