hadoop - python dependencies install according machine host? -
there way in python, install dependencies according libs in host machine? "issue" have package shall work in machine , without lib e.q: hadoop.
but, pydoop falling when not installed in host. possible make wheel intelligent enough not installs pydoop in machines not have hadoop installed?
it possible, don't recommend that. instead, make 'extra' option in distribution using setuptools:
extras_require: dictionary mapping names of “extras” (optional features of project) strings or lists of strings specifying other distributions must installed support features. see section below on declaring dependencies details , examples of format of argument.
so setup.py
have this:
setup( name="pyagus", ... extras_require={ 'hadoop': ["pydoop"], } )
leave user decide whether install optional hadoop support or not. note "user" in case might orchestration repo, e.g. salt / ansible / puppet.
if want dynamically decide whether install or not based upon inspecting libs avail on source machine, can using post-install script or adding logic generating install_requires
argument directly setup.py
. both methods hacky , pypa has open ticket that, if want follow discussion.
Comments
Post a Comment