Skip to content

Commit

Permalink
Bump numpy from 1.26.4 to 2.2.0 (#677)
Browse files Browse the repository at this point in the history
* Bump numpy from 1.26.4 to 2.2.0

Bumps [numpy](https://github.com/numpy/numpy) from 1.26.4 to 2.2.0.
- [Release notes](https://github.com/numpy/numpy/releases)
- [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst)
- [Commits](numpy/numpy@v1.26.4...v2.2.0)

---
updated-dependencies:
- dependency-name: numpy
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* use older numpy for older python

* better reqs parsing

* install petsc from pypi

* wip

* wip

* wip

* wip

* wip

* cleanup

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dion Häfner <dion.haefner@simulation.science>
  • Loading branch information
dependabot[bot] and dionhaefner authored Dec 10, 2024
1 parent 1c7e9a5 commit 337a79f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 26 deletions.
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

0 comments on commit 337a79f

Please sign in to comment.