From 2f56e33515a28dbfeb563da408ad5a1f78b38c06 Mon Sep 17 00:00:00 2001 From: Caleb Bell Date: Sat, 3 Aug 2024 14:26:40 -0600 Subject: [PATCH 1/4] Test this --- .github/workflows/build-multiarch.yaml | 94 ++++++++++++++++++++++++++ conftest.py | 3 +- 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-multiarch.yaml diff --git a/.github/workflows/build-multiarch.yaml b/.github/workflows/build-multiarch.yaml new file mode 100644 index 0000000..3ac7727 --- /dev/null +++ b/.github/workflows/build-multiarch.yaml @@ -0,0 +1,94 @@ +name: Build Multiarch + +on: + push: + branches: [master, release, multi_arch_test] + pull_request: + branches: [master, release] + +jobs: + multi-arch-test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - arch: armv6 + distro: bookworm + - arch: armv7 + distro: bookworm + - arch: aarch64 + distro: bookworm + - arch: s390x + distro: bookworm + - arch: ppc64le + distro: bookworm + + - arch: armv7 + distro: ubuntu_latest + - arch: aarch64 + distro: ubuntu_latest + - arch: riscv64 + distro: ubuntu_latest + - arch: s390x + distro: ubuntu_latest + - arch: ppc64le + distro: ubuntu_latest + + - arch: armv7 + distro: ubuntu22.04 + - arch: aarch64 + distro: ubuntu22.04 + - arch: riscv64 + distro: ubuntu22.04 + - arch: s390x + distro: ubuntu22.04 + - arch: ppc64le + distro: ubuntu22.04 + # ubuntu20.04 is too old, fluids dropped support with numpy 2.0 compat + + - arch: armv6 + distro: alpine_latest + - arch: armv7 + distro: alpine_latest + - arch: aarch64 + distro: alpine_latest + - arch: riscv64 + distro: alpine_latest + - arch: s390x + distro: alpine_latest + - arch: ppc64le + distro: alpine_latest + # fedora-latest doesn't work not sure why + + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: all + - name: Run on ${{ matrix.arch }} + uses: uraimo/run-on-arch-action@v2 + with: + arch: ${{ matrix.arch }} + distro: ${{ matrix.distro }} + githubToken: ${{ github.token }} + install: | + if [[ "${{ matrix.distro }}" == "alpine_latest" ]]; then + apk update + apk add python3 py3-pip py3-scipy py3-matplotlib py3-numpy py3-pandas + elif [[ "${{ matrix.distro }}" == "ubuntu_latest" || "${{ matrix.distro }}" == "ubuntu20.04" || "${{ matrix.distro }}" == "ubuntu22.04" || "${{ matrix.distro }}" == "bookworm" ]]; then + apt-get update + apt-get install -y libatlas-base-dev liblapack-dev gfortran libgmp-dev libmpfr-dev libsuitesparse-dev ccache libmpc-dev python3 python3-pip python3-scipy python3-matplotlib python3-numpy python3-pandas + fi + run: | + if python3 -c "import subprocess; exit('no such option' not in subprocess.getoutput('pip3 install --break-system-packages'))"; then + # If the exit status is 0 (True), this means the option is not supported + python3 -m pip install wheel + pip3 install -r requirements_test_multiarch.txt + else + # If the exit status is 1 (False), this means the option is supported + python3 -m pip install wheel --break-system-packages + pip3 install -r requirements_test_multiarch.txt --break-system-packages + fi + python3 -m pytest . -v -m "not online and not thermo and not numba" \ No newline at end of file diff --git a/conftest.py b/conftest.py index 9275f18..9a680f4 100644 --- a/conftest.py +++ b/conftest.py @@ -2,6 +2,7 @@ import sys is_pypy = 'PyPy' in sys.version +is_x86_or_x86_64 = platform.machine().lower() in ('i386', 'i686', 'x86', 'x86_64', 'amd64') def pytest_ignore_collect(path): path = str(path) @@ -11,7 +12,7 @@ def pytest_ignore_collect(path): return True ver_tup = platform.python_version_tuple()[0:2] ver_tup = tuple(int(i) for i in ver_tup) - if ver_tup < (3, 7) or ver_tup >= (3, 13) or is_pypy: + if ver_tup < (3, 7) or ver_tup >= (3, 13) or is_pypy or is_x86_or_x86_64: # numba does not yet run under pypy if 'numba' in path: return True From f1a7264fefab35a5dd0e6db01f9c5bccc86de081 Mon Sep 17 00:00:00 2001 From: Caleb Bell Date: Sat, 3 Aug 2024 14:32:17 -0600 Subject: [PATCH 2/4] Try this --- requirements_test_multiarch.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 requirements_test_multiarch.txt diff --git a/requirements_test_multiarch.txt b/requirements_test_multiarch.txt new file mode 100644 index 0000000..bd75102 --- /dev/null +++ b/requirements_test_multiarch.txt @@ -0,0 +1,10 @@ +pytest +sympy +fuzzywuzzy +pint +pytz +IPython +sphinx +wheel +mpmath +fluids>=1.0.23 From 075fa54629a0f8e2b261600fd6488c6834984af8 Mon Sep 17 00:00:00 2001 From: Caleb Bell Date: Sat, 3 Aug 2024 14:38:04 -0600 Subject: [PATCH 3/4] Fix --- conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conftest.py b/conftest.py index 9a680f4..ab7e408 100644 --- a/conftest.py +++ b/conftest.py @@ -12,7 +12,7 @@ def pytest_ignore_collect(path): return True ver_tup = platform.python_version_tuple()[0:2] ver_tup = tuple(int(i) for i in ver_tup) - if ver_tup < (3, 7) or ver_tup >= (3, 13) or is_pypy or is_x86_or_x86_64: + if ver_tup < (3, 7) or ver_tup >= (3, 13) or is_pypy or not is_x86_or_x86_64: # numba does not yet run under pypy if 'numba' in path: return True From e6ffcd1b00fcd4269156f14b00858cfbc5524f21 Mon Sep 17 00:00:00 2001 From: Caleb Bell Date: Sun, 25 Aug 2024 20:53:28 -0600 Subject: [PATCH 4/4] Ready to merge --- .github/workflows/build-multiarch.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-multiarch.yaml b/.github/workflows/build-multiarch.yaml index 3ac7727..bc53843 100644 --- a/.github/workflows/build-multiarch.yaml +++ b/.github/workflows/build-multiarch.yaml @@ -2,7 +2,7 @@ name: Build Multiarch on: push: - branches: [master, release, multi_arch_test] + branches: [release] pull_request: branches: [master, release]