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

Installation of packages fails #6571

Closed
4 tasks done
Jas2Ma opened this issue Sep 20, 2022 · 3 comments
Closed
4 tasks done

Installation of packages fails #6571

Jas2Ma opened this issue Sep 20, 2022 · 3 comments
Labels
area/solver Related to the dependency resolver kind/question User questions (candidates for conversion to discussion) version/1.2.1

Comments

@Jas2Ma
Copy link

Jas2Ma commented Sep 20, 2022

  • 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

Rerunning my gitlab-ci pipeline it fails since 1.2.1, with 1.2.0 it worked.

Here is the debug -vvv output:

$ poetry -vvv install --no-root
Loading configuration file /root/.config/pypoetry/config.toml
Creating virtualenv curcora in /builds/ja.marx/curvature-and-correlation-analysis/.venv
Using virtualenv: /builds/ja.marx/curvature-and-correlation-analysis/.venv
Installing dependencies from lock file
  Stack trace:
  15  ~/.local/share/pypoetry/venv/lib/python3.8/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:
  14  ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/console/application.py:185 in _run
       183│         self._load_plugins(io)
       184│ 
     → 185│         exit_code: int = super()._run(io)
       186│         return exit_code
       187│ 
  13  ~/.local/share/pypoetry/venv/lib/python3.8/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│ 
  12  ~/.local/share/pypoetry/venv/lib/python3.8/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
  11  ~/.local/share/pypoetry/venv/lib/python3.8/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
  10  ~/.local/share/pypoetry/venv/lib/python3.8/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:
   9  ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/cleo/commands/command.py:83 in execute
        81│ 
        82│         try:
     →  83│             return self.handle()
        84│         except KeyboardInterrupt:
        85│             return 1
   8  ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/console/commands/install.py:145 in handle
       143│         self.installer.verbose(self.io.is_verbose())
       144│ 
     → 145│         return_code = self.installer.run()
       146│ 
       147│         if return_code != 0:
   7  ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/installer.py:114 in run
       112│             self._execute_operations = False
       113│ 
     → 114│         return self._do_install()
       115│ 
       116│     def dry_run(self, dry_run: bool = True) -> Installer:
   6  ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/installer.py:251 in _do_install
       249│             self._io.write_line("Installing dependencies from lock file")
       250│ 
     → 251│             locked_repository = self._locker.locked_repository()
       252│ 
       253│             if not self._locker.is_fresh():
   5  ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/packages/locker.py:199 in locked_repository
       197│ 
       198│                 package.add_dependency(
     → 199│                     Factory.create_dependency(dep_name, constraint, root_dir=root_dir)
       200│                 )
       201│ 
   4  ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/core/factory.py:366 in create_dependency
       364│             dependency.source_name = constraint.get("source")
       365│         else:
     → 366│             dependency = Dependency(name, constraint, groups=groups)
       367│ 
       368│         return dependency
   3  ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/core/packages/dependency.py:66 in __init__
        64│         self._constraint: VersionConstraint
        65│         self._pretty_constraint: str
     →  66│         self.constraint = constraint  # type: ignore[assignment]
        67│ 
        68│         self._optional = optional
   2  ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/core/packages/dependency.py:110 in constraint
       108│     def constraint(self, constraint: str | VersionConstraint) -> None:
       109│         if isinstance(constraint, str):
     → 110│             self._constraint = parse_constraint(constraint)
       111│         else:
       112│             self._constraint = constraint
   1  ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/core/semver/helpers.py:31 in parse_constraint
        29│         if len(and_constraints) > 1:
        30│             for constraint in and_constraints:
     →  31│                 constraint_objects.append(parse_single_constraint(constraint))
        32│         else:
        33│             constraint_objects.append(parse_single_constraint(and_constraints[0]))
  ParseConstraintError
@Jas2Ma Jas2Ma added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 20, 2022
@neersighted neersighted added area/solver Related to the dependency resolver kind/question User questions (candidates for conversion to discussion) and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 20, 2022
@neersighted
Copy link
Member

There's an invalid constraint somewhere in your dependency tree. poetry-core had a bug where this was accidentally cast to the any constraint (*) when read, which was fixed in the latest core release. The diagnostics here definitely should be better/contain context to help understand what is causing this error -- however I don't think this is a bug in Poetry.

Poetry recently had this exact issue in its own constraints: see #6402 for details.

You should try re-locking to make sure a newer dep doesn't solve the bad constraint issue -- however as I can install your pyproject.toml just fine (minus the redacted repos), I suspect the problem lies in a private dependency and you should check the syntax of every constraint in those private deps for errors/non-compliance. If you need guidance past that I would suggest reaching out on Discord where you can privately share details of these proprietary dependencies with Poetry team members.

@Jas2Ma
Copy link
Author

Jas2Ma commented Sep 20, 2022

re-locking fixed the issue.

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
area/solver Related to the dependency resolver kind/question User questions (candidates for conversion to discussion) version/1.2.1
Projects
None yet
Development

No branches or pull requests

2 participants