Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi arch test #153

Merged
merged 11 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions .github/workflows/build-multiarch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Build Multiarch

on:
push:
branches: [release]
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 py3-sqlalchemy
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 python3-sqlalchemy
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
pip3 install .
python3 dev/dump_UNIFAC_assignments_to_sqlite.py
pip3 uninstall -y thermo
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
pip3 install . --break-system-packages
python3 dev/dump_UNIFAC_assignments_to_sqlite.py
pip3 uninstall -y thermo --break-system-packages
fi
python3 -m pytest . -v -m "not online and not sympy and not numba and not CoolProp and not fuzz and not deprecated and not slow"
4 changes: 3 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
is_pypy = 'PyPy' in sys.version
ver_tup = platform.python_version_tuple()[0:2]
ver_tup = tuple(int(i) for i in ver_tup)
is_x86_or_x86_64 = platform.machine().lower() in ('i386', 'i686', 'x86', 'x86_64', 'amd64')

def pytest_ignore_collect(path):
path = str(path)
# Serious technical debt
Expand All @@ -15,7 +17,7 @@ def pytest_ignore_collect(path):
return True
if 'conf.py' in path:
return True
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 not is_x86_or_x86_64:
# numba does not yet run under pypy
if 'numba' in path:
return True
Expand Down
10 changes: 10 additions & 0 deletions requirements_test_multiarch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
sympy
fluids>=1.0.26
chemicals>=1.2.0
pytest
pint
IPython
sphinx
mpmath
fuzzywuzzy
pytz
2 changes: 1 addition & 1 deletion thermo/utils/tp_dependent_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ def interpolate_P(self, T, P, name):

# Only allow linear extrapolation, but with whatever transforms are specified
# extrapolator = RectBivariateSpline(Ts2_sorted, Ps2_sorted, properties2_sorted.T, kx=1, ky=1, s=0) # interpolation if fill value is missing
extrapolator = RegularGridInterpolator((Ts2_sorted, Ps2_sorted), properties2_sorted.T, method='slinear', fill_value=None, bounds_error=False) # interpolation if fill value is missing
extrapolator = RegularGridInterpolator((Ts2_sorted, Ps2_sorted), properties2_sorted.T, method='linear', fill_value=None, bounds_error=False) # interpolation if fill value is missing
# If more than 5 property points, create a spline interpolation
if len(properties) >= 5:
spline = RectBivariateSpline(Ts2_sorted, Ps2_sorted, properties2_sorted.T, kx=3, ky=3, s=0)
Expand Down
Loading