Skip to content

Update remaining versions for third-party stubs #6094

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

Merged
merged 15 commits into from
Oct 12, 2021
Merged
20 changes: 11 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,18 @@ The metadata file describes the stubs package using the
[TOML file format](https://toml.io/en/). Currently, the following keys are
supported:

* `version`: The versions of the library that the stubs support.
For libraries that reflect API changes in the version number only
the parts indicating the API level should be specified, with an
asterisk representing the API-independent part. In the case
of [Semantic Versioning](https://semver.org/), this version could look
like this: `2.7.*`. When the stubs are updated to a newer version
* `version`: The versions of the library that the stubs support. Two
formats are supported:
- A concrete version. This is especially suited for libraries that
use [Calendar Versioning](https://calver.org/).
- A version range ending in `.*`. This is suited for libraries that
reflect API changes in the version number only, where the API-independent
part is represented by the asterisk. In the case
of [Semantic Versioning](https://semver.org/), this version could look
like this: `2.7.*`.
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
unknown and needs to be updated.
previous versions are still available on PyPI).
* `python2` (default: `false`): If set to `true`, the top-level stubs
support both Python 2 and Python 3.
* `requires` (optional): A list of other stub packages or packages with type
Expand Down
3 changes: 1 addition & 2 deletions stubs/DateTimeRange/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
version = "0.1"
python2 = true
version = "1.2.*"
requires = ["types-python-dateutil"]
2 changes: 1 addition & 1 deletion stubs/JACK-Client/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.1"
version = "0.5.*"
2 changes: 1 addition & 1 deletion stubs/aiofiles/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "0.1"
version = "0.7.*"
requires = []
2 changes: 1 addition & 1 deletion stubs/contextvars/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.1"
version = "2.4"
2 changes: 1 addition & 1 deletion stubs/dataclasses/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.1"
version = "0.6"
3 changes: 1 addition & 2 deletions stubs/decorator/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
version = "0.1"
python2 = true
version = "5.1.*"
2 changes: 1 addition & 1 deletion stubs/frozendict/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.1"
version = "2.0.*"
2 changes: 1 addition & 1 deletion stubs/pyRFC3339/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.1"
version = "1.1"
3 changes: 1 addition & 2 deletions stubs/pycurl/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
version = "0.1"
python2 = true
version = "7.44.*"
3 changes: 1 addition & 2 deletions stubs/tzlocal/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
version = "0.1"
python2 = true
version = "3.0"
requires = ["types-pytz"]
3 changes: 1 addition & 2 deletions stubs/ujson/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
version = "0.1"
python2 = true
version = "4.2.*"
2 changes: 1 addition & 1 deletion stubs/waitress/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "0.1"
version = "2.0.*"
requires = []
3 changes: 2 additions & 1 deletion tests/check_consistent.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ def check_metadata():
assert "version" in data, f"Missing version for {distribution}"
version = data["version"]
msg = f"Unsupported Python version {version}"
assert re.match(r"^\d+(\.\d+)*(\.\*)?$", version), msg
assert isinstance(version, str), msg
assert re.fullmatch(r"\d+(\.\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}"
Expand Down
5 changes: 1 addition & 4 deletions tests/stubtest_third_party.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ def run_stubtest(dist: Path) -> None:

dist_version = metadata["version"]
assert isinstance(dist_version, str)
if dist_version == "0.1":
dist_req = dist.name
else:
dist_req = f"{dist.name}=={dist_version}"
dist_req = f"{dist.name}=={dist_version}"

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