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

Assertion error when installing Prefect with poetry #7904

Closed
realonbebeto opened this issue May 11, 2023 · 4 comments
Closed

Assertion error when installing Prefect with poetry #7904

realonbebeto opened this issue May 11, 2023 · 4 comments
Labels
kind/bug Something isn't working as expected status/duplicate Duplicate issues

Comments

@realonbebeto
Copy link

when I run: poetry add prefect trying to install prefect 2.10.8

poetry add prefect
Creating virtualenv prefect in /Users/realonbebeto/Kazispace/local/py/prefect/.venv
Using version ^2.10.8 for prefect

Updating dependencies
Resolving dependencies... (0.0s)

AssertionError

at /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/poetry/mixology/incompatibility.py:113 in str
109│ )
110│
111│ def str(self) -> str:
112│ if isinstance(self._cause, DependencyCause):
→ 113│ assert len(self._terms) == 2
114│
115│ depender = self._terms[0]
116│ dependee = self._terms[1]
117│ assert depender.is_positive()

@realonbebeto realonbebeto added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels May 11, 2023
@dimbleby
Copy link
Contributor

Works fine for me.

Please respect the issue template and provide the details that it asks for.

@realonbebeto
Copy link
Author

My apologies for not following throuh the template:

Poetry version: Poetry (version 1.4.2)

  • Python version: Python 3.10.11
  • OS version and name: macOS 13.3.1
  • pyproject.toml:
    [tool.poetry]
    name = "prefect"
    version = "0.1.0"
    description = ""
    authors = ["Bebeto Nyamwamu projobs254@gmail.com"]
    readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

I am on a new poetry project. I am trying to install Prefect as my first package but there is an assertion error.

Debug mode error:
poetry add prefect -vvv
Loading configuration file /Users/realonbebeto/Library/Preferences/pypoetry/config.toml
Using virtualenv: /Users/realonbebeto/Kazispace/local/py/prefect/.venv
[keyring.backend] Loading KWallet
[keyring.backend] Loading SecretService
[keyring.backend] Loading Windows
[keyring.backend] Loading chainer
[keyring.backend] Loading libsecret
[keyring.backend] Loading macOS
Creating new session for pypi.org
Source (PyPI): 175 packages found for prefect *
Using version ^2.10.8 for prefect

Updating dependencies
Resolving dependencies...
1: fact: prefect is 0.1.0
1: derived: prefect
1: fact: prefect depends on pandas (^2.0.1)
1: Version solving took 0.002 seconds.
1: Tried 1 solutions.

Stack trace:

16 /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/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

15 /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/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│

14 /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/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│

13 /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/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

12 /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/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

11 /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/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:

10 /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cleo/commands/command.py:62 in execute
60│
61│ try:
→ 62│ return self.handle()
63│ except KeyboardInterrupt:
64│ return 1

9 /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/poetry/console/commands/add.py:262 in handle
260│ self.installer.whitelist([r["name"] for r in requirements])
261│
→ 262│ status = self.installer.run()
263│
264│ if status == 0 and not self.option("dry-run"):

8 /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/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:

7 /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/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")

6 /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/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│

5 /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/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

4 /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/poetry/mixology/init.py:18 in resolve_version
16│ solver = VersionSolver(root, provider)
17│
→ 18│ return solver.solve()
19│

3 /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/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()

2 /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/poetry/mixology/version_solver.py:432 in _choose_package_version
430│ conflict = False
431│ for incompatibility in self._provider.incompatibilities_for(package):
→ 432│ self._add_incompatibility(incompatibility)
433│
434│ # If an incompatibility is already satisfied, then selecting version

1 /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/poetry/mixology/version_solver.py:468 in _add_incompatibility
466│
467│ def _add_incompatibility(self, incompatibility: Incompatibility) -> None:
→ 468│ self._log(f"fact: {incompatibility}")
469│
470│ for term in incompatibility.terms:

AssertionError

at /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/poetry/mixology/incompatibility.py:113 in str
109│ )
110│
111│ def str(self) -> str:
112│ if isinstance(self._cause, DependencyCause):
→ 113│ assert len(self._terms) == 2
114│
115│ depender = self._terms[0]
116│ dependee = self._terms[1]
117│ assert depender.is_positive()

@dimbleby
Copy link
Contributor

dimbleby commented May 11, 2023

This is a duplicate of #7768, #7501 etc etc etc, please close

@radoering radoering added status/duplicate Duplicate issues and removed status/triage This issue needs to be triaged labels May 12, 2023
@radoering radoering closed this as not planned Won't fix, can't repro, duplicate, stale May 12, 2023
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/duplicate Duplicate issues
Projects
None yet
Development

No branches or pull requests

3 participants