Skip to content
Commit 193292bc authored by Jon Dufresne's avatar Jon Dufresne
Browse files

Use environment markers to define Python2 specific dependencies

The "futures" package need only be installed on Python 2. To specify a
conditional dependency, setuptools, pip, and wheel support "environment
markers". Use this mechanism instead of adding install time logic to the
setup.py file.

Allows restoring universal wheel support, allowing a single wheel for
all version of Python.

For additional details on wheel support for environment markers, see the
documentation at:

https://wheel.readthedocs.io/en/stable/index.html#defining-conditional-dependencies

> Defining conditional dependencies
>
> In wheel, the only way to have conditional dependencies (that might
> only be needed on certain platforms) is to use environment markers as
> defined by PEP 426.
>
> ...
>
> As of setuptools 36.2.1, you can pass extras as part of
> install_requires. The above requirements could thus be written like
> this:
>
> install_requires=[
>     'argparse; python_version=="2.6"',
>     'keyring; extra=="signatures"',
>     'pyxdg; extra=="signatures" and sys_platform!="win32"',
>     'ed25519ll; extra=="faster-signatures"'
> ]
parent 88a23e8a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment