-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Petry version solving failed because apparently ignoring markers = "sys_platform == 'darwin'" #8135
Comments
what you have given as your
please provide an actual repro |
I don't have a public repo for this. For sake of simplicity, I had renamed my main application deleteme_main ===depends on===> deleteme_dep ===depends on===> (SimpleITK <2.1.0 on linux or 2.2.1 on darwin). [tool.poetry]
name = "deleteme_dep"
version = "1.0.0"
description = "Deleteme main"
authors = ["Foo BAR <foo.bar@gmail.com>"]
readme = "README.md"
packages = [
{ include = "deleteme_dep", from = "src" }
]
[tool.poetry.dependencies]
python = ">=3.9, <3.10"
SimpleITK = [
{ version = "<2.1.0", markers = "sys_platform == 'linux'" },
{ version = "2.2.1", markers = "sys_platform == 'darwin'" }
]
[[tool.poetry.source]]
name = "nexus"
url = "privatenexuspull"
default = true
[[tool.poetry.source]]
name = "nexus"
url = "privatenexuspush"
default = false
secondary = true
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api" [tool.poetry]
name = "deleteme_main"
version = "1.0.0"
description = "Deleteme main"
authors = ["Foo BAR <foo.bar@gmail.com>"]
readme = "README.md"
packages = [
{ include = "deleteme_main", from = "src" }
]
[tool.poetry.dependencies]
python = ">=3.9, <3.10"
deleteme_dep = "1.0.0"
SimpleITK = [
{ version = "<2.1.0", markers = "sys_platform == 'linux'" },
{ version = "2.2.1", markers = "sys_platform == 'darwin'" }
]
[[tool.poetry.source]]
name = "nexus"
url = "privatenexuspull"
default = true
[[tool.poetry.source]]
name = "nexus"
url = "privatenexuspush"
default = false
secondary = true
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api" But, in my overall application, I have other dependencies. 1: fact: deleteme_dep (1.0.0) depends on Pillow (9.4.0)
1: fact: deleteme_dep (1.0.0) depends on loguru (0.6.0)
1: fact: deleteme_dep (1.0.0) depends on numpy (1.23.5)
1: fact: deleteme_dep (1.0.0) depends on pandas (1.2)
1: fact: deleteme_dep (1.0.0) depends on python-gdcm (3.0.20)
1: fact: deleteme_dep (1.0.0) depends on scikit-image (0.19.3)
1: fact: deleteme_dep (1.0.0) depends on simpleitk (<2.1.0)
1: fact: deleteme_dep (1.0.0) depends on toml (0.10.2)
1: derived: toml (==0.10.2)
1: conflict: deleteme_dep (1.0.0) depends on simpleitk (<2.1.0)
1: ! deleteme_dep (==1.0.0) is satisfied by deleteme_dep (==1.0.0)
1: ! which is caused by "deleteme_main depends on deleteme_dep (1.0.0)"
1: ! thus: simpleitk is required
1: ! not simpleitk (<2.1.0) is satisfied by SimpleITK (==2.2.1)
1: ! which is caused by "deleteme_main depends on SimpleITK (2.2.1)"
1: ! thus: version solving failed
1: Version solving took 0.059 seconds.
1: Tried 1 solutions. Stack trace:
4 ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/puzzle/solver.py:157 in _solve
155│
156│ try:
→ 157│ result = resolve_version(self._package, self._provider)
158│
159│ packages = result.packages
3 ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/mixology/__init__.py:18 in resolve_version
16│ solver = VersionSolver(root, provider)
17│
→ 18│ return solver.solve()
19│
2 ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/mixology/version_solver.py:112 in solve
110│ while next is not None:
111│ self._propagate(next)
→ 112│ next = self._choose_package_version()
113│
114│ return self._result()
1 ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/mixology/version_solver.py:428 in _choose_package_version
426│ package = locked
427│
→ 428│ package = self._provider.complete_package(package)
429│
430│ conflict = False
OverrideNeeded
({Package('deleteme_main', '0.1.0-dev0'): {'simpleitk': <Dependency SimpleITK (<2.1.0)>}}, {Package('deleteme_main', '0.1.0-dev0'): {'simpleitk': <Dependency SimpleITK (==2.2.1)>}}, {Package('deleteme_main', '0.1.0-dev0'): {'simpleitk': <Dependency SimpleITK (<empty>)>}})
at ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/puzzle/provider.py:792 in complete_package
788│ current_overrides.update({dependency_package: package_overrides})
789│ overrides.append(current_overrides)
790│
791│ if overrides:
→ 792│ raise OverrideNeeded(*overrides)
793│
794│ # Modifying dependencies as needed
795│ clean_dependencies = []
796│ for dep in dependencies:
The following error occurred when trying to handle this error:
Stack trace:
4 ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/puzzle/solver.py:157 in _solve
155│
156│ try:
→ 157│ result = resolve_version(self._package, self._provider)
158│
159│ packages = result.packages
3 ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/mixology/__init__.py:18 in resolve_version
16│ solver = VersionSolver(root, provider)
17│
→ 18│ return solver.solve()
19│
2 ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/mixology/version_solver.py:111 in solve
109│ next: str | None = self._root.name
110│ while next is not None:
→ 111│ self._propagate(next)
112│ next = self._choose_package_version()
113│
1 ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/mixology/version_solver.py:150 in _propagate
148│ # where that incompatibility will allow us to derive new assignments
149│ # that avoid the conflict.
→ 150│ root_cause = self._resolve_conflict(incompatibility)
151│
152│ # Back jumping erases all the assignments we did at the previous
SolveFailure
Because deleteme_main depends on deleteme_dep (0.1.7) which depends on simpleitk (<2.1.0), simpleitk is required.
So, because deleteme_main depends on SimpleITK (2.2.1), version solving failed.
at ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/mixology/version_solver.py:349 in _resolve_conflict
345│ )
346│ self._log(f'! which is caused by "{most_recent_satisfier.cause}"')
347│ self._log(f"! thus: {incompatibility}")
348│
→ 349│ raise SolveFailure(incompatibility)
350│
351│ def _choose_package_version(self) -> str | None:
352│ """
353│ Tries to select a version of a required package.
The following error occurred when trying to handle this error:
Stack trace:
13 ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/cleo/application.py:327 in run
325│
326│ try:
→ 327│ exit_code = self._run(io)
328│ except BrokenPipeError:
329│ # If we are piped to another process, it may close early and send a
12 ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/console/application.py:190 in _run
188│ self._load_plugins(io)
189│
→ 190│ exit_code: int = super()._run(io)
191│ return exit_code
192│
11 ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/cleo/application.py:431 in _run
429│ io.input.interactive(interactive)
430│
→ 431│ exit_code = self._run_command(command, io)
432│ self._running_command = None
433│
10 ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/cleo/application.py:473 in _run_command
471│
472│ if error is not None:
→ 473│ raise error
474│
475│ return terminate_event.exit_code
9 ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/cleo/application.py:457 in _run_command
455│
456│ if command_event.command_should_run():
→ 457│ exit_code = command.run(io)
458│ else:
459│ exit_code = ConsoleCommandEvent.RETURN_CODE_DISABLED
8 ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/cleo/commands/base_command.py:119 in run
117│ io.input.validate()
118│
→ 119│ status_code = self.execute(io)
120│
121│ if status_code is None:
7 ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/cleo/commands/command.py:62 in execute
60│
61│ try:
→ 62│ return self.handle()
63│ except KeyboardInterrupt:
64│ return 1
6 ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/console/commands/lock.py:57 in handle
55│ self.installer.lock(update=not self.option("no-update"))
56│
→ 57│ return self.installer.run()
58│
5 ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/installation/installer.py:116 in run
114│ self._execute_operations = False
115│
→ 116│ return self._do_install()
117│
118│ def dry_run(self, dry_run: bool = True) -> Installer:
4 ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/installation/installer.py:263 in _do_install
261│ source_root=self._env.path.joinpath("src")
262│ ):
→ 263│ ops = solver.solve(use_latest=self._whitelist).calculate_operations()
264│ else:
265│ self._io.write_line("Installing dependencies from lock file")
3 ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/puzzle/solver.py:74 in solve
72│ with self._progress(), self._provider.use_latest_for(use_latest or []):
73│ start = time.time()
→ 74│ packages, depths = self._solve()
75│ end = time.time()
76│
2 ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/puzzle/solver.py:161 in _solve
159│ packages = result.packages
160│ except OverrideNeeded as e:
→ 161│ return self._solve_in_compatibility_mode(e.overrides)
162│ except SolveFailure as e:
163│ raise SolverProblemError(e)
1 ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/puzzle/solver.py:135 in _solve_in_compatibility_mode
133│ )
134│ self._provider.set_overrides(override)
→ 135│ _packages, _depths = self._solve()
136│ for index, package in enumerate(_packages):
137│ if package not in packages:
SolverProblemError
Because deleteme_main depends on deleteme_dep (0.1.7) which depends on simpleitk (<2.1.0), simpleitk is required.
So, because deleteme_main depends on SimpleITK (2.2.1), version solving failed.
at ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/puzzle/solver.py:163 in _solve
159│ packages = result.packages
160│ except OverrideNeeded as e:
161│ return self._solve_in_compatibility_mode(e.overrides)
162│ except SolveFailure as e:
→ 163│ raise SolverProblemError(e)
164│
165│ combined_nodes = depth_first_search(PackageNode(self._package, packages))
166│ results = dict(aggregate_package_nodes(nodes) for nodes in combined_nodes)
167│ (sorry about the lack of information in first post and maybe the TMI in the second) |
I don't believe this is your repro either: the log says I expect this is all a waste of time anyway, presumably this is a duplicate of #5506 and should be closed. |
Again, I am simplifying things here, I can't post the entire application, this is a proprietary software so I have manually changed the names. I have read multiple times this post too but I don't understand what I should do: #5506 (comment)
Absolutely. Tested as mentioned with poetry 1.4.2 and 1.5.1. I have tried to delete referenced components from my nexus, clearing all pip and poetry caches, ... |
you are "simplifying" things to the point where they no longer reproduce the problem you are reporting, making them useless. As best I can tell from what you have posted, this is a duplicate of #5506 and should be closed as such |
Dude, I am trying my best here. Whether you think my best is just crap I get it, thanks for your time, sorry for wasting it. |
it is hard for anyone to help you if you cannot or will not give a way to reproduce your problem. Once again: I believe this is a duplicate of #5506. There is no solution for that issue - thats why it is open. If you want to discuss #5506, please do so in that issue - you'll have a better chance of catching the attention of people who know about it, and will leave a better trail for future travellers. Please close |
Discussed in #5506 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
SimpleITK = [ { version = "<2.1.0", markers = "sys_platform == 'linux'" }, { version = "2.2.1", markers = "sys_platform == 'darwin'" } ]
-vvv
option) and have included the output below.Issue
I have the following error when poetry does the dependency resolution:
Why isn't Poetry seing the sys_platform == 'linux' marker ?
Thanks again 🙌
The text was updated successfully, but these errors were encountered: