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

[INTERNAL] BuildEnvironment.install_requirements cannot be called twice #5904

Closed
pfmoore opened this issue Oct 20, 2018 · 9 comments
Closed
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@pfmoore
Copy link
Member

pfmoore commented Oct 20, 2018

Environment

  • pip version: 18.1

Description
The internal API BuildEnvironment.install_requirements does not work correctly when called twice. Because it uses --ignore-installed to allow installing requirements into the build environment that are already present in the system environment, it's possible for a second call to the function to install a requirement that is already present (possibly a different version) resulting in a corrupted build environment.

Expected behavior
Multiple calls to install_requirements should work the same way as multiple pip install invocations.

How to Reproduce
See the discussion in #5743 (in particular the comments starting here).

As this is an internal API, it is not possible to see an issue using pip as a command line app. However, the changes required for PEP 517 need this capability, so the problem has the potential to cause issues when PEP 517 support lands (specifically, if pyproject.toml and the build backend's get_requires_for_build_wheel hook return different versions of the same project).

@pfmoore pfmoore mentioned this issue Oct 20, 2018
8 tasks
@pradyunsg
Copy link
Member

#5286 (comment)

Given #5841, I'm not sure if that option is still needed.

@benoit-pierre
Copy link
Member

Why not?

@pfmoore
Copy link
Member Author

pfmoore commented Oct 24, 2018

Surely there could be other packages in the sys.executable site-packages? If the site-packages had setuptools installed, for example, then doing env.install_requirements(finder, ['setuptools'], 'xxx') wouldn't install setuptools without --ignore-installed.

@benoit-pierre
Copy link
Member

Indeed.

@benoit-pierre
Copy link
Member

Anyway, I've a WIP for this, I'll push something by the end of the week.

@pfmoore
Copy link
Member Author

pfmoore commented Oct 24, 2018

Oh, cool! Thanks - I've been thinking about this but struggling to find a good way of implementing it. Looking forward to seeing your PR :-)

@pfmoore
Copy link
Member Author

pfmoore commented Nov 2, 2018

Fix now in #5743

@pradyunsg
Copy link
Member

Closing since it's in the PR now.

@lock
Copy link

lock bot commented May 31, 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 May 31, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 31, 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
Projects
None yet
Development

No branches or pull requests

3 participants