Say I want to install pyodbc
. It can't be build on some Windows machines but there's an alternative - pypyodbc
which is pure python implementation of pyobdc
.
Is there a way to specify install_requires=["pyobdc"]
for setuptools.setup
with falling back to pypyodbc
if the former package wasn't installed?
UPD: My solution for this particular situation:
import sys
from setuptools import setup
if sys.platform.startswith("win"):
pyodbc = "pypyodbc>=1.2.0"
else:
pyodbc = "pyodbc>=3.0.7"
...
setup(
...
install_requires=[pyobdc]
)
But I still look for a more general solution.