Add a comment about _typeshed to VERSIONS (#5447)

This commit is contained in:
Sebastian Rittau
2021-05-19 11:01:33 +02:00
committed by GitHub
parent 1ea3d0f003
commit 54a0bd80ee
4 changed files with 18 additions and 17 deletions

View File

@@ -44,7 +44,7 @@ jobs:
# fail action if exit code isn't zero or one
(
mypy_primer \
--new 551eea3697 --old 551eea3697 \
--new c605579af8 --old c605579af8 \
--custom-typeshed-repo typeshed_to_test \
--new-typeshed $GITHUB_SHA --old-typeshed upstream_master \
--num-shards 2 --shard-index ${{ matrix.shard-index }} \

View File

@@ -1,5 +1,5 @@
# The structure of this file is as follows:
# - Blank lines and lines starting with `#` are ignored.
# - Blank lines and comments starting with `#` are ignored.
# - Lines contain the name of a module, followed by a colon,
# a space, and a version range (for example: `symbol: 2.7-3.9`).
#
@@ -48,7 +48,7 @@ _thread: 2.7-
_threading_local: 3.6-
_tkinter: 2.7-
_tracemalloc: 3.6-
_typeshed: 2.7-
_typeshed: 2.7- # not present at runtime, only for type checking
_warnings: 2.7-
_weakref: 2.7-
_weakrefset: 2.7-

View File

@@ -107,7 +107,8 @@ def check_versions():
with open("stdlib/VERSIONS") as f:
data = f.read().splitlines()
for line in data:
if not line or line.lstrip().startswith("#"):
line = line.split("#")[0].strip()
if line == "":
continue
m = _VERSIONS_RE.match(line)
if not m:

View File

@@ -75,19 +75,19 @@ _VERSION_LINE_RE = re.compile(r"^([a-zA-Z_][a-zA-Z0-9_.]*): ([23]\.\d{1,2})-([23
def parse_versions(fname):
with open(fname) as f:
data = f.read().splitlines()
result = {}
for line in data:
# Allow having some comments or empty lines.
if not line.strip() or line.startswith("#"):
continue
m = _VERSION_LINE_RE.match(line)
assert m, "invalid VERSIONS line :" + line
mod = m.group(1)
min_version = parse_version(m.group(2))
max_version = parse_version(m.group(3)) if m.group(3) else (99, 99)
result[mod] = min_version, max_version
with open(fname) as f:
for line in f:
# Allow having some comments or empty lines.
line = line.split("#")[0].strip()
if line == "":
continue
m = _VERSION_LINE_RE.match(line)
assert m, "invalid VERSIONS line: " + line
mod = m.group(1)
min_version = parse_version(m.group(2))
max_version = parse_version(m.group(3)) if m.group(3) else (99, 99)
result[mod] = min_version, max_version
return result
@@ -96,7 +96,7 @@ _VERSION_RE = re.compile(r"^([23])\.(\d+)$")
def parse_version(v_str):
m = _VERSION_RE.match(v_str)
assert m, "invalid version :" + v_str
assert m, "invalid version: " + v_str
return int(m.group(1)), int(m.group(2))