Skip to content

Commit

Permalink
use setup-python action also on Apple silicon CI runs (since the acti…
Browse files Browse the repository at this point in the history
…on now supports ARM Python) (#1404)
  • Loading branch information
slayoo authored Oct 26, 2024
1 parent 25c8c75 commit d79274c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 40 deletions.
20 changes: 4 additions & 16 deletions .github/workflows/readme_snippets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,16 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4.1.6
- if: matrix.platform != 'macos-14'
uses: actions/setup-python@v5.0.0
- uses: actions/setup-python@v5.0.0
with:
python-version: 3.9
- if: matrix.platform == 'macos-14'
run: |
sudo ln -s `which python3` /usr/local/bin/python
echo "PIP_INSTALL_ARGS=--break-system-packages" >> $GITHUB_ENV
python -m pip install --break-system-packages setuptools packaging # Python 3.12 workaround
python-version: "3.10"
- run: python -m pip install $PIP_INSTALL_ARGS -e .
- run: python -m pip install $PIP_INSTALL_ARGS pytest-codeblocks pytest
- run: python -m pip install $PIP_INSTALL_ARGS "pyparsing<3.0.0" # https://github.com/matplotlib/matplotlib/issues/25204
- run: |
python -c "import os,pytest_codeblocks; code=pytest_codeblocks.extract_from_file('README.md'); f=open('readme.py', 'w', encoding='utf-8'); f.write('# coding: utf-8'+os.linesep); f.writelines(block.code for block in code if block.syntax=='Python'); f.close()"
- run: cat -n readme.py
- if: matrix.platform == 'macos-14'
run: |
python readme.py
sed -i -e 's/CPU/GPU/g' readme.py
python readme.py
- if: matrix.platform != 'macos-14'
run: |
- run: |
python -We readme.py
sed -i -e 's/CPU/GPU/g' readme.py
python -We readme.py
Expand All @@ -60,7 +48,7 @@ jobs:
- uses: actions/checkout@v4.1.6
- uses: actions/setup-python@v5.0.0
with:
python-version: 3.9
python-version: "3.10"
- run: pip install -e .
- run: pip install pytest-codeblocks pytest
- run: python -c "import pytest_codeblocks; code=pytest_codeblocks.extract_from_file('README.md'); f=open('readme.jl', 'w'); f.writelines(block.code for block in code if block.syntax=='Julia'); f.close()"
Expand Down
29 changes: 8 additions & 21 deletions .github/workflows/tests+artifacts+pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
with:
submodules: recursive
fetch-depth: 0
- uses: actions/setup-python@master
- uses: actions/setup-python@v5.0.0
with:
python-version: 3.9
- name: Generate coverage report
Expand Down Expand Up @@ -122,10 +122,12 @@ jobs:
needs: [pdoc, nojit_and_codecov, zenodo_json]
strategy:
matrix:
platform: [ubuntu-latest, macos-12, windows-latest]
platform: [ubuntu-latest, macos-12, macos-14, windows-latest]
python-version: ["3.9", "3.11"]
test-suite: ["unit_tests/!(dynamics)", "unit_tests/dynamics/!(condensation)", "unit_tests/dynamics/condensation", "smoke_tests/no_env", "smoke_tests/box", "smoke_tests/parcel_a", "smoke_tests/parcel_b", "smoke_tests/parcel_c", "smoke_tests/kinematic_1d", "smoke_tests/kinematic_2d", "tutorials_tests"]
exclude:
- platform: "macos-14"
python-version: "3.9"
- test-suite: "devops_tests"
python-version: "3.9"
fail-fast: false
Expand All @@ -148,7 +150,7 @@ jobs:
- if: startsWith(matrix.test-suite, 'smoke_tests') || matrix.test-suite == 'tutorials_tests'
run: pip install -e ./examples

- run: pip install -e .[tests] # incl. ensuring that the previous pip did not overwrite the package
- run: pip install --only-binary :all: -e .[tests] # incl. ensuring that the previous pip did not overwrite the package

# install devops_tests for tutorials_tests
- if: matrix.test-suite == 'tutorials_tests'
Expand Down Expand Up @@ -183,7 +185,7 @@ jobs:
with:
submodules: recursive
fetch-depth: 0
- uses: actions/setup-python@v1
- uses: actions/setup-python@v5.0.0
with:
python-version: ${{ matrix.python-version }}
- run: |
Expand Down Expand Up @@ -304,31 +306,16 @@ jobs:
strategy:
matrix:
platform: [ubuntu-latest, macos-12, macos-14, windows-latest]
python-version: ["3.9", "3.11", "system"]
python-version: ["3.9", "3.11"]
exclude:
- platform: ubuntu-latest
python-version: system
- platform: macos-12
python-version: system
- platform: windows-latest
python-version: system
- platform: macos-14
python-version: "3.9"
- platform: macos-14
python-version: "3.11"
runs-on: ${{ matrix.platform }}
needs: [package]
steps:
- if: matrix.platform != 'macos-14'
uses: actions/setup-python@v5.0.0
- uses: actions/setup-python@v5.0.0
with:
python-version: ${{ matrix.python-version }}
- if: matrix.platform == 'macos-14'
run: |
sudo ln -s `which python3` /usr/local/bin/python
echo "PIP_INSTALL_ARGS=--break-system-packages" >> $GITHUB_ENV
# Python 3.12 workaround
python -m pip install --break-system-packages setuptools packaging
- uses: actions/download-artifact@v4
with:
pattern: dist-*
Expand Down
7 changes: 4 additions & 3 deletions PySDM/backends/numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ def __init__(self, formulae=None, double_precision=True, override_jit_flags=None

parallel_default = True
if platform.machine() == "arm64":
warnings.warn(
"Disabling Numba threading due to ARM64 CPU (atomics do not work yet)"
)
if "CI" not in os.environ:
warnings.warn(
"Disabling Numba threading due to ARM64 CPU (atomics do not work yet)"
)
parallel_default = False # TODO #1183 - atomics don't work on ARM64!

try:
Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def get_long_description():
10: "==0.60.0",
11: "==0.60.0",
12: "==0.60.0",
13: "==0.60.0",
}[sys.version_info.minor]
if CI and not _32bit
else ">=0.51.2"
Expand All @@ -50,6 +51,7 @@ def get_long_description():
10: "==1.24.4",
11: "==1.24.4",
12: "==1.26.4",
13: "==1.26.4",
}[sys.version_info.minor]
if CI
else ""
Expand All @@ -64,6 +66,7 @@ def get_long_description():
10: "==1.10.1",
11: "==1.10.1",
12: "==1.13.0",
13: "==1.13.0",
}[sys.version_info.minor]
if CI and not _32bit
else ""
Expand Down

0 comments on commit d79274c

Please sign in to comment.