Created
July 3, 2022 15:02
-
-
Save shaib/3834afb7b1bddbb9f2fc95db130b329b to your computer and use it in GitHub Desktop.
poetry add fails to update constraint for packages with a capitalized name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ poetry add -vvv django=~4.0.0 | |
Using virtualenv: /home/slate/.cache/pypoetry/virtualenvs/demo-hKjNfXom-py3.10 | |
PyPI: No release information found for django-1.0.1, skipping | |
PyPI: No release information found for django-1.0.2, skipping | |
PyPI: No release information found for django-1.0.3, skipping | |
PyPI: No release information found for django-1.0.4, skipping | |
PyPI: No release information found for django-1.1, skipping | |
PyPI: No release information found for django-1.1.1, skipping | |
PyPI: No release information found for django-1.1.2, skipping | |
PyPI: 6 packages found for django >=4.0.0,<4.1.0 | |
Updating dependencies | |
Resolving dependencies... | |
1: fact: demo is 0.1.0 | |
1: derived: demo | |
0: Duplicate dependencies for django | |
1: fact: demo depends on django (^3.2.12) | |
1: fact: demo depends on Django (~4.0.0) | |
1: selecting demo (0.1.0) | |
1: derived: Django (>=4.0.0,<4.1.0) | |
1: conflict: demo depends on django (^3.2.12) | |
1: ! not django (^3.2.12) is satisfied by Django (~4.0.0) | |
1: ! which is caused by "demo depends on Django (~4.0.0)" | |
1: ! thus: version solving failed | |
1: Version solving took 0.004 seconds. | |
1: Tried 1 solutions. | |
Stack trace: | |
8 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/clikit/console_application.py:131 in run | |
129│ parsed_args = resolved_command.args | |
130│ | |
→ 131│ status_code = command.handle(parsed_args, io) | |
132│ except KeyboardInterrupt: | |
133│ status_code = 1 | |
7 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/clikit/api/command/command.py:120 in handle | |
118│ def handle(self, args, io): # type: (Args, IO) -> int | |
119│ try: | |
→ 120│ status_code = self._do_handle(args, io) | |
121│ except KeyboardInterrupt: | |
122│ if io.is_debug(): | |
6 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/clikit/api/command/command.py:171 in _do_handle | |
169│ handler_method = self._config.handler_method | |
170│ | |
→ 171│ return getattr(handler, handler_method)(args, io, self) | |
172│ | |
173│ def __repr__(self): # type: () -> str | |
5 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/cleo/commands/command.py:92 in wrap_handle | |
90│ self._command = command | |
91│ | |
→ 92│ return self.handle() | |
93│ | |
94│ def handle(self): # type: () -> Optional[int] | |
4 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/console/commands/add.py:173 in handle | |
171│ self._installer.whitelist([r["name"] for r in requirements]) | |
172│ | |
→ 173│ status = self._installer.run() | |
174│ except BaseException: | |
175│ # Using BaseException here as some exceptions, eg: KeyboardInterrupt, do not inherit from Exception | |
3 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/installation/installer.py:103 in run | |
101│ local_repo = Repository() | |
102│ | |
→ 103│ return self._do_install(local_repo) | |
104│ | |
105│ def dry_run(self, dry_run=True): # type: (bool) -> Installer | |
2 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/installation/installer.py:235 in _do_install | |
233│ ) | |
234│ | |
→ 235│ ops = solver.solve(use_latest=self._whitelist) | |
236│ else: | |
237│ self._io.write_line("Installing dependencies from lock file") | |
1 ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/puzzle/solver.py:65 in solve | |
63│ with self._provider.progress(): | |
64│ start = time.time() | |
→ 65│ packages, depths = self._solve(use_latest=use_latest) | |
66│ end = time.time() | |
67│ | |
SolverProblemError | |
Because demo depends on both django (^3.2.12) and Django (~4.0.0), version solving failed. | |
at ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/puzzle/solver.py:241 in _solve | |
237│ packages = result.packages | |
238│ except OverrideNeeded as e: | |
239│ return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest) | |
240│ except SolveFailure as e: | |
→ 241│ raise SolverProblemError(e) | |
242│ | |
243│ results = dict( | |
244│ depth_first_search( | |
245│ PackageNode(self._package, packages), aggregate_package_nodes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[tool.poetry] | |
name = "demo" | |
version = "0.1.0" | |
description = "" | |
authors = ["Shai Berger <[email protected]>"] | |
license = "MIT" | |
[tool.poetry.dependencies] | |
python = "^3.10" | |
django = "^3.2.12" | |
[tool.poetry.dev-dependencies] | |
[build-system] | |
requires = ["poetry-core>=1.0.0"] | |
build-backend = "poetry.core.masonry.api" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment