Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipenv install CLI option to pass options through to pip #4360

Closed
ncoghlan opened this issue Jun 22, 2020 · 4 comments
Closed

pipenv install CLI option to pass options through to pip #4360

ncoghlan opened this issue Jun 22, 2020 · 4 comments
Labels
triage Type: Enhancement 💡 This is a feature or enhancement request.

Comments

@ncoghlan
Copy link
Member

#287 and #3734 are previous requests to support passing pip options to the pipenv install command line, and both were closed with the suggestion to use pip's environment variable based settings.

There are a couple of key usability problems with handling those requests that way:

  • it doesn't work very well on Windows, as Windows shells don't support the PIP_ONLY_BINARY=:all: pipenv install <project> notation to set an env var for one command
  • when an option is not spelled correctly, it is silently ignored by pip rather than reporting an error (I originally wrote my command as PIP_BINARY_ONLY=1 before debugging it with a plain pip install invocation)

More generally, there are some pip options that pipenv should really be intercepting anyway, to either use as input to the dependency resolution process, or else to emit warnings about potential discrepancies between pip install results and pipenv lock results (think --prefer-binary, --only-binary, --no-binary, --platform, --python-version, --implementation, --abi, --upgrade, --upgrade-strategy, --require-hashes, --constraint, --ignore-install, --ignore-requires-python, --index-url, --extra-index-url, --find-links, --no-index-url).

@fridex
Copy link
Contributor

fridex commented Jun 22, 2020

+1 for this one. I'm personally not familiar with Pipenv sources, but maybe one suggestion - in micropipenv we used double dashes to distinguish parameters passed to pip. This way we did not need to enumerate all the parameters pip potentially supports. I'm not sure about affecting other already existing Pipenv options though.

@matteius matteius added the Type: Enhancement 💡 This is a feature or enhancement request. label Aug 22, 2022
@matteius
Copy link
Member

I took a stab at adding the ability to pass --extra-pip-options="" to pipenv. There is a branch and it seems to work -- would be cool if anyone could try it (tagged to this ticket) and I'll look into adding tests.

@matteius
Copy link
Member

This was completed.

@maruiz93
Copy link

maruiz93 commented Jul 10, 2023

Hi! I've tried to use this --extra-pip-options with --abi or --python-version and seem to be ignored. Is this intended?

When I try: pipenv sync --dev -v --extra-pip-args="-v --abi=cp39 --target=install-test --only-binary=:all:"

I keep seeing this lines:

$ /home/manon/.local/share/virtualenvs/product-ci-cd-Lmnw-9_Y/bin/python /home/manon/.local/share/virtualenvs/product-ci-cd-Lmnw-9_Y/lib/python3.9/site-packages/pipenv/patched/pip/__pip-runner__.py install -i https://pypi.org/simple --no-input --pre --upgrade --no-deps --exists-action=i -v --abi=cp39 --target=install-test --only-binary=:all: -r /tmp/pipenv-pgzz9y4h-requirements/pipenv-lc2r65ds-hashed-reqs.txt
Using source directory: '/home/manon/.local/share/virtualenvs/product-ci-cd-Lmnw-9_Y/src'
Using pip 23.0.1 from /home/manon/.local/share/virtualenvs/product-ci-cd-Lmnw-9_Y/lib/python3.9/site-packages/pipenv/patched/pip (python 3.9)

Collecting rpds-py==0.7.1

  Downloading rpds_py-0.7.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB)

But I expect the downloaded package to be:

rpds_py-0.7.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Type: Enhancement 💡 This is a feature or enhancement request.
Projects
None yet
Development

No branches or pull requests

4 participants