diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index b64a23a4..0fa4f594 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -913,7 +913,9 @@ cp -av Python/frozen.c ${ROOT}/out/python/build/Python/ cp -av Modules/Setup* ${ROOT}/out/python/build/Modules/ # Copy the test hardness runner for convenience. -cp -av Tools/scripts/run_tests.py ${ROOT}/out/python/build/ +if [ -d Tools/scripts/run_tests.py ]; then + cp -av Tools/scripts/run_tests.py ${ROOT}/out/python/build/ +fi mkdir ${ROOT}/out/python/licenses cp ${ROOT}/LICENSE.*.txt ${ROOT}/out/python/licenses/ diff --git a/cpython-windows/build.py b/cpython-windows/build.py index bc97cd57..f7a4ebd2 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -1700,10 +1700,18 @@ def build_cpython( log("copying %s to %s" % (source, dest)) shutil.copyfile(source, dest) - shutil.copyfile( - cpython_source_path / "Tools" / "scripts" / "run_tests.py", - out_dir / "python" / "build" / "run_tests.py", - ) + # CPython 3.13 removed `run_tests.py`. + if meets_python_minimum_version(python_version, "3.13"): + # TODO(zanieb): Write a script to invoke `python -m test --slow-ci` + # or update the metadata to not require `run_tests.py` + pathlib.Path( + out_dir / "python" / "build" / "run_tests.py", + ).touch() + else: + shutil.copyfile( + cpython_source_path / "Tools" / "scripts" / "run_tests.py", + out_dir / "python" / "build" / "run_tests.py", + ) licenses_dir = out_dir / "python" / "licenses" licenses_dir.mkdir()