diff options
| author | L. E. Segovia <amy@amyspark.me> | 2025-01-31 01:09:01 +0000 |
|---|---|---|
| committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2025-02-04 08:16:23 +0530 |
| commit | 3a4cb94e949a94fdfb921a2df7f898ec8c70811a (patch) | |
| tree | 9879e92e3c5be18f971f2152cffe19b626026311 | |
| parent | e793b1bc1aa5f44b67199a845c126e3ab459c8c6 (diff) | |
| download | meson-3a4cb94e949a94fdfb921a2df7f898ec8c70811a.tar.gz | |
ci: Update appleclang job to test Xcode-provided Python
| -rw-r--r-- | .github/workflows/macos.yml | 18 | ||||
| -rw-r--r-- | unittests/pythontests.py | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index f5a87c957..2d2ea39c0 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -32,12 +32,10 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.x' - run: | - python -m pip install --upgrade pip - python -m pip install pytest pytest-xdist pytest-subtests fastjsonschema coverage + export PATH="$HOME/Library/Python/3.9/bin:$PATH" + /usr/bin/python3 -m pip install --upgrade pip + /usr/bin/python3 -m pip install pytest pytest-xdist pytest-subtests fastjsonschema coverage - run: brew install pkg-config ninja llvm qt@5 - env: CPPFLAGS: "-I/opt/homebrew/include" @@ -48,12 +46,14 @@ jobs: # These cannot evaluate anything, so we cannot set PATH or SDKROOT here run: | export SDKROOT="$(xcodebuild -version -sdk macosx Path)" - export PATH="$HOME/tools:/opt/homebrew/opt/qt@5/bin:/opt/homebrew/opt/llvm/bin:$PATH" - export PKG_CONFIG_PATH="/opt/homebrew/opt/qt@5/lib/pkgconfig:$PKG_CONFIG_PATH" - ./tools/run_with_cov.py ./run_unittests.py + export PATH="$HOME/Library/Python/3.9/bin:$HOME/tools:/opt/homebrew/opt/qt@5/bin:/opt/homebrew/opt/llvm/bin:$PATH" + export PKG_CONFIG_PATH="/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/Current/lib/pkgconfig:/opt/homebrew/opt/qt@5/lib/pkgconfig:$PKG_CONFIG_PATH" + /usr/bin/python3 ./tools/run_with_cov.py ./run_unittests.py - name: Aggregate coverage reports - run: ./ci/combine_cov.sh + run: | + export PATH="$HOME/Library/Python/3.9/bin:$PATH" + ./ci/combine_cov.sh - name: Upload coverage report uses: codecov/codecov-action@v3 diff --git a/unittests/pythontests.py b/unittests/pythontests.py index 96864ffd8..c4926c83c 100644 --- a/unittests/pythontests.py +++ b/unittests/pythontests.py @@ -65,7 +65,7 @@ python = pymod.find_installation('python3', required: true) realfile = os.path.join(root, file) if file.endswith('.py'): # FIXME: relpath must be adjusted for windows path behaviour - if hasattr(sys, "pycache_prefix"): + if getattr(sys, "pycache_prefix", None) is not None: root = os.path.join(sys.pycache_prefix, os.path.relpath(root, '/')) else: root = os.path.join(root, '__pycache__') |
