Skip to content

Commit bb24e77

Browse files
srittauAkuli
andauthored
Update remaining versions for third-party stubs (#6094)
Also remove the python2 markers of packages that don't list Python 2 as supported in the latest version. Don't special case version '0.1' Co-authored-by: Akuli <[email protected]>
1 parent 9f86972 commit bb24e77

File tree

15 files changed

+26
-31
lines changed

15 files changed

+26
-31
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,18 @@ The metadata file describes the stubs package using the
9595
[TOML file format](https://toml.io/en/). Currently, the following keys are
9696
supported:
9797

98-
* `version`: The versions of the library that the stubs support.
99-
For libraries that reflect API changes in the version number only
100-
the parts indicating the API level should be specified, with an
101-
asterisk representing the API-independent part. In the case
102-
of [Semantic Versioning](https://semver.org/), this version could look
103-
like this: `2.7.*`. When the stubs are updated to a newer version
98+
* `version`: The versions of the library that the stubs support. Two
99+
formats are supported:
100+
- A concrete version. This is especially suited for libraries that
101+
use [Calendar Versioning](https://calver.org/).
102+
- A version range ending in `.*`. This is suited for libraries that
103+
reflect API changes in the version number only, where the API-independent
104+
part is represented by the asterisk. In the case
105+
of [Semantic Versioning](https://semver.org/), this version could look
106+
like this: `2.7.*`.
107+
When the stubs are updated to a newer version
104108
of the library, the version of the stub should be bumped (note that
105-
previous versions are still available on PyPI). Some legacy stubs are
106-
marked with version `0.1`, indicating that their supported version is
107-
unknown and needs to be updated.
109+
previous versions are still available on PyPI).
108110
* `python2` (default: `false`): If set to `true`, the top-level stubs
109111
support both Python 2 and Python 3.
110112
* `requires` (optional): A list of other stub packages or packages with type

stubs/DateTimeRange/METADATA.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
version = "0.1"
2-
python2 = true
1+
version = "1.2.*"
32
requires = ["types-python-dateutil"]

stubs/JACK-Client/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = "0.1"
1+
version = "0.5.*"

stubs/aiofiles/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = "0.1"
1+
version = "0.7.*"
22
requires = []

stubs/contextvars/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = "0.1"
1+
version = "2.4"

stubs/dataclasses/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = "0.1"
1+
version = "0.6"

stubs/decorator/METADATA.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
version = "0.1"
2-
python2 = true
1+
version = "5.1.*"

stubs/frozendict/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = "0.1"
1+
version = "2.0.*"

stubs/pyRFC3339/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = "0.1"
1+
version = "1.1"

stubs/pycurl/METADATA.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
version = "0.1"
2-
python2 = true
1+
version = "7.44.*"

stubs/tzlocal/METADATA.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
version = "0.1"
2-
python2 = true
1+
version = "3.0"
32
requires = ["types-pytz"]

stubs/ujson/METADATA.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
version = "0.1"
2-
python2 = true
1+
version = "4.2.*"

stubs/waitress/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = "0.1"
1+
version = "2.0.*"
22
requires = []

tests/check_consistent.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ def check_metadata():
169169
assert "version" in data, f"Missing version for {distribution}"
170170
version = data["version"]
171171
msg = f"Unsupported Python version {version}"
172-
assert re.match(r"^\d+(\.\d+)*(\.\*)?$", version), msg
172+
assert isinstance(version, str), msg
173+
assert re.fullmatch(r"\d+(\.\d+)+|\d+(\.\d+)*\.\*", version), msg
173174
for key in data:
174175
assert key in metadata_keys, f"Unexpected key {key} for {distribution}"
175176
assert isinstance(data.get("python2", False), bool), f"Invalid python2 value for {distribution}"

tests/stubtest_third_party.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ def run_stubtest(dist: Path) -> None:
4949

5050
dist_version = metadata["version"]
5151
assert isinstance(dist_version, str)
52-
if dist_version == "0.1":
53-
dist_req = dist.name
54-
else:
55-
dist_req = f"{dist.name}=={dist_version}"
52+
dist_req = f"{dist.name}=={dist_version}"
5653

5754
# If @tests/requirements-stubtest.txt exists, run "pip install" on it.
5855
req_path = dist / "@tests" / "requirements-stubtest.txt"

0 commit comments

Comments
 (0)