Pipenv: Passing through setup.py options

Created on 27 Sep 2017  路  11Comments  路  Source: pypa/pipenv

Pip has an (ugly) mechanism for passing through arguments. When using SciKit Build, these arguments are used to control the CMake build. So, for example:

setup.py install -- "-DCMAKE_MY_ARGUMENT=ON"

can be handled as

pip install . --install-option "--" --install-option "-DCMAKE_MY_ARGUMENT=ON"

(pip also offers a --global-option, but don't provide much info on the difference; I assume this also gets applied to dependencies?)

pipenv doesn't offer a way to pass this through to pip, as far as I can tell. This would make the most sense with . installs, since build arguments are not be stored (AFAIK) in the Pipfile.

Most helpful comment

Is there a way to give these arguments in the Pipfile?

All 11 comments

all of pip's command line options are passable as environment variables.

Use those instead.

Great, I didn't know that, thanks! Sorry for the noise.

No worries at all!

I'd like to add a secion in the docs for this. Could you paste your example in here when you're done?

I take it pipenv doesn't use the Pipfiles in the packages it downloads, but just resorts to the setup.py requires system?

pipenv just runs pip.

PIP_INSTALL_OPTION="-- -DCMAKE_BUILD_TYPE=Release" pipenv install --verbose -e .

would be an example. At one point I had to add --skip-lock to get pipenv not to crash when installing the local package, but that seems to be fine now and can't reproduce.

For some reason, I have to do pipenv install first to get the Pipfile contents to be used, though it seems like it should install requirement first automatically when a Pipfile or Pipfile.lock exists in the current directory? It matters to be because scikit-build packages can't list scikit-build as a dependency to pip, since pip uses setup() which is replaced by scikit-build.

Is there a way to give these arguments in the Pipfile?

@cLupus No.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jacebrowning picture jacebrowning  路  3Comments

AkiraSama picture AkiraSama  路  3Comments

randName picture randName  路  3Comments

fbender picture fbender  路  3Comments

xi picture xi  路  3Comments