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

poetry show fails to resolve private package with extras #3116

Closed
3 tasks done
Agalin opened this issue Oct 7, 2020 · 3 comments
Closed
3 tasks done

poetry show fails to resolve private package with extras #3116

Agalin opened this issue Oct 7, 2020 · 3 comments
Labels
kind/bug Something isn't working as expected

Comments

@Agalin
Copy link

Agalin commented Oct 7, 2020

  • I am on the latest Poetry version.
  • 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: Windows 10, RHEL 7.8
  • Poetry version: 1.1.0-1.1.2
  • Simple pyproject.toml with a private repo:
[[tool.poetry.source]]
name = "private-repo"
url = "<repo url>"

[tool.poetry.dependencies]
python = "^3.6,<3.9"
private-dependency = {extras = ["extras"], version = "^1.20.35723", source = "private-repo"}

Issue

When running poetry show with a private package that has extras installed command fails with SolverProblemError.

For this package there are multiple extras, some with just public packages, some with mix of public and private. It doesn't matter which one is required, command fails even if only public packages are required by extras marker but succeeds if there are no extras specified to install.

Specifying extras for public packages doesn't break the command. Generating lock file from scratch (poetry lock) doesn't change anything.

Install, add, lock are working correctly for this dependency. Only show fails.

Version 1.0.10 works correctly.

Output:


Using virtualenv: C:\Users\user\AppData\Local\pypoetry\Cache\virtualenvs\private-package-UtOW8WEE-py3.6

  Stack trace:

  6  c:\users\user\appdata\local\programs\python\python36\lib\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

  5  c:\users\user\appdata\local\programs\python\python36\lib\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():

  4  c:\users\user\appdata\local\programs\python\python36\lib\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

  3  c:\users\user\appdata\local\programs\python\python36\lib\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]

  2  c:\users\user\appdata\local\programs\python\python36\lib\site-packages\poetry\console\commands\show.py:82 in handle
       80│         solver.provider.load_deferred(False)
       81│         with solver.use_environment(self.env):
    →  82│             ops = solver.solve()
       83│
       84│         required_locked_packages = set([op.package for op in ops if not op.skipped])

  1  c:\users\user\appdata\local\programs\python\python36\lib\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│

  SolverProblemError

  Because private-package depends on private-dependency[extras] (^1.20.35723) which doesn't exist, version solving failed.

  at c:\users\user\appdata\local\programs\python\python36\lib\site-packages\poetry\puzzle\solver.py:241 in _solve
      237│             packages = result.packages
      238│         except OverrideNeeded as e:
      239│             return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
      240│         except SolveFailure as e:
    → 241│             raise SolverProblemError(e)
      242│
      243│         results = dict(
      244│             depth_first_search(
      245│                 PackageNode(self._package, packages), aggregate_package_nodes

@Agalin Agalin added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 7, 2020
abn added a commit to abn/poetry that referenced this issue Oct 7, 2020
@abn abn removed the status/triage This issue needs to be triaged label Oct 7, 2020
@abn
Copy link
Member

abn commented Oct 7, 2020

@Agalin can you try the fix in #3117 please?

@Agalin
Copy link
Author

Agalin commented Oct 7, 2020

This version works. 😄

abn added a commit to abn/poetry that referenced this issue Oct 14, 2020
Copy link

github-actions bot commented Mar 2, 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 2, 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

2 participants