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

Use environment markers from setup.py install_requires #1749

Open
gforcada opened this issue Nov 30, 2022 · 1 comment
Open

Use environment markers from setup.py install_requires #1749

gforcada opened this issue Nov 30, 2022 · 1 comment
Labels
markers Related to environment markers setuptools Related to compiling requirements with `setuptools` build backend

Comments

@gforcada
Copy link

What's the problem this feature will solve?

On a setup.py we have:

setup(
    ...
    install_requires=[
        'stdlib-list; python_version < "3.10"',
        ...
    ]
)

On our requirements.in we have:

-e file:.#z3c.dependencychecker[test]

But the environment marker defined on setup.py does not land in requirements.txt once we run pip-compile requirements.in:

stdlib-list==0.8.0
    # via z3c-dependencychecker

Describe the solution you'd like

Get the environment marker from setup.py land in requirements.txt

stdlib-list==0.8.0 ; python_version < "3.10"
    # via z3c-dependencychecker

Alternative Solutions

The workaround so far is to manually add stdlib-list ; python_version < "3.10" on requirements.in, which is not a big deal, but if defeats the purpose of using -e file:.#z3c.dependencychecker[test] on requirements.in

Additional context

https://peps.python.org/pep-0508/#environment-markers

Thanks for this wonderful package! ✨ ❤️ it saved plenty of work/hobby hours of mine! 🙇🏾

@atugushev
Copy link
Member

AFAIK pip-tools don't support transitional env markers. However this pip-compile setup.py should work.

@atugushev atugushev added setuptools Related to compiling requirements with `setuptools` build backend markers Related to environment markers labels Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
markers Related to environment markers setuptools Related to compiling requirements with `setuptools` build backend
Projects
None yet
Development

No branches or pull requests

2 participants