Skip to content

Commit

Permalink
ci: Update appleclang job to test Xcode-provided Python
Browse files Browse the repository at this point in the history
  • Loading branch information
amyspark authored and nirbheek committed Feb 4, 2025
1 parent e793b1b commit 3a4cb94
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion unittests/pythontests.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _test_bytecompile(self, py2=False):
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__')
Expand Down

0 comments on commit 3a4cb94

Please sign in to comment.