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

Support markers in requirements files #1433

Closed
vstinner opened this issue Jan 7, 2014 · 2 comments
Closed

Support markers in requirements files #1433

vstinner opened this issue Jan 7, 2014 · 2 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@vstinner
Copy link
Contributor

vstinner commented Jan 7, 2014

Hi,

I'm working on the OpenStack project which uses "requirements.txt" text files to list dependencies. The problem is that there are dependencies which are Python 2 specific, whereas others are only working on Python 3. I need a way to specify that such dependency is only for Python 2 or only for Python 3. Supporting markers in requirements.txt would be a generic solution, example of syntax:

iso8601
mox [sys.version_info < (3,)]
mox3 [sys.version_info >= (3,)]

Python 2 would install iso8601 and mox, Python 3 would install iso8601 and mox3.

@vstinner
Copy link
Contributor Author

Another usecase. I'm working on a port of the new Tulip project (written for Python 3.3+) on Python 2: Trollius. Trollius uses backports of Python 3 modules for Python 2. Trollius on Python 2.7 requires futures, on Python 2.6 it requires futures and ordereddict.

I don't see how to specify in requirements.txt that I don't want to install ordereddict on Python 2.7 (collections.OrderedDict is already available), but only on Python 2.6.

(Trollius is not related to tox or OpenStack, at least, not yet :-))

@piotr-dobrogost
Copy link

Related issue #1795

dstufft pushed a commit to dstufft/pip that referenced this issue Nov 20, 2014
* InstallRequirement supports PEP 426 markers
* RequirementSet.add_requirement() ignores an InstallRequirement if
  markers don't match.
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

2 participants