mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-25 20:36:44 +08:00
Allow third-party versions to end in asterisk (#6129)
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. Co-authored-by: Akuli <akuviljanen17@gmail.com>
This commit is contained in:
@@ -169,7 +169,7 @@ 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+(\.\d+)?$", version), msg
|
||||
assert re.match(r"^\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}"
|
||||
|
||||
@@ -47,9 +47,12 @@ def run_stubtest(dist: Path) -> None:
|
||||
pip_exe = str(venv_dir / "bin" / "pip")
|
||||
python_exe = str(venv_dir / "bin" / "python")
|
||||
|
||||
dist_version = metadata.get("version")
|
||||
if dist_version is None or dist_version == "0.1":
|
||||
dist_version = metadata["version"]
|
||||
assert isinstance(dist_version, str)
|
||||
if dist_version == "0.1":
|
||||
dist_req = dist.name
|
||||
elif dist_version.endswith(".*"):
|
||||
dist_req = f"{dist.name}=={dist_version}"
|
||||
else:
|
||||
dist_req = f"{dist.name}=={dist_version}.*"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user