Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fail in setup.py instead
  • Loading branch information
ilevkivskyi committed Dec 9, 2025
commit 3bf9c9ded4778abb5a7d548898b8dca6087fd40d
13 changes: 1 addition & 12 deletions mypy/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,7 @@
TypedDict,
)

try:
from librt.internal import cache_version
except ImportError:
if platform.python_implementation() == "PyPy":
print(
"Running mypy on PyPy is not supported yet."
"To type-check a PyPy library please run mypy on an equivalent CPython version,"
"see https://github.com/mypyc/librt/issues/16 for possible workarounds."
)
sys.exit(2)
else:
raise
from librt.internal import cache_version

import mypy.semanal_main
from mypy.cache import CACHE_VERSION, CacheMeta, ReadBuffer, WriteBuffer, write_json
Expand Down
9 changes: 9 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,22 @@
import glob
import os
import os.path
import platform
import sys
from typing import TYPE_CHECKING, Any

if sys.version_info < (3, 10, 0): # noqa: UP036, RUF100
sys.stderr.write("ERROR: You need Python 3.10 or later to use mypy.\n")
exit(1)

if platform.python_implementation() == "PyPy":
print(
"ERROR: Running mypy on PyPy is not supported yet."
"To type-check a PyPy library please use an equivalent CPython version,"
"see https://github.com/mypyc/librt/issues/16 for possible workarounds."
)
sys.exit(1)

# we'll import stuff from the source tree, let's ensure is on the sys path
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))

Expand Down