Skip to content

Commit

Permalink
Handle trailing build metadata in Python version string
Browse files Browse the repository at this point in the history
Don't fail Python versions when the version string contains trailing
build metadata after the `+` (as per: https://semver.org/#spec-item-10).
  • Loading branch information
andrewjcg committed Oct 31, 2023
1 parent 75adc45 commit 6e79fed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ impl Version {
pub fn scan_bytes(data: &[u8]) -> Result<Version, Error> {
lazy_static! {
static ref RE: Regex = Regex::new(
r"((2|3)\.(3|4|5|6|7|8|9|10|11)\.(\d{1,2}))((a|b|c|rc)\d{1,2})?\+? (.{1,64})"
r"((2|3)\.(3|4|5|6|7|8|9|10|11)\.(\d{1,2}))((a|b|c|rc)\d{1,2})?(\+[0-1a-z]*)? (.{1,64})"
)
.unwrap();
}
Expand Down

0 comments on commit 6e79fed

Please sign in to comment.