Passing arguments to python setup.py install_requires list
I used pip to install PIL. Installation requires two additional arguments. Thus, the command to install looks something like this.
pip install PIL --allow-external PIL --allow-unverified PIL
I need to add a PIL package to my setup.py file. Adding PIL to the list install_requires
installs PIL, but it doesn't work as I need to install PIL with additional arguments.
So how can I add PIL to a list install_requires
with additional arguments?
source to share
There is currently no way to specify additional arguments install_requires
in setup.py. But I solved the problem of installing dependencies using global-options
by subclassing the class setuptools.command.install
and overriding its method run()
, for example the following code -
from setuptools import setup
from setuptools.command.install import install
from subprocess import call
class CustomInstall(install):
def run(self):
install.run(self)
call(['pip', 'install', 'PIL', '--allow-external', 'PIL', '--allow-unverified', 'PIL'])
setup( ...
cmdclass={
'install': CustomInstall,
},
)
source to share