Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle trailing build metadata in Python version string #628

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

andrewjcg
Copy link
Contributor

Don't fail Python versions when the version string contains trailing build metadata after the + (as per: https://semver.org/#spec-item-10).

Copy link
Owner

@benfred benfred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test case that exercises this functionality? Something like

py-spy/src/version.rs

Lines 132 to 143 in 75adc45

// v2.7.15+ is a valid version string apparently: https://github.com/benfred/py-spy/issues/81
let version = Version::scan_bytes(b"2.7.15+ (default, Oct 2 2018, 22:12:08)").unwrap();
assert_eq!(
version,
Version {
major: 2,
minor: 7,
patch: 15,
release_flags: "".to_owned()
}
);
}

@andrewjcg andrewjcg force-pushed the version_build_metadata branch from 6e79fed to cc7ed5c Compare November 6, 2023 19:49
@andrewjcg
Copy link
Contributor Author

Added test and also updated regex to match full build metadata format supported by https://semver.org/#spec-item-10.

Don't fail Python versions when the version string contains trailing
build metadata after the `+` (as per: https://semver.org/#spec-item-10).
@andrewjcg andrewjcg force-pushed the version_build_metadata branch from cc7ed5c to e9b6641 Compare November 6, 2023 20:57
@benfred benfred merged commit 5102f8e into benfred:master Nov 7, 2023
182 checks passed
@benfred benfred added the bug Something isn't working label Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants