{"record":{"id":"4b5b0da3da5f5974","repo":"astral-sh/uv","slug":"failed-to-parse-version-specifier-target-version","errorCode":null,"errorMessage":"Failed to parse version specifier `{target_version}`: explicit versions must include an exact major.minor.patch release","messagePattern":"Failed to parse version specifier `(.+?)`: explicit versions must include an exact major\\.minor\\.patch release","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/uv/src/commands/self_update.rs","lineNumber":316,"sourceCode":"/// Parse an explicit `uv self update` target version for the official public case.\n///\n/// To preserve existing tag-based behavior, only exact `major.minor.patch` release versions are\n/// accepted. Inputs that normalize to a different version string, such as `0.10` or `v0.10.0`,\n/// are rejected instead of being silently rewritten.\nfn official_target_version_specifiers(\n    target_version: Option<&str>,\n) -> Result<Option<VersionSpecifiers>> {\n    let Some(target_version) = target_version else {\n        return Ok(None);\n    };\n\n    let pep440_version = Pep440Version::from_str(target_version)\n        .with_context(|| format!(\"Failed to parse version specifier `{target_version}`\"))?;\n    if pep440_version.to_string() != target_version || pep440_version.release().len() < 3 {\n        warn!(\n            \"Rejecting explicit self-update version specifier `{target_version}` after parsing it as `{pep440_version}`\"\n        );\n        anyhow::bail!(\n            \"Failed to parse version specifier `{target_version}`: explicit versions must include an exact major.minor.patch release\"\n        );\n    }\n\n    Ok(Some(VersionSpecifiers::from(\n        VersionSpecifier::equals_version(pep440_version),\n    )))\n}\n\nfn is_update_needed(\n    current_version: &Pep440Version,\n    target_version: &Pep440Version,\n    has_target_version: bool,\n) -> bool {\n    if has_target_version {\n        current_version != target_version\n    } else {\n        current_version < target_version","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/astral-sh/uv/blob/f1a42680ff5272232d65748acf338b19778dde24/crates/uv/src/commands/self_update.rs#L298-L334","documentation":"Error \"Failed to parse version specifier `{target_version}`: explicit versions must include an exact major.minor.patch release\" thrown in astral-sh/uv.","triggerScenarios":"Thrown at crates/uv/src/commands/self_update.rs:316 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f1a42680ff5272232d65748acf338b19778dde24","analyzedAt":"2026-08-16T04:51:47.599Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}