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 does not update too-old dependencies when installing multiple packages #7135

Closed
Zac-HD opened this issue Oct 4, 2019 · 3 comments
Closed
Labels
auto-locked Outdated issues that have been locked by automation C: dependency resolution About choosing which dependencies to install type: bug A confirmed bug or unintended behavior

Comments

@Zac-HD
Copy link

Zac-HD commented Oct 4, 2019

Description
I'll discuss specific packages, since this has been observed in the wild (HypothesisWorks/hypothesis#2113): we recently updated our install_requires dependency on attrs>=16.0 to attrs>=19.2, on the basis that installing the latest version of Hypothesis would update users' attrs too.

  • pip install hypothesis does indeed work.
  • pip install pytest hypothesis works iff an older version of attrs is not already installed.

It looks like, when multiple packages are listed in an install command, the compatibility of already-installed dependencies are only evaluated for the first package listed and for later packages the presence but not version of dependencies is checked. This also affects the use of requirements files.

Expected behavior

Regardless of other packages listed to install or already present, pip install hypothesis should either result in a compatible set of packages installed or an error message - not a broken environment.

How to Reproduce

[tox]
skipsdist=True
[testenv]
deps =
    pip
    attrs==19.1.0
commands =
    ## Execute the problematic install command
    # pip install hypothesis  # works
    # pip install hypothesis pytest  # works
    pip install pytest hypothesis  #  fails, as does `pip install attrs hypothesis` !
    # pip install --upgrade pytest hypothesis  # works

    ## Check that the installed packages are compatible
    python -c "import hypothesis"

Then run tox --recreate to, well, recreate the virtual environment and run the commands.

(And thanks to everyone working on pip, it's very valuable and much appreciated 😍)

@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label Oct 4, 2019
@pradyunsg
Copy link
Member

pradyunsg commented Oct 4, 2019

Thanks for details and easy reproducer! Much appreciated!

This is basically #988. As a quick summary:

  • pip does print a message in red, with ERROR in all caps.
    ERROR: hypothesis 4.38.2 has requirement attrs>=19.2.0, but you'll have attrs 19.1.0 which is incompatible.
    
  • Use pip check as part of your CI, to make sure pip didn't do something stupid.
  • Use pip-tools (wraps pip with a better resolver) or pipenv (which uses pip-tools) or poetry (which has it's own resolver), to avoid this quirk of pip's resolver.

@pradyunsg pradyunsg added the C: dependency resolution About choosing which dependencies to install label Oct 4, 2019
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Oct 4, 2019
@pradyunsg pradyunsg added the type: bug A confirmed bug or unintended behavior label Oct 4, 2019
@Zac-HD
Copy link
Author

Zac-HD commented Oct 4, 2019

Ah, I see! I checked through the last few pages of issues, but nothing that far back... happy to close this issue as a duplicate, since I don't think it has any extra information?

pckroon pushed a commit to marrink-lab/vermouth-martinize that referenced this issue Oct 4, 2019
pckroon added a commit to marrink-lab/vermouth-martinize that referenced this issue Oct 8, 2019
@Zac-HD
Copy link
Author

Zac-HD commented Oct 13, 2019

Closing as duplicate of #988.

@Zac-HD Zac-HD closed this as completed Oct 13, 2019
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Nov 12, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Nov 12, 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: dependency resolution About choosing which dependencies to install type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants