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

--install-option bleeds to next dependency in requiremets.txt #4453

Closed
joaopapereira opened this issue Apr 21, 2017 · 7 comments · Fixed by #5090
Closed

--install-option bleeds to next dependency in requiremets.txt #4453

joaopapereira opened this issue Apr 21, 2017 · 7 comments · Fixed by #5090
Labels
auto-locked Outdated issues that have been locked by automation C: requirement file Using `requirements.txt` type: bug A confirmed bug or unintended behavior

Comments

@joaopapereira
Copy link

  • Pip version: 9.0.1
  • Python version: 2.7.13
  • Operating system: MacOS

Description:

Try to add --install-option to a dependency inside requirements.txt

What I've run:

Current requirements file:

chromedriver_installer==0.0.6 --install-option='--chromedriver-version=2.29'

pyperclip~=1.5.27

pip install -r requirements.txt
output:

$ pip install -r regression/requirements.txt
/usr/local/lib/python2.7/site-packages/pip/req/req_file.py:150: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.
  cmdoptions.check_install_build_global(options, opts)
Collecting chromedriver_installer==0.0.6 (from -r regression/requirements.txt (line 1))
  Using cached chromedriver_installer-0.0.6.tar.gz
Collecting pyperclip~=1.5.27 (from -r regression/requirements.txt (line 2))
  Using cached pyperclip-1.5.27.zip
Skipping bdist_wheel for chromedriver-installer, due to binaries being disabled for it.
Skipping bdist_wheel for pyperclip, due to binaries being disabled for it.
Installing collected packages: chromedriver-installer, pyperclip
  Running setup.py install for chromedriver-installer ... done
  Running setup.py install for pyperclip ... error
    Complete output from command /usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/bs/pdhjk2153v7c4gnrmphrf9tc0000gn/T/pip-build-wn0baT/pyperclip/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/bs/pdhjk2153v7c4gnrmphrf9tc0000gn/T/pip-ZGpYhV-record/install-record.txt --single-version-externally-managed --compile --chromedriver-version=2.29:
    usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: -c --help [cmd1 cmd2 ...]
       or: -c --help-commands
       or: -c cmd --help

    error: option --chromedriver-version not recognized

    ----------------------------------------
Command "/usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/bs/pdhjk2153v7c4gnrmphrf9tc0000gn/T/pip-build-wn0baT/pyperclip/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/bs/pdhjk2153v7c4gnrmphrf9tc0000gn/T/pip-ZGpYhV-record/install-record.txt --single-version-externally-managed --compile --chromedriver-version=2.29" failed with error code 1 in /private/var/folders/bs/pdhjk2153v7c4gnrmphrf9tc0000gn/T/pip-build-wn0baT/pyperclip/

If I change the file to:

pyperclip~=1.5.27

chromedriver_installer==0.0.6 --install-option='--chromedriver-version=2.29'

Output:

$ pip install -r regression/requirements.txt
/usr/local/lib/python2.7/site-packages/pip/req/req_file.py:150: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.
  cmdoptions.check_install_build_global(options, opts)
Collecting pyperclip~=1.5.27 (from -r regression/requirements.txt (line 1))
  Using cached pyperclip-1.5.27.zip
Collecting chromedriver_installer==0.0.6 (from -r regression/requirements.txt (line 2))
  Using cached chromedriver_installer-0.0.6.tar.gz
Skipping bdist_wheel for pyperclip, due to binaries being disabled for it.
Skipping bdist_wheel for chromedriver-installer, due to binaries being disabled for it.
Installing collected packages: pyperclip, chromedriver-installer
  Running setup.py install for pyperclip ... done
  Running setup.py install for chromedriver-installer ... done
Successfully installed chromedriver-installer-0.0.6 pyperclip-1.5.27
@dennylab
Copy link

+1

@xavfernandez
Copy link
Member

Related to #4118

@glennmatthews
Copy link

Related to #3830?

@guyschlider
Copy link

+1

@Kentzo
Copy link

Kentzo commented Dec 30, 2017

Another problem: it disallows usage of wheels for all packages.

@pradyunsg
Copy link
Member

This is the same issue as reported in #3763. I just reproduced it on my machine, with the latest master.

@pradyunsg pradyunsg added type: bug A confirmed bug or unintended behavior C: requirement file Using `requirements.txt` labels Dec 30, 2017
simnalamburt added a commit to devsisters/pip that referenced this issue Feb 1, 2018
Prevent '--install-option' and '--global-option' from leaking into the
next dependencies in the 'requirements.txt' file.

You should not mutate the parameters provided by the caller unless you
are aware of what you're doing.

    # BAD! Mutating the parameter!
    def bad(param):
        param += ['a']

    # OK. Binding a new object to the name.
    def good(param):
        param = param + ['a']

Fixes pypa#3763, pypa#3830, and pypa#4453.

Reference:
  https://github.com/simnalamburt/snippets/blob/master/python/pip-4453.py
@lock
Copy link

lock bot commented Jun 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 2, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: requirement file Using `requirements.txt` type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants