Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/mypy_primer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }} \
Expand Down
4 changes: 2 additions & 2 deletions stdlib/VERSIONS
Original file line number Diff line number Diff line change
@@ -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`).
#
Expand Down Expand Up @@ -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-
Expand Down
3 changes: 2 additions & 1 deletion tests/check_consistent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
26 changes: 13 additions & 13 deletions tests/mypy_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,19 @@ def match(fn, args, exclude_list):


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


Expand All @@ -96,7 +96,7 @@ def parse_versions(fname):

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))


Expand Down