mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
@@ -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
|
||||
|
||||
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user