From 432e0c3c0ed27460fca436a760b966827be22569 Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Fri, 10 Jan 2025 14:12:35 -0600 Subject: [PATCH] fix: support latest ansible packages (#4045) --- docs/dev-tools/backends/pipx.md | 9 +++++++++ docs/registry.md | 3 ++- registry.toml | 8 +++++--- src/backend/pipx.rs | 5 ++++- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/docs/dev-tools/backends/pipx.md b/docs/dev-tools/backends/pipx.md index ad047e2e53..3469b18ca7 100644 --- a/docs/dev-tools/backends/pipx.md +++ b/docs/dev-tools/backends/pipx.md @@ -102,6 +102,15 @@ Additional arguments to pass to `pipx` when installing the package. "pipx:black" = { version = "latest", pipx_args = "--preinstall" } ``` +### `uvx` + +Set to `false` to always disable uv for this tool. + +```toml +[tools] +"pipx:ansible" = { version = "latest", uvx = "false", pipx_args = "--include-deps" } +``` + ### `uvx_args` Additional arguments to pass to `uvx` when installing the package. diff --git a/docs/registry.md b/docs/registry.md index d7ea8efe4d..44a56bbea6 100644 --- a/docs/registry.md +++ b/docs/registry.md @@ -40,7 +40,8 @@ You can also specify the full name for a tool using `mise use aqua:1password/cli | alp | [aqua:tkuchiki/alp](https://github.com/tkuchiki/alp) [asdf:asdf-community/asdf-alp](https://github.com/asdf-community/asdf-alp) | | amass | [ubi:owasp-amass/amass](https://github.com/owasp-amass/amass) [asdf:dhoeric/asdf-amass](https://github.com/dhoeric/asdf-amass) | | amazon-ecr-credential-helper | [aqua:awslabs/amazon-ecr-credential-helper](https://github.com/awslabs/amazon-ecr-credential-helper) [asdf:dex4er/asdf-amazon-ecr-credential-helper](https://github.com/dex4er/asdf-amazon-ecr-credential-helper) | -| ansible-base | [asdf:mise-plugins/mise-pyapp](https://github.com/mise-plugins/mise-pyapp) | +| ansible | [pipx:ansible](https://pypi.org/project/ansible) | +| ansible-core | [pipx:ansible-core](https://pypi.org/project/ansible-core) | | ant | [asdf:mise-plugins/mise-ant](https://github.com/mise-plugins/mise-ant) | | apko | [aqua:chainguard-dev/apko](https://github.com/chainguard-dev/apko) [ubi:chainguard-dev/apko](https://github.com/chainguard-dev/apko) [asdf:omissis/asdf-apko](https://github.com/omissis/asdf-apko) | | apollo-ios | [asdf:mise-plugins/mise-apollo-ios-cli](https://github.com/mise-plugins/mise-apollo-ios-cli) | diff --git a/registry.toml b/registry.toml index b6c294e4db..262d9a10a6 100644 --- a/registry.toml +++ b/registry.toml @@ -65,9 +65,11 @@ amazon-ecr-credential-helper.backends = [ "aqua:awslabs/amazon-ecr-credential-helper", "asdf:dex4er/asdf-amazon-ecr-credential-helper" ] -# this isn't working with pipx yet since it is missing ansible -# ansible-base.backends = ["pipx:ansible-base[with=ansible]", "asdf:mise-plugins/mise-pyapp"] -ansible-base.backends = ["asdf:mise-plugins/mise-pyapp"] +ansible.backends = ["pipx:ansible[uvx=false,pipx_args=--include-deps]"] +ansible.test = ['ansible --version', 'ansible'] +ansible-core.aliases = ["ansible-base"] +ansible-core.backends = ["pipx:ansible-core"] +ansible-core.test = ['ansible --version', 'ansible [core {{version}}]'] ant.backends = ["asdf:mise-plugins/mise-ant"] apko.backends = [ "aqua:chainguard-dev/apko", diff --git a/src/backend/pipx.rs b/src/backend/pipx.rs index 629084f8af..d5f6006a58 100644 --- a/src/backend/pipx.rs +++ b/src/backend/pipx.rs @@ -87,7 +87,10 @@ impl Backend for PIPXBackend { .parse::()? .pipx_request(&tv.version, &tv.request.options()); - if self.uv_is_installed() && SETTINGS.pipx.uvx != Some(false) { + if self.uv_is_installed() + && SETTINGS.pipx.uvx != Some(false) + && tv.request.options().get("uvx") != Some(&"false".to_string()) + { ctx.pr .set_message(format!("uv tool install {pipx_request}")); let mut cmd = Self::uvx_cmd(