Installing ansible-lint using Poetry returns "will-not-work-on-windows-try-from-wsl-instead" on a Mac M1 #3002
-
SummaryI'm unable to install
I can install the package just fine using pip in a regular virtualenv, however we are migrating all our projects to be managed using Poetry instead. Issue Type
OS / ENVIRONMENTMacBook Pro 14" (2021), on MacOS Ventura 13.2 ansible-lint is attempted to be installed using Poetry. This issue was also duplicated on a Mac with a fresh OS install, with just Homebrew and the Python/Poetry dependencies. It was also tested with Python 3.9 and 3.10. STEPS TO REPRODUCE
~/Code/MTLA/ansible-mac-playbook ─────────────────────────────────────────────────────────────────────────────────────────── ▼ ─╮
❯ poetry init ─╯
This command will guide you through creating your pyproject.toml config.
Package name [ansible-mac-playbook]:
Version [0.1.0]:
Description []:
Author [Martin Guindon <14781590+MartinGuindon@users.noreply.github.com>, n to skip]:
License []:
Compatible Python versions [^3.11]: ~3.9
Would you like to define your main dependencies interactively? (yes/no) [yes] yes
You can specify a package in the following forms:
- A single name (requests): this will search for matches on PyPI
- A name and a constraint (requests@^2.23.0)
- A git url (git+https://github.com/python-poetry/poetry.git)
- A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)
- A file path (../my-package/my-package.whl)
- A directory (../my-package/)
- A url (https://example.com/packages/my-package-0.1.0.tar.gz)
Package to add or search for (leave blank to skip): ansible-lint
Found 20 packages matching ansible-lint
Showing the first 10 matches
Enter package # to add, or the complete package name if it is not listed []:
[ 0] ansible-lint
[ 1] ansible-lint-junit
[ 2] ansible-lint-nunit
[ 3] ansible-lint-to-junit-xml
[ 4] lint
[ 5] lint381
[ 6] ansible-later
[ 7] LintPlaybook
[ 8] salt-lint
[ 9] yaml-lint-to-junit-xml
[ 10]
> 0
Enter the version constraint to require (or leave blank to use the latest version):
Using version ^6.12.1 for ansible-lint
Add a package (leave blank to skip):
Would you like to define your development dependencies interactively? (yes/no) [yes] no
Generated file
[tool.poetry]
name = "ansible-mac-playbook"
version = "0.1.0"
description = ""
authors = ["Martin Guindon <14781590+MartinGuindon@users.noreply.github.com>"]
readme = "README.md"
packages = [{include = "ansible_mac_playbook"}]
[tool.poetry.dependencies]
python = "~3.9"
ansible-lint = "^6.12.1"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Do you confirm generation? (yes/no) [yes] yes
~/Code/MTLA/ansible-mac-playbook ─────────────────────────────────────────────────────────────────────────────────── 18s ▼ ─╮
❯ poetry install ─╯
The currently activated Python version 3.11.1 is not supported by the project (~3.9).
Trying to find and use a compatible version.
Using python3.9 (3.9.16)
Creating virtualenv ansible-mac-playbook in /Users/martin.guindon/Code/MTLA/ansible-mac-playbook/.venv
Updating dependencies
Resolving dependencies... (0.2s)
Because no versions of ansible-lint match >6.12.1,<7.0.0
and ansible-lint (6.12.1) depends on will-not-work-on-windows-try-from-wsl-instead (*), ansible-lint (>=6.12.1,<7.0.0) requires will-not-work-on-windows-try-from-wsl-instead (*).
So, because no versions of will-not-work-on-windows-try-from-wsl-instead match *
and ansible-mac-playbook depends on ansible-lint (^6.12.1), version solving failed. Desired BehaviorPackage should install successfully, as it does using |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Please read the docs (and existing bugs and discussions) before reporting bugs. |
Beta Was this translation helpful? Give feedback.
-
See the following. #2820 (comment) It does not work to just limit the platform to be non-windows. You need to explicitly add |
Beta Was this translation helpful? Give feedback.
See the following. #2820 (comment)
It does not work to just limit the platform to be non-windows. You need to explicitly add
markers = "platform_system != 'Windows'"
as well.