diff --git a/crates/pypi-types/src/lenient_requirement.rs b/crates/pypi-types/src/lenient_requirement.rs index ad019ed90..088a9b18b 100644 --- a/crates/pypi-types/src/lenient_requirement.rs +++ b/crates/pypi-types/src/lenient_requirement.rs @@ -18,7 +18,7 @@ static INVALID_TRAILING_DOT_STAR: Lazy = /// Ex) `!=3.0*` static MISSING_DOT: Lazy = Lazy::new(|| Regex::new(r"(\d\.\d)+\*").unwrap()); /// Ex) `>=3.6,` -static TRAILING_COMMA: Lazy = Lazy::new(|| Regex::new(r"(\d\.(\d|\*))+,$").unwrap()); +static TRAILING_COMMA: Lazy = Lazy::new(|| Regex::new(r",$").unwrap()); /// Ex) `>= '2.7'`, `>=3.6'` static STRAY_QUOTES: Lazy = Lazy::new(|| Regex::new(r#"['"]"#).unwrap()); @@ -299,4 +299,14 @@ mod tests { let expected: VersionSpecifiers = VersionSpecifiers::from_str(">=3.6").unwrap(); assert_eq!(actual, expected); } + + /// + #[test] + fn trailing_comma_after_quote() { + let actual: Requirement = LenientRequirement::from_str("botocore>=1.3.0,<1.4.0',") + .unwrap() + .into(); + let expected: Requirement = Requirement::from_str("botocore>=1.3.0,<1.4.0").unwrap(); + assert_eq!(actual, expected); + } }