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

AssertionError while running poetry lock #5919

Closed
3 tasks done
mboutet opened this issue Jun 27, 2022 · 4 comments
Closed
3 tasks done

AssertionError while running poetry lock #5919

mboutet opened this issue Jun 27, 2022 · 4 comments
Labels
kind/bug Something isn't working as expected

Comments

@mboutet
Copy link

mboutet commented Jun 27, 2022

  • I am on the latest Poetry version. Actually, I installed 63c86bf using curl -sSL https://install.python-poetry.org | python3 - --git https://github.com/python-poetry/poetry.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: macOS Monterey (12.4 (21F79))

  • Poetry version: 63c86bf

  • Link of a Gist with the contents of your pyproject.toml file:

Issue

When I run the pyproject.toml that does not work, I get the following exception:

Traceback
  Stack trace:

  17  ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/cleo/application.py:329 in run
       327│ 
       328│             try:
     → 329│                 exit_code = self._run(io)
       330│             except Exception as e:
       331│                 if not self._catch_exceptions:

  16  ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/poetry/console/application.py:188 in _run
       186│         self._load_plugins(io)
       187│ 
     → 188│         exit_code: int = super()._run(io)
       189│         return exit_code
       190│ 

  15  ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/cleo/application.py:423 in _run
       421│             io.input.set_stream(stream)
       422│ 
     → 423│         exit_code = self._run_command(command, io)
       424│         self._running_command = None
       425│ 

  14  ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/cleo/application.py:465 in _run_command
       463│ 
       464│         if error is not None:
     → 465│             raise error
       466│ 
       467│         return event.exit_code

  13  ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/cleo/application.py:449 in _run_command
       447│ 
       448│             if event.command_should_run():
     → 449│                 exit_code = command.run(io)
       450│             else:
       451│                 exit_code = ConsoleCommandEvent.RETURN_CODE_DISABLED

  12  ~/Library/Application Support/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:

  11  ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/cleo/commands/command.py:83 in execute
        81│ 
        82│         try:
     →  83│             return self.handle()
        84│         except KeyboardInterrupt:
        85│             return 1

  10  ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/poetry/console/commands/lock.py:55 in handle
        53│         self._installer.lock(update=not self.option("no-update"))
        54│ 
     →  55│         return self._installer.run()
        56│ 

   9  ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/poetry/installation/installer.py:111 in run
       109│             self._execute_operations = False
       110│ 
     → 111│         return self._do_install()
       112│ 
       113│     def dry_run(self, dry_run: bool = True) -> Installer:

   8  ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/poetry/installation/installer.py:244 in _do_install
       242│                 source_root=self._env.path.joinpath("src")
       243│             ):
     → 244│                 ops = solver.solve(use_latest=self._whitelist).calculate_operations()
       245│         else:
       246│             self._io.write_line("Installing dependencies from lock file")

   7  ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/poetry/puzzle/solver.py:74 in solve
        72│         with self._provider.progress():
        73│             start = time.time()
     →  74│             packages, depths = self._solve(use_latest=use_latest)
        75│             end = time.time()
        76│ 

   6  ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/poetry/puzzle/solver.py:143 in _solve
       141│ 
       142│         try:
     → 143│             result = resolve_version(
       144│                 self._package, self._provider, locked=locked, use_latest=use_latest
       145│             )

   5  ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/poetry/mixology/__init__.py:24 in resolve_version
        22│     solver = VersionSolver(root, provider, locked=locked, use_latest=use_latest)
        23│ 
     →  24│     return solver.solve()
        25│ 

   4  ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/poetry/mixology/version_solver.py:125 in solve
       123│             while next is not None:
       124│                 self._propagate(next)
     → 125│                 next = self._choose_package_version()
       126│ 
       127│             return self._result()

   3  ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/poetry/mixology/version_solver.py:466 in _choose_package_version
       464│ 
       465│         if not conflict:
     → 466│             self._solution.decide(package.package)
       467│             self._log(
       468│                 f"selecting {package.complete_name} ({package.full_pretty_version})"

   2  ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/poetry/mixology/partial_solution.py:90 in decide
        88│         self._decisions[package.complete_name] = package
        89│ 
     →  90│         self._assign(
        91│             Assignment.decision(package, self.decision_level, len(self._assignments))
        92│         )

   1  ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/poetry/mixology/partial_solution.py:115 in _assign
       113│         """
       114│         self._assignments.append(assignment)
     → 115│         self._register(assignment)
       116│ 
       117│     def backtrack(self, decision_level: int) -> None:

  AssertionError

  

  at ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/poetry/mixology/partial_solution.py:151 in _register
      147│         name = assignment.dependency.complete_name
      148│         old_positive = self._positive.get(name)
      149│         if old_positive is not None:
      150│             value = old_positive.intersect(assignment)
    → 151│             assert value is not None
      152│             self._positive[name] = value
      153│ 
      154│             return
      155│ 

Complete output of poetry lock -vvv: https://gist.github.com/mboutet/11fee93f0898f362c6c2015649a6dcf9

@mboutet mboutet added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jun 27, 2022
@dimbleby
Copy link
Contributor

duplicate #5791, already fixed

@Secrus Secrus closed this as completed Jun 27, 2022
@mboutet
Copy link
Author

mboutet commented Jun 27, 2022

@dimbleby, as mentioned in the description, I installed poetry 63c86bf (master branch of yesterday) using:

curl -sSL https://install.python-poetry.org | python3 - --git https://github.com/python-poetry/poetry

Unless it did not actually install the version from master, then #5791 is not, in fact, fixed.

@dimbleby
Copy link
Contributor

The fix was not in this project but in its sister, poetry-core - and it is, in fact, fixed.

@mkniewallner mkniewallner removed the status/triage This issue needs to be triaged label Jun 29, 2022
Copy link

github-actions bot commented Mar 1, 2024

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 Mar 1, 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
Projects
None yet
Development

No branches or pull requests

4 participants