Thanks to visit codestin.com
Credit goes to github.com

Skip to content
1 change: 0 additions & 1 deletion docs/dev-tools/backends/pipx.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ If you have `uv` installed, mise will use `uv tool install` under the hood and y
mise forwards [`minimum_release_age`](/configuration/settings.html#minimum_release_age)
to transitive Python dependency resolution during install. The uv install path uses uv's
`--exclude-newer` flag, and the `pipx` fallback passes pip's `--uploaded-prior-to` flag.
When using `minimum_release_age` with the `pipx` install path, `pip >= 26.0` is required for pip's `--uploaded-prior-to` support, and you are responsible for ensuring that compatible Python/pip environment is installed.

In case you need `pipx` for other reasons, you can install it with or without mise.
Here is how to install `pipx` with mise:
Expand Down
19 changes: 19 additions & 0 deletions e2e/backend/test_pipx_minimum_release_age
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
require_cmd python3
Comment thread
coderabbitai[bot] marked this conversation as resolved.

export MISE_PYTHON_COMPILE=0
export MISE_PYTHON_GITHUB_ATTESTATIONS=0
export MISE_PIPX_UVX=0

cat >.mise.toml <<EOF
[settings]
minimum_release_age = "7d"

[tools]
python = "3.12"
pipx = "1.12.0"
"pipx:cowsay" = "latest"
EOF

mise install
assert_succeed "mise x -- cowsay --version"
26 changes: 26 additions & 0 deletions src/backend/pipx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,32 @@ impl Backend for PIPXBackend {
}
cmd.execute()?;
} else {
// pipx forwards install `--pip-args` into shared-library bootstrap
// (`pip install --upgrade pip>=23.1`), not just the package install. When mise
// passes `--uploaded-prior-to`, bootstrap pip from ensurepip may not understand
// that flag (see pypa/pipx#544). Run upgrade-shared without release-age flags
// first so shared pip is valid; the subsequent install's shared_libs.create()
// then no-ops and `--uploaded-prior-to` applies only to the package install.
if ctx.before_date.is_some() {
ctx.pr.set_message("pipx upgrade-shared".to_string());
if let Err(err) = async {
Self::pipx_cmd(
&ctx.config,
&["upgrade-shared"],
self,
&tv,
&ctx.ts,
ctx.pr.as_ref(),
)
.await?
.execute()
}
.await
{
debug!("failed to upgrade pipx shared libraries before install: {err:#}");
}
}

ctx.pr.set_message(format!("pipx install {pipx_request}"));
let mut cmd = Self::pipx_cmd(
&ctx.config,
Expand Down
Loading