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

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -