Repository navigation
Allow third-party versions to end in asterisk - #6129
Conversation
This is a first step towards python#6095, where x.y and x.y.* are treated as equivalent. The next step is to update existing versions to use x.y.* where applicable and then treat x.y differently.
|
The text in |
| 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. Other stubs don't use the asterisk | ||
| to denote the API-independent part. |
There was a problem hiding this comment.
It would be good to explain how the API-independent part works when there is no asterisk, but it doesn't really matter if this text will soon get revisited anyway.
| version = data["version"] | ||
| msg = f"Unsupported Python version {version}" | ||
| assert re.match(r"^\d+\.\d+(\.\d+)?$", version), msg | ||
| assert re.match(r"^\d+(\.\d+)*(\.\*)?$", version), msg |
There was a problem hiding this comment.
Should 1 really be a valid version? How about 2.*?
There was a problem hiding this comment.
Until the transition is over, this is the safe thing to do, but we can remove it later. The dataclasses backport has version 0.1 upstream, which causes a lot of problems at the moment.
|
|
||
| dist_version = metadata.get("version") | ||
| if dist_version is None or dist_version == "0.1": | ||
| assert isinstance(dist_version, str) |
There was a problem hiding this comment.
I think the assert belongs to check_consistent.py, not here.
There was a problem hiding this comment.
We need it here for type checking purposes. But we should also check it in check_consistent.
Co-authored-by: Akuli <akuviljanen17@gmail.com>
This is a first step towards #6095, where x.y and x.y.* are treated as
equivalent. The next step is to update existing versions to use x.y.*
where applicable and then treat x.y differently.