Files
rusty-path-of-building/packaging/windows/package_release.py
T
faumaray ebf33b62dc
CI / check (push) Successful in 1m28s
CI / windows (push) Successful in 3m27s
Native release / linux (push) Successful in 1m29s
Native release / windows (push) Successful in 3m1s
Native release / publish (push) Successful in 9s
Let the CI Python distribution locate its packaging interpreter
2026-11-27 23:43:54 +03:00

29 lines
1.2 KiB
Python

"""Build and smoke-test the release packages with an isolated Python interpreter."""
from pathlib import Path
import subprocess
import sys
import venv
def main(work, binary, destination, dll_dirs):
root = Path(__file__).resolve().parents[2]
directory = str(Path(work).resolve() / "py")
builder = venv.EnvBuilder(with_pip=True)
builder.create(directory)
# CPython distributions use different executable names and venv layouts on Windows.
python = builder.ensure_directories(directory).env_exec_cmd
print(f"Packaging with {python} ({sys.platform})", flush=True)
subprocess.run([python, "-m", "pip", "install", "--disable-pip-version-check", "--no-input",
"--require-hashes", "-r", root / "packaging/windows/requirements.txt"], check=True)
args = [python, root / "packaging/package.py", "windows", binary,
"--output", destination, "--require-static-crt"]
for directory in dll_dirs:
args.extend(["--dll-dir", directory])
subprocess.run(args, check=True)
subprocess.run([python, root / "packaging/check_windows_release.py", destination], check=True)
if __name__ == "__main__":
main(*sys.argv[1:4], sys.argv[4:])