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

Bump numpy from 1.26.4 to 2.2.0 #677

Merged
merged 10 commits into from
Dec 10, 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
31 changes: 9 additions & 22 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ jobs:

env:
PYOM2_DIR: /home/runner/pyom2
PETSC_VERSION: "3.20.0"
PETSC_DIR: /home/runner/petsc
PETSC_ARCH: arch-linux-c-opt
PETSC_VERSION: "3.22.1"
OMPI_MCA_rmaps_base_oversubscribe: "1"
OMPI_MCA_mpi_yield_when_idle: "1"
VEROS_REQUIRE_CYTHON_EXT: "1"
Expand Down Expand Up @@ -57,13 +55,6 @@ jobs:
path: ${{ env.PYOM2_DIR }}/py_src/*.so
key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('vendor/pyom2/**/*') }}-${{ hashFiles('requirements.txt') }}

- name: Restore PETSc build cache
uses: actions/cache@v2
id: petsc-cache
with:
path: ${{ env.PETSC_DIR }}
key: ${{ matrix.os }}-${{ env.PETSC_VERSION }}

- name: Setup Python environment
run: |
python -m pip install --upgrade pip
Expand All @@ -75,26 +66,22 @@ jobs:
sudo apt-get update
sudo apt-get install libopenmpi-dev liblapack-dev libblas-dev

- name: Build PETSc
if: steps.petsc-cache.outputs.cache-hit != 'true'
run: |
git clone -b v$PETSC_VERSION --depth 1 https://gitlab.com/petsc/petsc.git $PETSC_DIR
pushd $PETSC_DIR
./configure --with-debugging=0 -with-shared-libraries --with-precision=double
make all
popd

- name: Install Veros
run: |
pip install mpi4py
if [ ${{ matrix.backend }} == "jax" ]
then
pip install mpi4jax
pip install -e .[test,jax]
else
pip install -e .[test]
fi
pip install petsc4py==$PETSC_VERSION --no-deps --no-build-isolation

- name: Install optional requirements
run: |
# PETSc has issues with mpi4py v4
pip install "mpi4py<4"
pip install mpi4jax --no-build-isolation
pip install petsc==$PETSC_VERSION --no-build-isolation
pip install petsc4py==$PETSC_VERSION --no-build-isolation

# Build PyOM2 after Veros to make sure we have compatible versions of NumPy / f2py
- name: Build PyOM2
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
click==8.1.7
entrypoints==0.4
requests==2.32.3
numpy==1.26.4
numpy==2.2.0
numpy==1.26.4; python_version < '3.10'
scipy==1.14.1
h5netcdf==1.4.1
h5py==3.12.1
Expand Down
11 changes: 8 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,21 @@ def parse_requirements(reqfile):
with open(os.path.join(here, reqfile), encoding="utf-8") as f:
for line in f:
line = line.strip()
pkg = re.match(r"(\w+)\b.*", line).group(1)
parsed = re.match(r"(\w+)(.*?)(;.*)?$", line)
pkg, deps, extra = parsed.groups()
if extra is None:
extra = ""
deps = deps.replace("==", "<=")
if pkg in MINIMUM_VERSIONS:
line = "".join([line, ",>=", MINIMUM_VERSIONS[pkg]])
line = line.replace("==", "<=")
deps = f"{deps},>={MINIMUM_VERSIONS[pkg]}"
line = "".join([pkg, deps, extra])
requirements.append(line)

return requirements


INSTALL_REQUIRES = parse_requirements("requirements.txt")
print(INSTALL_REQUIRES)


jax_req = parse_requirements("requirements_jax.txt")
Expand Down
Loading