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

pip ignores --global-option and --install-options when installing from a VCS url #5518

Closed
rainwoodman opened this issue Jun 19, 2018 · 5 comments · Fixed by #6389
Closed
Labels
auto-locked Outdated issues that have been locked by automation C: vcs pip's interaction with version control systems like git, svn and bzr type: bug A confirmed bug or unintended behavior

Comments

@rainwoodman
Copy link

Environment

  • pip version: 10.0.1
  • Python version: 3.6.5
  • OS: Linux

Description
pip 10.0.1 ignores --install-options installing from git+git://

Likely related to

#5251

$ pip install --ignore-installed --no-deps --install-option="--prefix=/tmp/test-install" git+git://github.com/bccp/nbodykit

$ ls /tmp/test-install
ls: cannot access '/tmp/test-install': No such file or directory

However, installing from zip works:

$ pip install --ignore-installed --no-deps --install-option="--prefix=/tmp/test-install" http://github.com/bccp/nbodykit/archive/master.zip

$ ls /tmp/test-install
lib

Expected behavior
installing from VCS shall be no different than from a zip file.

How to Reproduce
See above.

Output

See above.

@pradyunsg pradyunsg added type: bug A confirmed bug or unintended behavior C: vcs pip's interaction with version control systems like git, svn and bzr S: needs triage Issues/PRs that need to be triaged labels Jun 27, 2018
@pradyunsg
Copy link
Member

This looks like a bug to me. I don't have the bandwidth to investigate though. :(

@jwhite007
Copy link

jwhite007 commented Aug 25, 2018

Environment

  • pip version: 18.0
  • Python version: 3.7.0 (installed via Linuxbrew)
  • OS: Red Hat Enterprise Linux Server release 6.6 (Santiago)

Description
Same thing happens for me using git with ssh. The following installs to Python 3.7.0's site-packages and not to <path to dir>/lib/Python3.7/site-packages/ as expected.

$ pip3 install --install-option="--prefix=<path to dir>" git+ssh://<host>:<repo>

The following does install to <path to dir>/lib/Python3.7/site-packages/ as expected

$ git clone <host>:<repo>
$ pip3 install --install-option="--prefix=<path to dir>" ./<repo>

Both installations give UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.

The former (install from git via ssh) also gives

Building wheels for collected packages: cgldb
  Running setup.py bdist_wheel for cgldb ... done
  Stored in directory: /tmp/pip-ephem-wheel-cache-z3m391el/wheels/a8/99/4d/eebf5e88bdd2909e65353b3ccc03761facab89925a55faf3f6

@kneufeld
Copy link

Can confirm that this is still an issue with pip 19.0.1 and git+https

@cjerdonek
Copy link
Member

cjerdonek commented Apr 8, 2019

Someone reported this issue again as #6379 (but for --global-option rather than --install-option).

I diagnosed it there in this comment and am copying my findings here since that issue is now closed as a duplicate:

When --global-option (or --install-option) is passed, pip disallows binaries for that requirement:

names = ["build_options", "global_options", "install_options"]
if any(map(getname, names)):
control = options.format_control
control.disallow_binaries()
warnings.warn(
'Disabling all use of wheels due to the use of --build-options '
'/ --global-options / --install-options.', stacklevel=2,
)

However, when pip gets to the point where it needs to decide whether to build a wheel or fall back to using setup.py, it looks at whether it's a VCS checkout before checking whether binaries were disallowed:

if req.link and not req.link.is_artifact:
# VCS checkout. Build wheel just for this run.
return True
if "binary" not in format_control.get_allowed_formats(
canonicalize_name(req.name)):
logger.info(
"Skipping bdist_wheel for %s, due to binaries "
"being disabled for it.", req.name,
)
return None

So the fix should be pretty simple (just reverse those two checks, I believe).

@cjerdonek cjerdonek changed the title pip 10.0.1 ignores --install-options installing from git+git:// pip ignores --global-option and --install-options when installing from a VCS url Apr 8, 2019
@cjerdonek cjerdonek removed the S: needs triage Issues/PRs that need to be triaged label Apr 8, 2019
@cjerdonek
Copy link
Member

I posted PR #6389 to address this.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 8, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 8, 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: vcs pip's interaction with version control systems like git, svn and bzr type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants