{"record":{"id":"52b025c35c2c4993","repo":"jdx/mise","slug":"python-dependency-locks-require-uv-min-uv-version","errorCode":null,"errorMessage":"Python dependency locks require uv >= {MIN_UV_VERSION}","messagePattern":"Python dependency locks require uv >= (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/backend/pipx/lock.rs","lineNumber":85,"sourceCode":"        if !self.uv_lock_allowed(tv) {\n            bail!(\n                \"{} has a uv dependency graph; use uv with a PyPI package to replay it\",\n                self.ba.short\n            );\n        }\n        Ok(())\n    }\n\n    async fn lock_uv_program(&self, config: &Arc<Config>) -> Result<PathBuf> {\n        let uv = self.spawnable_dependency(config, None, \"uv\").await\n            .ok_or_else(|| eyre!(\"Python dependency locks require uv >= {MIN_UV_VERSION}; install it with `mise use uv`\"))?;\n        let output = CmdLineRunner::new(&uv).arg(\"--version\").read().await?;\n        let version = output\n            .split_whitespace()\n            .nth(1)\n            .ok_or_else(|| eyre!(\"cannot determine uv version\"))?;\n        if semver_is_older_than(version, MIN_UV_VERSION).unwrap_or(true) {\n            bail!(\"Python dependency locks require uv >= {MIN_UV_VERSION}\");\n        }\n        Ok(uv)\n    }\n\n    async fn configured_python_identity(&self, config: &Arc<Config>) -> Option<String> {\n        let ts = self.dependency_toolset(config).await.ok()?;\n        let (_, python) = ts\n            .list_current_versions()\n            .into_iter()\n            .find(|(_, tv)| tv.ba().short == \"python\")?;\n        Some(format!(\n            \"{}:{}:{}\",\n            python.ba().full(),\n            python.version,\n            python.install_path().display()\n        ))\n    }\n","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/backend/pipx/lock.rs#L67-L103","documentation":"mise's pipx backend replays Python dependency locks with uv, and the lockfile format it produces/consumes requires at least uv 0.12.10 (MIN_UV_VERSION). After locating a `uv` executable, lock_uv_program runs `uv --version` and parses the reported version; if it is older than the minimum (or the version string cannot be compared, in which case semver_is_older_than returns true via unwrap_or(true)), the lock operation is aborted. This prevents replaying locks with a uv that may produce incompatible graph output.","triggerScenarios":"Occurs inside lock_uv_program, called from resolve_uv_lock and install_uv_lock, when the resolved `uv` binary reports a version string older than 0.12.10, or when `uv --version` output cannot be semantically compared (e.g. a dev build, custom string, or unparsable version) because unwrap_or(true) treats unknown as too old.","commonSituations":"A developer has uv installed system-wide (homebrew, apt, pipx) but never upgraded it; a CI image pins an old uv; `mise use uv` installed uv into a different tool version than the one picked up on PATH; a distro ships uv 0.5/0.7 era builds that predate uv.lock graph features.","solutions":["Upgrade uv to >= 0.12.10 (e.g. `mise use -g uv@latest` or `uv self update`, or your platform installer).","Run `mise use uv` so mise-managed uv is on PATH for pipx-backed tools.","Check which uv is being picked up with `which uv; uv --version` and remove/shadow the stale binary.","If the version string is unusual (source build), install a release build of uv with a standard semver `--version` output."],"exampleFix":"// before: old system uv on PATH\n$ uv --version\nuv 0.5.11\n\n// after\n$ mise use -g uv@latest\n$ uv --version\nuv 0.12.10","handlingStrategy":"validation","validationCode":"const uvVer = run('uv --version').split(' ')[1];\nif (semverLt(uvVer, '0.12.10')) throw new Error(`uv ${uvVer} too old; need >= 0.12.10`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Manage uv itself with mise (`mise use -g uv@latest`) so it stays current","Check `uv --version` in CI before jobs that install pipx-backed tools","Avoid source-built uv binaries with nonstandard version strings"],"tags":["python","uv","version-check","dependency-lock"],"backgroundTag":"incompatible-source-type","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}