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

vstinner opened this issue Jan 7, 2014 · 2 comments


Copy link

commented Jan 7, 2014


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:

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

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


This comment has been minimized.

Copy link
Contributor Author

commented Jan 10, 2014

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 :-))


This comment has been minimized.

Copy link

commented May 21, 2014

Related issue #1795

dstufft added a commit to dstufft/pip that referenced this issue Nov 20, 2014
Fix issue pypa#1433: parse requirements in markers
* InstallRequirement supports PEP 426 markers
* RequirementSet.add_requirement() ignores an InstallRequirement if
  markers don't match.

@lock lock bot added the S: auto-locked 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.
None yet
2 participants
You can’t perform that action at this time.