Allow three-component third-party versions (#5995)

Closes: #5992
This commit is contained in:
Sebastian Rittau
2021-09-19 05:08:51 +02:00
committed by GitHub
parent d7bae50199
commit 0506182348
2 changed files with 5 additions and 5 deletions

View File

@@ -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

View File

@@ -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}"