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 cannot install [email protected] #7112

Closed
3 of 4 tasks
davidmehren opened this issue Nov 28, 2022 · 5 comments
Closed
3 of 4 tasks

Poetry cannot install [email protected] #7112

davidmehren opened this issue Nov 28, 2022 · 5 comments
Labels
status/external-issue Issue is caused by external project (platform, dep, etc)

Comments

@davidmehren
Copy link

  • Poetry version: 1.2.2
  • Python version: 3.11
  • OS version and name: Fedora 37
  • pyproject.toml: n/a
  • 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

Poetry cannot install [email protected]. To reproduce, create a new project with poetry init and try to add the package:

poetry add [email protected]
Creating virtualenv repro-IHV6d_qa-py3.11 in /home/david/.cache/pypoetry/virtualenvs

Updating dependencies
Resolving dependencies... (0.7s)
Resolving dependencies... (0.8s)
Because ansible-lint (6.9.0) depends on will-not-work-on-windows-try-from-wsl-instead (*) which doesn't match any versions, ansible-lint is forbidden.
So, because repro depends on ansible-lint (6.9.0), version solving failed.

This has been reported (ansible/ansible-lint#2730) over at ansible-lint, but closed as a poetry issue, hence I'm reporting it here again.

I'm guessing that Poetry does not correctly understand the line will-not-work-on-windows-try-from-wsl-instead; platform_system=="Windows" in ansible-lints setup.cfg and tries to install the nonexisting dependency even when not running on Windows.

@davidmehren davidmehren added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Nov 28, 2022
@finswimmer
Copy link
Member

Hello @davidmehren,

what ansible-lint is doing here is unusual and is a problem for any tool that produces an universal lock file. I answered in the issue you've linked. Let's see what happens.

fin swimmer

@radoering
Copy link
Member

I'm guessing that Poetry does not correctly understand the line will-not-work-on-windows-try-from-wsl-instead; platform_system=="Windows" in ansible-lints setup.cfg and tries to install the nonexisting dependency even when not running on Windows.

Nope, poetry understands this and doesn't try to install the nonexisting dependency on other platforms than Windows. However, poetry is designed to resolve dependencies for all platforms (and generate a universal lock file). Since ansible-lint defines that will-not-work-on-windows-try-from-wsl-instead is required for Windows, poetry searches for this package. Since ansible-lint does not support Windows anyway you can tell poetry that ansible-lint is not required (i.e. should not be used) on Windows. You can add the following entry to your pyproject.toml:

ansible-lint = { version = "6.9.0", markers = 'platform_system != "Windows"' }

Then, you can lock on any platform (even on Windows) and install ansible-lint on any platform but Windows.

@finswimmer
Copy link
Member

Nice workaround @radoering 👍

@finswimmer finswimmer added status/external-issue Issue is caused by external project (platform, dep, etc) and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Nov 30, 2022
@dimbleby
Copy link
Contributor

poetry is behaving exactly correctly, and radoering has offered a workaround that should be completely satisfactory. This can be closed.

@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Nov 30, 2022
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
status/external-issue Issue is caused by external project (platform, dep, etc)
Projects
None yet
Development

No branches or pull requests

5 participants