[openstack-dev] [Openstack] [all][infra][requirements] Odd cases in requirements?

Jeremy Stanley fungi at yuggoth.org
Wed Nov 9 15:36:42 UTC 2016


On 2016-11-09 07:19:04 -0800 (-0800), John Villalovos wrote:
> Sort of related, what is the plan for supporting requirements which are
> Python 3 only packages?
> 
> In particular the package: mypy-lang
> https://pypi.python.org/pypi/mypy-lang
[...]

If you only want mypy-lang installed when the interpreter is Python
3.3 or later (what their trove classifiers seem to imply for
supported versions), use the following environment marker syntax:

    mypy-lang;python_version>='3.3'

(see dnspython3 in global-requirements.txt for a similar example)

https://pip.pypa.io/en/stable/reference/pip_install/#requirement-specifiers
https://www.python.org/dev/peps/pep-0426/#environment-markers
-- 
Jeremy Stanley



More information about the OpenStack-dev mailing list