Skip to content

Commit

Permalink
fix CI problems incl. arm64-related ones (--break-system-packages opt…
Browse files Browse the repository at this point in the history
…ion for pip; codecov secret; Python 3.12 compatible CI reqs) (#424)
  • Loading branch information
slayoo authored Apr 16, 2024
1 parent ca4f36b commit 3c09034
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 15 deletions.
53 changes: 42 additions & 11 deletions .github/workflows/tests+pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true

Expand Down Expand Up @@ -120,7 +121,18 @@ jobs:
strategy:
matrix:
platform: [ubuntu-latest, macos-12, macos-14, windows-latest]
python-version: ["3.8", "3.11"]
python-version: ["3.8", "3.11", "system"]
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.8"
- platform: macos-14
python-version: "3.11"
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
Expand All @@ -134,14 +146,17 @@ jobs:
python-version: ${{ matrix.python-version }}

- if: matrix.platform == 'macos-14'
run: sudo ln -s `which python3` /usr/local/bin/python

- run: |
python -m pip install -e .
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
- run: |
python -m pip install $PIP_INSTALL_ARGS -e . # to check if usable without test/example dependencies
python -We -c "import PyMPDATA"
- run: |
python -m pip install -e .[tests] ./examples
python -m pip install $PIP_INSTALL_ARGS -e .[tests] ./examples
# https://github.com/numba/numba/issues/6350#issuecomment-728174860
- if: startsWith(matrix.platform, 'ubuntu-')
run: echo NUMBA_THREADING_LAYER=omp >> $GITHUB_ENV
Expand All @@ -163,6 +178,17 @@ jobs:
matrix:
platform: [ubuntu-latest, macos-12, macos-14, windows-latest]
python-version: ["3.8", "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.8"
- platform: macos-14
python-version: "3.11"
fail-fast: false
runs-on: ${{ matrix.platform }}
steps:
Expand All @@ -177,10 +203,15 @@ jobs:
python-version: ${{ matrix.python-version }}

- if: matrix.platform == 'macos-14'
run: sudo ln -s `which python3` /usr/local/bin/python

- run: python -m pip install -e .[tests] ./examples
- run: python -m pip install -r tests/devops_tests/requirements.txt
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
- run: python -m pip install $PIP_INSTALL_ARGS -e .[tests] ./examples
- run: python -m pip install $PIP_INSTALL_ARGS -r tests/devops_tests/requirements.txt
- if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get install libblitz0-dev libboost-thread-dev libboost-date-time-dev libboost-system-dev libboost-iostreams-dev libboost-timer-dev libboost-filesystem-dev
Expand Down
2 changes: 1 addition & 1 deletion examples/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_long_description():
"pystrict",
"matplotlib",
"ipywidgets" + "<8.0.3" if CI else "",
"scipy" + ("==1.10.1" if CI else ""),
"scipy",
"pint",
"joblib",
"sympy",
Expand Down
29 changes: 26 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import os
import platform
import sys

from setuptools import find_packages, setup

Expand All @@ -25,21 +26,43 @@ def get_long_description():
use_scm_version={"local_scheme": lambda _: "", "version_scheme": "post-release"},
setup_requires=["setuptools_scm"],
install_requires=[
"numba" + ("==0.58.1" if CI and not _32bit else ""),
"numba"
+ (
{
8: "==0.58.1",
9: "==0.58.1",
10: "==0.58.1",
11: "==0.58.1",
12: "==0.59.1",
}[sys.version_info.minor]
if CI and not _32bit
else ""
),
"numpy" + ("==1.24.4" if CI else ""),
"pystrict",
],
extras_require={
"tests": [
"PyMPDATA-examples",
"matplotlib" + (">=3.2.2" if CI else ""),
"scipy" + ("==1.10.1" if CI and not _32bit else ""),
"scipy"
+ (
{
8: "==1.10.1",
9: "==1.10.1",
10: "==1.10.1",
11: "==1.10.1",
12: "==1.13.0",
}[sys.version_info.minor]
if CI and not _32bit
else ""
),
"jupyter-core" + ("<5.0.0" if CI else ""),
"ipywidgets" + ("!=8.0.3" if CI else ""),
"ghapi",
"pytest",
"pytest-benchmark",
"joblib" + ("==1.3.2" if CI else ""),
"joblib" + ("==1.4.0" if CI else ""),
]
},
author="https://github.com/open-atmos/PyMPDATA/graphs/contributors",
Expand Down

0 comments on commit 3c09034

Please sign in to comment.