Skip to content
Open
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
3 changes: 2 additions & 1 deletion src/proxy/build_pythoncore.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

_EXCLUDE_MODULES = ["ensurepip", "idlelib", "test", "tkinter", "turtle_demo", "venv"]

libdir = Path(sys.executable).parent.joinpath("Lib")
libdir = Path(sys.base_prefix).joinpath("Lib")
assert libdir.exists()

with zipfile.PyZipFile(sys.argv[1], optimize=2, mode="w") as fp:
fp.writepy(libdir) # pyright: ignore[reportArgumentType]
for path in libdir.iterdir():
if path.is_dir() and path.name not in _EXCLUDE_MODULES:
fp.writepy(path) # pyright: ignore[reportArgumentType]
assert fp.namelist(), "Generated pythoncore.zip is empty. This will not block the build but will break MO2 at runtime!"