From 80cc5d4ad7d2a09ba8827f49abf342e0cc0f5293 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Thu, 2 Sep 2021 09:45:20 +0200 Subject: [PATCH] Allow three-component third-party versions Closes: #5992 --- CONTRIBUTING.md | 6 ++++-- tests/check_consistent.py | 4 +--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8a4de9add96f..c1025c3b7425 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -96,8 +96,10 @@ The metadata file describes the stubs package using the supported: * `version`: The latest version of the library that the stubs support. - Note that only two most significant version levels are supported - (i.e. only single dot). When the stubs are updated to a newer version + For libraries that reflect API changes in the version number only + the parts indicating the API level should be specified. In the case + of [Semantic Versioning](https://semver.org/) that is the first two + components. When the stubs are updated to a newer version of the library, the version of the stub should be bumped (note that previous versions are still available on PyPI). Some legacy stubs are marked with version `0.1`, indicating that their supported version is diff --git a/tests/check_consistent.py b/tests/check_consistent.py index 9186ea6f3309..7a5c9ba5430b 100755 --- a/tests/check_consistent.py +++ b/tests/check_consistent.py @@ -169,9 +169,7 @@ def check_metadata(): assert "version" in data, f"Missing version for {distribution}" version = data["version"] msg = f"Unsupported Python version {version}" - assert version.count(".") == 1, msg - major, minor = version.split(".") - assert major.isdigit() and minor.isdigit(), msg + assert re.match(r"^\d+\.\d+(\.\d+)?$", version), msg for key in data: assert key in metadata_keys, f"Unexpected key {key} for {distribution}" assert isinstance(data.get("python2", False), bool), f"Invalid python2 value for {distribution}"