I have a library (subx) which depends on subprocess32. The subprocess32 library is a backport for Python2.7 and provides the timeout kwarg.
My library needs the timeout kwarg.
I need subprocess32 only if the target platform is Python2.x.
How should I define the dependency in my project?
I get this error message, if I define a dependency to subprocess32
via "install_requires" (setup.py) and I am inside a python3 virtualenv:
===> pip install -e git+https://github.com/guettli/subx.git#egg=subx
Obtaining subx from git+https://github.com/guettli/subx.git#egg=subx
Cloning https://github.com/guettli/subx.git to ./src/subx
Collecting subprocess32 (from subx)
Using cached subprocess32-3.2.7.tar.gz
Complete output from command python setup.py egg_info:
This backport is for Python 2.x only.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-lju3nl1y/subprocess32/
sys.platform
will printwin32
for Windows andcygwin
for Windows/Cygwin. – Floris