poetry icon indicating copy to clipboard operation
poetry copied to clipboard

Poetry install hitting [BUG] RuntimeError

Open TNonet opened this issue 3 years ago • 0 comments

  • [x] I am on the latest Poetry version.
  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x] If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name:
>>>cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
  • Poetry version: 1.1.14
  • Link of a Gist with the contents of your pyproject.toml file:

Issue

When installing a local poetry package that has conflicting requirements, poetry install raises uninformative error.

Using virtualenv: /home/circleci/project/[PACKAGE]/.venv
Installing dependencies from lock file

Finding the necessary packages for the current system

  Stack trace:

  13  ~/.local/share/pypoetry/venv/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

  12  ~/.local/share/pypoetry/venv/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():

  11  ~/.local/share/pypoetry/venv/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

  10  ~/.local/share/pypoetry/venv/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]

   9  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/console/commands/install.py:71 in handle
        69│         self._installer.verbose(self._io.is_verbose())
        70│
     →  71│         return_code = self._installer.run()
        72│
        73│         if return_code != 0:

   8  ~/.local/share/pypoetry/venv/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

   7  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/installer.py:305 in _do_install
       303│
       304│         with solver.use_environment(self._env):
     → 305│             ops = solver.solve(use_latest=self._whitelist)
       306│
       307│         # We need to filter operations so that packages

   6  ~/.local/share/pypoetry/venv/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│

   5  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/puzzle/solver.py:233 in _solve
       231│
       232│         try:
     → 233│             result = resolve_version(
       234│                 self._package, self._provider, locked=locked, use_latest=use_latest
       235│             )

   4  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/mixology/__init__.py:7 in resolve_version
       5│     solver = VersionSolver(root, provider, locked=locked, use_latest=use_latest)
       6│
     → 7│     return solver.solve()
       8│

   3  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/mixology/version_solver.py:83 in solve
        81│             next = self._root.name
        82│             while next is not None:
     →  83│                 self._propagate(next)
        84│                 next = self._choose_package_version()
        85│

   2  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/mixology/version_solver.py:123 in _propagate
       121│                     # where that incompatibility will allow us to derive new assignments
       122│                     # that avoid the conflict.
     → 123│                     root_cause = self._resolve_conflict(incompatibility)
       124│
       125│                     # Back jumping erases all the assignments we did at the previous

   1  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/mixology/version_solver.py:231 in _resolve_conflict
       229│
       230│             for term in incompatibility.terms:
     → 231│                 satisfier = self._solution.satisfier(term)
       232│
       233│                 if most_recent_satisfier is None:

  RuntimeError

  [BUG]  [LOCAL PACKAGE] (0.1.0) is not satisfied.

  at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/mixology/partial_solution.py:200 in satisfier
      196│             # As soon as we have enough assignments to satisfy term, return them.
      197│             if assigned_term.satisfies(term):
      198│                 return assignment
      199│
    → 200│         raise RuntimeError("[BUG] {} is not satisfied.".format(term))
      201│
      202│     def satisfies(self, term):  # type: (Term) -> bool
      203│         return self.relation(term) == SetRelation.SUBSET
      204│

Poetry info:

circleci@cbc11ce3080d:~/project/[PROJECT]$ poetry env info

Virtualenv
Python:         3.10.6
Implementation: CPython
Path:           /home/circleci/project/[PROJECT]/.venv
Valid:          True

System
Platform: linux
OS:       posix
Python:   /home/circleci/.pyenv/versions/3.10.6

[LOCAL PACKAGE] PyProject File

...
[tool.poetry.dependencies]
python = ">=3.8,<3.10"
...

TNonet avatar Aug 09 '22 13:08 TNonet