python - Alternative dependencies (fall back) in setup.py -
say want install pyodbc
. can't build on windows machines there's alternative - pypyodbc
pure python implementation of pyobdc
.
is there way specify install_requires=["pyobdc"]
setuptools.setup
falling pypyodbc
if former package wasn't installed?
upd: solution particular situation:
import sys setuptools import setup if sys.platform.startswith("win"): pyodbc = "pypyodbc>=1.2.0" else: pyodbc = "pyodbc>=3.0.7" ... setup( ... install_requires=[pyobdc] )
but still more general solution.
your solution correct 1 situation. best , more flexible way @ moment achieve task.
Comments
Post a Comment