diff --git a/.github/workflows/build-native-action.yml b/.github/workflows/build-native-action.yml index 9966d7d8..9bf10577 100644 --- a/.github/workflows/build-native-action.yml +++ b/.github/workflows/build-native-action.yml @@ -104,10 +104,15 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python 3.10 + - name: Patch /usr/local + run: | + sudo mkdir /tmp/local + sudo mv -f /usr/local/* /tmp/local/ + + - name: Set up Python 3.11 uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.11' - name: Show environment run: | @@ -121,6 +126,10 @@ jobs: run: | python3 -m relenv build --no-pretty --python=${{ matrix.version }} + - name: Unpatch /usr/local + run: | + sudo mv -f /tmp/local/* /usr/local/ + - name: Verify Build run: | python3 -m nox -e tests -- tests/test_verify_build.py @@ -162,10 +171,15 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python 3.10 + - name: Patch include + run: | + sudo mkdir /tmp/local + sudo mv -f /usr/local/* /tmp/local/ + + - name: Set up Python 3.11 uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.11' - name: Show environment run: | diff --git a/tests/test_verify_build.py b/tests/test_verify_build.py index 47bbed12..da014f8f 100644 --- a/tests/test_verify_build.py +++ b/tests/test_verify_build.py @@ -6,7 +6,6 @@ import json import os import pathlib -import platform import shutil import subprocess import sys @@ -440,11 +439,7 @@ def test_pip_install_pyzmq(pipexec, pyzmq_version, build_version, arch, build): ], env=env, ) - if ( - pyzmq_version == "26.2.0" - and sys.platform == "darwin" - and platform.processor() == "arm" - ): + if pyzmq_version == "26.2.0" and sys.platform == "darwin": pytest.xfail(f"{pyzmq_version} does not install on m1 mac") if pyzmq_version == "26.2.0" and sys.platform == "darwin": env[ @@ -1676,3 +1671,9 @@ def test_no_openssl_binary(rockycontainer, pipexec): errors = proc.stderr.decode() assert "legacy provider failed to load" not in errors + + +@pytest.mark.skip_unless_on_darwin +def test_darwin_python_linking(pipexec, pyexec, build, minor_version): + proc = subprocess.run(["otool", "-L", str(pyexec)], capture_output=True, check=True) + assert "/usr/local/opt" not in proc.stdout.decode()