pypa / pipenv

Python Development Workflow for Humans.
https://pipenv.pypa.io
MIT License
24.86k stars 1.87k forks source link

Cannot update package from private index #6051

Open edwinjosegeorge opened 10 months ago

edwinjosegeorge commented 10 months ago

I have a pipfile, where i have added url to a private package repository. The package is updated and i wish to update in my local machine. But when i issue update command, the lock fails. Each time, I have to delete and rebuild the lock, which in effect updates all other packages. This issue is not seen if I tend to update public packages.

>>> pipenv update my-private-package --index privateindex --verbose
Building requirements...
Resolving dependencies...
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.starting()
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.adding_requirement(SpecifierRequirement('my-private-package'), None)
CRITICAL:pipenv.patched.pip._internal.resolution.resolvelib.factory:Cannot install my-private-package because these package versions have conflicting dependencies.
INFO:pipenv.patched.pip._internal.resolution.resolvelib.factory:
The conflict is caused by:
    The user requested my-private-package
    The user requested (constraint) my-private-package
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/pipenv/2023.11.15/libexec/lib/python3.12/site-packages/pipenv/patched/pip/_vendor/resolvelib/resolvers.py", line 397, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
  File "/opt/homebrew/Cellar/pipenv/2023.11.15/libexec/lib/python3.12/site-packages/pipenv/patched/pip/_vendor/resolvelib/resolvers.py", line 174, in _add_to_criteria
    raise RequirementsConflicted(criterion)
pipenv.patched.pip._vendor.resolvelib.resolvers.RequirementsConflicted: Requirements conflict: SpecifierRequirement('my-private-package')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/pipenv/2023.11.15/libexec/lib/python3.12/site-packages/pipenv/patched/pip/_internal/resolution/resolvelib/resolver.py", line 95, in resolve
    result = self._result = resolver.resolve(
                            ^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.11.15/libexec/lib/python3.12/site-packages/pipenv/patched/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.11.15/libexec/lib/python3.12/site-packages/pipenv/patched/pip/_vendor/resolvelib/resolvers.py", line 399, in resolve
    raise ResolutionImpossible(e.criterion.information)
pipenv.patched.pip._vendor.resolvelib.resolvers.ResolutionImpossible: [RequirementInformation(requirement=SpecifierRequirement('my-private-package'), parent=None)]
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/pipenv/2023.11.15/libexec/lib/python3.12/site-packages/pipenv/utils/resolver.py", line 440, in resolve
    results = resolver.resolve(constraints, check_supported_wheels=False)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.11.15/libexec/lib/python3.12/site-packages/pipenv/patched/pip/_internal/resolution/resolvelib/resolver.py", line 104, in resolve
    raise error from e
pipenv.patched.pip._internal.exceptions.DistributionNotFound: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/pipenv/2023.11.15/libexec/lib/python3.12/site-packages/pipenv/resolver.py", line 675, in <module>
    main()
  File "/opt/homebrew/Cellar/pipenv/2023.11.15/libexec/lib/python3.12/site-packages/pipenv/resolver.py", line 661, in main
    _main(
  File "/opt/homebrew/Cellar/pipenv/2023.11.15/libexec/lib/python3.12/site-packages/pipenv/resolver.py", line 645, in _main
    resolve_packages(
  File "/opt/homebrew/Cellar/pipenv/2023.11.15/libexec/lib/python3.12/site-packages/pipenv/resolver.py", line 612, in resolve_packages
    results, resolver = resolve(
                        ^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.11.15/libexec/lib/python3.12/site-packages/pipenv/resolver.py", line 592, in resolve
    return resolve_deps(
           ^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.11.15/libexec/lib/python3.12/site-packages/pipenv/utils/resolver.py", line 908, in resolve_deps
    results, hashes, internal_resolver = actually_resolve_deps(
                                         ^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.11.15/libexec/lib/python3.12/site-packages/pipenv/utils/resolver.py", line 681, in actually_resolve_deps
    resolver.resolve()
  File "/opt/homebrew/Cellar/pipenv/2023.11.15/libexec/lib/python3.12/site-packages/pipenv/utils/resolver.py", line 442, in resolve
    raise ResolutionFailure(message=str(e))
pipenv.exceptions.ResolutionFailure: ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
✘ Locking Failed!

This is my pipfile. (other packages are hidden)

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[[source]]
url = "${SECRET_URL}"
verify_ssl = true
name = "privateindex"

[packages]
....
my-private-package = {version = "*", index = "privateindex"}

[dev-packages]
...

[requires]
python_version = "3.11"
IceFlock commented 9 months ago

Same situation and problem here. Have to resort to a full lock (which works fine) and resetting every chunk except what I wanted to update.

matteius commented 9 months ago

Ah interesting, your issues relate to update/upgrade code path and not full lock. We'll have to look into this further, but for me I fly out for work tomorrow so I won't have immediate time.

matteius commented 1 day ago

Please recheck with 2024.3.0