Skip to content Skip to sidebar Skip to footer

How To Install Separately A Python Package And Its Dependencies Using Pip In Order To Allow Separated Pip Options?

I have (a fork of) a python package that needs an extra option in order to be installed. I found out that this could be done using the --global-option option of pip: pip install --

Solution 1:

Same thing as in your other question, I suspect cythonize is a setuptools command and not a global option.

If it's indeed the case, then you would be better off setting an alias in your setup.cfg. If you run python setup.py alias install cythonize install, this should add the following to your setup.cfg:

[aliases]install = cythonize install

When running pip install later, pip will honor this alias and the cythonize command will be executed right before the install command.

Solution 2:

pip somewhat supports requirements.txt files with inline options. So you could go with a requirements.txt like this:

# ...
cython
git+https://github.com/blaiseli/pybedtools.git@fix_missing_headers --global-option="cythonize"# ...

And install like this:

pip install --requirement requirements.txt

I say somewhat because it still seems to have (apparently non damaging) effects on the installation of the other requirements. In particular it seems to disable wheels for the other requirements and dependencies, which doesn't make sense to me.

Post a Comment for "How To Install Separately A Python Package And Its Dependencies Using Pip In Order To Allow Separated Pip Options?"