Skip to content

Commit 5683f00

Browse files
authored
fix mypy mypyc build on py312, better errors (#193)
1 parent 3cc3235 commit 5683f00

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

mypy_primer/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def select_projects(ARGS: _Args) -> list[Project]:
179179
# hidden entrypoint logic
180180
# ==============================
181181

182-
RECENT_VERSIONS = {"mypy": ["1.15.0"], "pyright": ["1.1.399"]}
182+
RECENT_VERSIONS = {"mypy": ["1.17.1"], "pyright": ["1.1.399"]}
183183

184184

185185
async def validate_expected_success(ARGS: _Args) -> None:

mypy_primer/type_checker.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,22 @@ async def pip_install(*targets: str) -> None:
5353
"mypy_extensions",
5454
"tomli",
5555
"pathspec",
56+
"setuptools",
5657
"types-psutil",
5758
"types-setuptools",
5859
)
59-
await run(
60-
[str(venv.python), "-m", "pip", "install", ".", "--no-build-isolation"],
61-
cwd=repo_dir,
62-
env=env,
63-
)
60+
try:
61+
await run(
62+
[str(venv.python), "-m", "pip", "install", ".", "--no-build-isolation"],
63+
cwd=repo_dir,
64+
env=env,
65+
output=True,
66+
)
67+
except subprocess.CalledProcessError as e:
68+
print("Error while building mypy", file=sys.stderr)
69+
print(e.stdout, file=sys.stderr)
70+
print(e.stderr, file=sys.stderr)
71+
raise e
6472
else:
6573
targets = []
6674
if editable:

0 commit comments

Comments
 (0)