Ich habe eine Bibliothek (subx), die von subprocess32 abhängt. Die Bibliothek subprocess32 ist ein Backport für Python2.7 und bietet das Timeout kwarg.Dependency Management: Subprozess32 benötigt für Python2.7
Meine Bibliothek benötigt das Timeout Kwarg.
Ich brauche subprocess32 nur, wenn die Zielplattform Python2.x ist.
Wie soll ich die Abhängigkeit in meinem Projekt definieren?
Ich erhalte diese Fehlermeldung, wenn ich eine Abhängigkeit subprocess32
über "install_requires" (setup.py) und ich bin in einem python3 virtualenv definieren:
===> 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/
Dies scheint eine vollständige Antwort zu sein. In Windows 'sys.platform' wird jedoch' win32' für Windows und 'cygwin' für Windows/Cygwin gedruckt. –
@ElisByberi afaik grundlegende Ausdrücke werden unterstützt, so "win32" == sys_platform oder "cygwin" == sys_platform sollte funktionieren. Es gibt jedoch andere Umgebungsmarkierungen wie "Plattformsystem", die diesem Fall wahrscheinlich besser entsprechen würden. Überprüfen Sie erneut [PEP 508] (https://www.python.org/dev/peps/pep-0508/#environment-markers) für weitere Details. – hoefling