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 reports version conflict in wrong dependencies #12484

Open
1 task done
jwodder opened this issue Jan 23, 2024 · 4 comments
Open
1 task done

Pip reports version conflict in wrong dependencies #12484

jwodder opened this issue Jan 23, 2024 · 4 comments
Labels
C: dependency resolution About choosing which dependencies to install C: error messages Improving error messages type: bug A confirmed bug or unintended behavior

Comments

@jwodder
Copy link
Contributor

jwodder commented Jan 23, 2024

Description

I have a locally-developed package named dandisets-healthstatus. Its dependencies include pydantic ~= 2.0 and (in an all extra) dandidav @ git+https://github.com/... & dandi (a PyPI package, without any version constraints). dandidav depends on dandi >= 0.58.2. The latest version of dandi on PyPI is 0.59.0.

Unfortunately, what I failed to initially realize was that dandi currently requires Pydantic 1.x (with the upper-version bound enforced by a dependency of dandi). Thus, when I tried to install dandisets-healthstatus with pip install .[all], pip correctly failed due to a version conflict, but the packages that it reported as conflicting actually weren't:

ERROR: Cannot install dandisets-healthstatus and dandisets-healthstatus[all]==0.0.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    dandisets-healthstatus[all] 0.0.0 depends on dandi; extra == "all"
    dandidav 0.0.0 depends on dandi>=0.58.2

If dandiset-healthstatus's dandi dependency is omitted from the list of requirements, then installation fails with a more accurate error message:

ERROR: Cannot install dandi, dandidav and dandisets-healthstatus==0.0.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    dandisets-healthstatus 0.0.0 depends on pydantic~=2.0
    dandi 0.58.2 depends on pydantic>=1.9.0
    dandischema 0.8.4 depends on pydantic<2.0 and >=1.8.1
    dandisets-healthstatus 0.0.0 depends on pydantic~=2.0
    dandi 0.58.2 depends on pydantic>=1.9.0
    dandischema 0.8.3 depends on pydantic<2.0 and >=1.8.1

Expected behavior

Pip should have reported that the Pydantic version requirements conflicted rather than the dandi version requirements.

pip version

23.3.2

Python version

3.11.7

OS

macOS Sonoma 14.2.1

How to Reproduce

  1. git clone https://github.com/dandi/dandisets-healthstatus.git (I promise it won't bite)
  2. cd dandisets-healthstatus
  3. git checkout ea4ebaa6
  4. cd code
  5. If you are testing this in the future, you may need to restrict the dandi requirement in setup.cfg to <= 0.60.0.
  6. python3 -m venv venv
  7. venv/bin/pip install .[all]

Output

A log of all output from pip install -vvv can be found at https://gist.github.com/jwodder/cd49394c1dfb2bb1e17a5aa32f5c4a49.

Code of Conduct

@jwodder jwodder added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Jan 23, 2024
@notatallshaw
Copy link
Member

notatallshaw commented Jan 25, 2024

Unfortunately I am unable to reporduce on Linux using Python 3.11 and I do not have access to an Apple/Mac platform.

I suspect this is the same cause as this issue: #12317

Would you be able to test this branch of Pip and let me know if or what error you get: https://github.com/notatallshaw/pip/tree/23.3.1-without-backjump

@jwodder
Copy link
Contributor Author

jwodder commented Jan 25, 2024

@notatallshaw Were you trying to reproduce the problem by following my instructions? I accidentally omitted the [all] extra from the pip install command (now fixed).

Regardless, when I use that branch (as of commit b21aebb), the installation eventually fails due to an error while trying to build a wheel for PyYAML. The -vvv logs are at https://gist.github.com/jwodder/7e0739f99a70d08663f8051f50d40209.

@notatallshaw
Copy link
Member

Ah yes, I can reproduce now, and it appears to be a different issue than the one I suspected. Unfortunately it is not clear to me immediately what the cause of the issue is, it will likely take some investigation.

@notatallshaw
Copy link
Member

notatallshaw commented Jan 25, 2024

FYI, this does not appear to be caused by any "recent" optimization in Pip, I can reproduce on Pip 23.0.1 (this rules out some potential candidate causes).

@ichard26 ichard26 added C: dependency resolution About choosing which dependencies to install C: error messages Improving error messages and removed S: needs triage Issues/PRs that need to be triaged labels Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: dependency resolution About choosing which dependencies to install C: error messages Improving error messages type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants