From 3c09034f5a2af4d8c883c22d05dac87b34290a4d Mon Sep 17 00:00:00 2001 From: Sylwester Arabas Date: Tue, 16 Apr 2024 16:21:54 +0200 Subject: [PATCH] fix CI problems incl. arm64-related ones (--break-system-packages option for pip; codecov secret; Python 3.12 compatible CI reqs) (#424) --- .github/workflows/tests+pypi.yml | 53 +++++++++++++++++++++++++------- examples/setup.py | 2 +- setup.py | 29 +++++++++++++++-- 3 files changed, 69 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests+pypi.yml b/.github/workflows/tests+pypi.yml index c8869aee..3f334fc5 100644 --- a/.github/workflows/tests+pypi.yml +++ b/.github/workflows/tests+pypi.yml @@ -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 @@ -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 @@ -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 @@ -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: @@ -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 diff --git a/examples/setup.py b/examples/setup.py index 8234f4d1..602c2cd3 100644 --- a/examples/setup.py +++ b/examples/setup.py @@ -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", diff --git a/setup.py b/setup.py index 79792fc7..19995e05 100644 --- a/setup.py +++ b/setup.py @@ -4,6 +4,7 @@ import os import platform +import sys from setuptools import find_packages, setup @@ -25,7 +26,18 @@ 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", ], @@ -33,13 +45,24 @@ def get_long_description(): "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",