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

Can't install a recent version of ansible-lint with uv #4348

Open
bolinocroustibat opened this issue Sep 25, 2024 · 1 comment
Open

Can't install a recent version of ansible-lint with uv #4348

bolinocroustibat opened this issue Sep 25, 2024 · 1 comment
Labels
bug new Triage required

Comments

@bolinocroustibat
Copy link

bolinocroustibat commented Sep 25, 2024

Environment: MacOS 15.0
Ansible version: 10.4.0
uv version: 0.4.15

When trying to installed ansible-lint n a uv-managed virtual environment, with uv add ansible-lint, uv will only installed the version 6.8.7 which seems to be the last version with a dependency tree that uv can resolve.
So I tried to force a more recent version by specifying the version in pyproject.toml (for example >=24.9.2), but in that case I get the following dependency tree solving error:

  × No solution found when resolving dependencies for split (python_full_version == '3.11.*'):
  ╰─▶ Because will-not-work-on-windows-try-from-wsl-instead{platform_system == 'Windows'}==0.1.0 was yanked (reason: This package should not have
      anything published) and only will-not-work-on-windows-try-from-wsl-instead{platform_system == 'Windows'}==0.1.0 is available, we can conclude that
      all versions of will-not-work-on-windows-try-from-wsl-instead{platform_system == 'Windows'} are incompatible.
      And because ansible-lint==24.9.2 depends on will-not-work-on-windows-try-from-wsl-instead{platform_system == 'Windows'} and only
      ansible-lint<=24.9.2 is available, we can conclude that ansible-lint>=24.9.2 cannot be used.
      And because dotfiles:dev depends on ansible-lint>=24.9.2 and your project depends on dotfiles:dev, we can conclude that your project's requirements
      are unsatisfiable.

I also tried the following in the pyproject.toml:

dependencies = [
    "ansible>=10.4.0",
    "ansible-lint>=24.9.2 ; sys_platform != 'Windows'",
]

...but this platform flag seems to have no effect and I get the same error.

  × No solution found when resolving dependencies for split (python_full_version == '3.11.*'):
  ╰─▶ Because will-not-work-on-windows-try-from-wsl-instead{platform_system == 'Windows'}==0.1.0 was yanked (reason: This package should not have
      anything published) and only will-not-work-on-windows-try-from-wsl-instead{platform_system == 'Windows'}==0.1.0 is available, we can conclude that
      all versions of will-not-work-on-windows-try-from-wsl-instead{platform_system == 'Windows'} are incompatible.
      And because ansible-lint{sys_platform != 'win32'}==24.9.2 depends on will-not-work-on-windows-try-from-wsl-instead{platform_system == 'Windows'}
      and only ansible-lint{sys_platform != 'win32'}<=24.9.2 is available, we can conclude that ansible-lint{sys_platform != 'win32'}>=24.9.2 is
      incompatible.
      And because dotfiles:dev depends on ansible-lint{sys_platform != 'win32'}>=24.9.2 and your project depends on dotfiles:dev, we can conclude that
      your project's requirements are unsatisfiable.
@bolinocroustibat bolinocroustibat added bug new Triage required labels Sep 25, 2024
@bolinocroustibat
Copy link
Author

bolinocroustibat commented Sep 30, 2024

Update:

... in the meantime, I found a way to bypass this issue, by adding the following to the pyproject.toml:

[tool.uv]
environments = ["platform_system != 'Windows'"]

...but it's a solution using the uv proprietary section.
It would be great if the limitation with Windows was implemented for standard pyproject.toml files, as "ansible-lint>=24.9.2 ; sys_platform != 'Windows' is the PEP standard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug new Triage required
Projects
Status: No status
Development

No branches or pull requests

1 participant