From 9b6b596a5ad7077f7a09661c8df7140674d007b0 Mon Sep 17 00:00:00 2001 From: Tyler Yankee Date: Tue, 25 Aug 2026 16:34:54 -0400 Subject: [PATCH] [wheel] Remove pythonX.Y symlink indirection on macOS The `python` spelling is needed for `install-wheel.sh` and `test-wheel.sh` to be reusable across the Linux and macOS builders, but it being a symlink pointing to `pythonX.Y` (the directory where the venv lives) is unnecessary. `provision-build.sh` already creates a unique test root each time a wheel is tested (via `macos/provision-test-python.sh`). The broader motivation for the change is to remove confusion around the uniqueness of the test root and Python virtual environment ahead of a future commit to support testing a single wheel with multiple Python versions. Co-authored-by: Matthew Woehlke --- tools/wheel/macos/provision-test-python.sh | 2 +- tools/wheel/wheel_builder/macos.py | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/tools/wheel/macos/provision-test-python.sh b/tools/wheel/macos/provision-test-python.sh index e311b8de4b86..1a9cbaebf904 100755 --- a/tools/wheel/macos/provision-test-python.sh +++ b/tools/wheel/macos/provision-test-python.sh @@ -21,4 +21,4 @@ fi # NOTE: Xcode ships python3, make sure to use the one from brew. $(brew --prefix python@$1)/bin/python$1 \ - -m venv /tmp/drake-wheel-test/python$1 + -m venv /tmp/drake-wheel-test/python diff --git a/tools/wheel/wheel_builder/macos.py b/tools/wheel/wheel_builder/macos.py index 17c43c67c878..4781b751ed07 100644 --- a/tools/wheel/wheel_builder/macos.py +++ b/tools/wheel/wheel_builder/macos.py @@ -84,6 +84,7 @@ def _test_wheel(wheel, target, env): """ Runs the test script on `wheel`. """ + # Set up the environment. setup_script = os.path.join( resource_root, "macos", "provision-test-python.sh" ) @@ -91,12 +92,6 @@ def _test_wheel(wheel, target, env): ["bash", setup_script, target.python.version], env=env ) - test_python_venv = os.path.join(test_root, "python") - os.symlink( - os.path.join(test_root, f"python{target.python.version}"), - test_python_venv, - ) - # Install the wheel. install_script = os.path.join(resource_root, "test", "install-wheel.sh") subprocess.check_call(["bash", install_script, wheel], env=env) @@ -108,8 +103,6 @@ def _test_wheel(wheel, target, env): subprocess.check_call(["bash", test_script, test, wheel], env=env) print(f"-- Executing test {test} - PASSED") - os.unlink(test_python_venv) - def build(options): """