diff --git a/crates/uv-python/src/discovery.rs b/crates/uv-python/src/discovery.rs index cda59cf93..ad8d59e69 100644 --- a/crates/uv-python/src/discovery.rs +++ b/crates/uv-python/src/discovery.rs @@ -2316,6 +2316,20 @@ mod tests { ), "Pre-release version requests require a patch version of zero" ); + assert!( + matches!( + VersionRequest::from_str("3.12-dev"), + Err(Error::InvalidVersionRequest(_)) + ), + "Development version segments are not allowed" + ); + assert!( + matches!( + VersionRequest::from_str("3.12.post0"), + Err(Error::InvalidVersionRequest(_)) + ), + "Post version segments are not allowed" + ); assert!( // Test for overflow matches!(