Skip to content

Commit 1f75046

Browse files
Merge pull request #216 from precice/python-bindings-v3.1.2
Release v3.1.2
2 parents 14f1e01 + 087b9f6 commit 1f75046

File tree

10 files changed

+70
-65
lines changed

10 files changed

+70
-65
lines changed

.github/workflows/build-env.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up Docker
1616
uses: docker/setup-buildx-action@v1
1717
- name: Login to registry
18-
uses: docker/login-action@v1
18+
uses: docker/login-action@v1
1919
with:
2020
username: ${{ secrets.DOCKERHUB_USERNAME }}
2121
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -24,5 +24,5 @@ jobs:
2424
with:
2525
push: true
2626
context: .
27-
file: spack/ci-spack-pyprecice-deps-2204.dockerfile
28-
tags: precice/ci-spack-pyprecice-deps-2204
27+
file: spack/ci-spack-pyprecice-deps-2404.dockerfile
28+
tags: precice/ci-spack-pyprecice-deps-2404

.github/workflows/build-spack.yml

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
# name: Build Spack
2-
# on:
3-
# push:
4-
# branches:
5-
# - "*"
6-
# pull_request:
7-
# branches:
8-
# - "*"
9-
# schedule:
10-
# - cron: '0 4 * * 1' # Schedule it every Sunday
11-
#
12-
# jobs:
13-
# build_spack:
14-
# name: build_spack
15-
# runs-on: ubuntu-latest
16-
# timeout-minutes: 15
17-
# container: precice/ci-spack-pyprecice-deps-2204
18-
# defaults:
19-
# run:
20-
# shell: "bash --login -eo pipefail {0}"
21-
# steps:
22-
# - name: Checkout Repository
23-
# uses: actions/checkout@v2
24-
# - name: Move Package Script
25-
# run: |
26-
# cp -r spack/repo/packages/py-pyprecice/ /py-pyprecice-repo/packages/
27-
# - name: Try to build py-pyprecice with spack and test it
28-
# run: |
29-
# . /opt/spack/share/spack/setup-env.sh
30-
# spack env activate ci && spack arch
31-
# spack remove py-pyprecice
32-
# spack add pyprecice.test.py-pyprecice@develop && spack develop pyprecice.test.py-pyprecice@develop
33-
# spack install && spack find
34-
# spack load py-pyprecice
35-
# BINDINGS_VERSION=$(python3 -c "import precice; print(precice.__version__)") && echo "Installed version of bindings is ${BINDINGS_VERSION}"
1+
name: Build Spack
2+
on:
3+
push:
4+
branches:
5+
- "*"
6+
pull_request:
7+
branches:
8+
- "*"
9+
schedule:
10+
- cron: '0 4 * * 1' # Schedule it every Sunday
11+
12+
jobs:
13+
build_spack:
14+
name: build_spack
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 15
17+
container: precice/ci-spack-pyprecice-deps-2404
18+
defaults:
19+
run:
20+
shell: "bash --login -eo pipefail {0}"
21+
steps:
22+
- name: Checkout Repository
23+
uses: actions/checkout@v2
24+
- name: Move Package Script
25+
run: |
26+
cp -r spack/repo/packages/py-pyprecice/ /py-pyprecice-repo/packages/
27+
- name: Try to build py-pyprecice@develop with spack and test it
28+
run: |
29+
. /opt/spack/share/spack/setup-env.sh
30+
spack env activate ci && spack arch
31+
spack remove py-pyprecice
32+
spack add pyprecice.test.py-pyprecice@develop && spack develop pyprecice.test.py-pyprecice@develop
33+
spack install && spack find
34+
spack load py-pyprecice
35+
BINDINGS_VERSION=$(python3 -c "import precice; print(precice.__version__)") && echo "Installed version of bindings is ${BINDINGS_VERSION}"

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## v3.1.2
6+
7+
* Restrict to numpy < 2 for better compatibility with CI pipeline. https://github.com/precice/python-bindings/pull/213
8+
* Require setuptools < 72 since support for the test command was removed in Setuptools 72. https://github.com/precice/python-bindings/pull/213
9+
* Require setuptools >= 61 to guarantee that pyproject.toml is used https://github.com/precice/python-bindings/pull/207
10+
* Fix CI pipeline for spack https://github.com/precice/python-bindings/pull/206
11+
512
## v3.1.1
613

714
* Fix NumPy include order to not conflict with system NumPy and the one installed via pip https://github.com/precice/python-bindings/pull/204

cyprecice/cyprecice.pyx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -818,23 +818,26 @@ cdef class Participant:
818818
>>> mesh_name = "MeshOne"
819819
>>> data_name = "DataOne"
820820
>>> vertex_ids = [1, 2, 3, 4, 5]
821-
>>> values = read_data(mesh_name, data_name, vertex_ids)
821+
>>> dt = 1.0
822+
>>> values = read_data(mesh_name, data_name, vertex_ids, dt)
822823
>>> values.shape
823824
>>> (5, )
824825
825826
Read vector data for a 2D problem with 5 vertices:
826827
>>> mesh_name = "MeshOne"
827828
>>> data_name = "DataOne"
828829
>>> vertex_ids = [1, 2, 3, 4, 5]
829-
>>> values = read_data(mesh_name, data_name, vertex_ids)
830+
>>> dt = 1.0
831+
>>> values = read_data(mesh_name, data_name, vertex_ids, dt)
830832
>>> values.shape
831833
>>> (5, 2)
832834
833835
Read vector data for a 3D system with 5 vertices:
834836
>>> mesh_name = "MeshOne"
835837
>>> data_name = "DataOne"
836838
>>> vertex_ids = [1, 2, 3, 4, 5]
837-
>>> values = read_data(mesh_name, data_name, vertex_ids)
839+
>>> dt = 1.0
840+
>>> values = read_data(mesh_name, data_name, vertex_ids, dt)
838841
>>> values.shape
839842
>>> (5, 3)
840843
"""

docs/ReleaseGuide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The release of the `python-bindings` repository is made directly from a release
2525

2626
7. If everything is in order up to this point then the new version can be released by hitting the "Publish release" button in your release Draft. This will create the corresponding tag and trigger [publishing the release to PyPI](https://github.com/precice/python-bindings/actions?query=workflow%3A%22Upload+Python+Package%22).
2727

28-
8. Now there exists be a tag corresponding to the release on `master`. Re-run the [docker release workflow `build-docker.yml` via dispatch]([https://github.com/precice/fenics-adapter/actions/workflows/build-docker.yml](https://github.com/precice/python-bindings/actions/workflows/build-docker.yml)) such that the correct version is picked up by `versioneer`. Check the version in the container via `docker pull precice/pythonbindings`, then `docker run -ti precice/pythonbindings`, and inside the container `$ python3 -c "import precice; print(precice.__version__)"`. ⚠️ There is an open issue that needs fixing https://github.com/precice/python-bindings/issues/195 ⚠️
28+
8. Now there exists be a tag corresponding to the release on `master`. Re-run the [docker release workflow `build-docker.yml` via dispatch]([https://github.com/precice/fenics-adapter/actions/workflows/build-docker.yml](https://github.com/precice/python-bindings/actions/workflows/build-docker.yml)) such that the correct version is picked up by `versioneer`. Check the version in the container via `docker pull precice/python-bindings`, then `docker run -ti precice/python-bindings`, and inside the container `$ python3 -c "import precice; print(precice.__version__)"`. ⚠️ There is an open issue that needs fixing https://github.com/precice/python-bindings/issues/195 ⚠️
2929

3030
9. Add an empty commit (details https://github.com/precice/python-bindings/issues/109) on master by running the steps:
3131

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[build-system]
22
# PEP 518 - minimum build system requirements
3-
requires = ["setuptools", "wheel", "Cython>=0.29", "packaging", "pip>=19.0.0", "numpy", "mpi4py", "pkgconfig"]
3+
requires = ["setuptools>=61,<72", "wheel", "Cython>=0.29", "packaging", "pip>=19.0.0", "numpy<2", "mpi4py", "pkgconfig"]

setup.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,6 @@
55

66
uses_pip = "pip" in __file__
77

8-
# check whether pip is used for installation. If pip is not used, dependencies defined in pyproject.toml might be
9-
# missing.
10-
if not uses_pip:
11-
warnings.warn(
12-
"It looks like you are not using pip for installation. Installing the package via 'pip3 install "
13-
"--user .' is recommended. You can still use 'python3 setup.py install --user', if you want and if "
14-
"the bindings work correctly, you do not have to worry. However, if you face problems during "
15-
"installation or running pyprecice, this means that you have to make sure that all dependencies are "
16-
"installed correctly and repeat the installation of pyprecice. Refer to pyproject.toml for a list "
17-
"of dependencies.")
18-
198
if uses_pip:
209
# If installed with pip we need to check its version
2110
try:
@@ -45,7 +34,6 @@
4534
" flag.".format(pip.__version__))
4635

4736
from setuptools import setup
48-
from setuptools import Command
4937
from setuptools.command.test import test
5038
from setuptools.command.install import install
5139
from Cython.Distutils.extension import Extension
@@ -149,7 +137,7 @@ def initialize_options(self):
149137
author_email='[email protected]',
150138
license='LGPL-3.0',
151139
python_requires='>=3',
152-
install_requires=['numpy', 'mpi4py', 'Cython'],
140+
install_requires=['numpy<2', 'mpi4py', 'Cython'],
153141
# mpi4py is only needed, if preCICE was compiled with MPI
154142
# see https://github.com/precice/python-bindings/issues/8
155143
packages=['precice'],

spack/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
The Spack package `py-pyprecice` provides the python bindings via Spack and was submitted via [pull request 19558](https://github.com/spack/spack/pull/19558) in the Spack repository. This folder contains the Spack package script that can be used for testing whether the Spack installation works.
44

5-
## Docker image `precice/ci-spack-pyprecice-deps-2204`
5+
## Docker image `precice/ci-spack-pyprecice-deps-2404`
66

7-
The workflow `build-spack-pyprecice-deps` in `.github/workflows/build-env.yml` creates the image `precice/ci-spack-pyprecice-deps-2204`. This image contains all dependencies of `py-pyprecice@develop`.
7+
The workflow `build-spack-pyprecice-deps` in `.github/workflows/build-env.yml` creates the image `precice/ci-spack-pyprecice-deps-2404`. This image contains all dependencies of `py-pyprecice@develop`.
88

9-
The workflow `build_spack` in `.github/workflows/build-spack.yml` uses the image `precice/ci-spack-pyprecice-deps-2204` to reduce build time. The workflow uses the `package.py` from this repository to build the latest version of the bindings and run a small test on this version.
9+
The workflow `build_spack` in `.github/workflows/build-spack.yml` uses the image `precice/ci-spack-pyprecice-deps-2404` to reduce build time. The workflow uses the `package.py` from this repository to build the latest version of the bindings and run a small test on this version.
1010

1111
## When a new Spack release is necessary
1212

spack/ci-spack-pyprecice-deps-2204.dockerfile renamed to spack/ci-spack-pyprecice-deps-2404.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage with Spack pre-installed and ready to be used
2-
FROM spack/ubuntu-jammy:latest
2+
FROM spack/ubuntu-noble:latest
33

44
# Mount the current sources into the build container
55
# and build the default environment

spack/repo/packages/py-pyprecice/package.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
1+
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
22
# Spack Project Developers. See the top-level COPYRIGHT file for details.
33
#
44
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
@@ -14,13 +14,18 @@ class PyPyprecice(PythonPackage):
1414

1515
homepage = "https://precice.org"
1616
git = "https://github.com/precice/python-bindings.git"
17-
url = "https://github.com/precice/python-bindings/archive/v2.4.0.0.tar.gz"
17+
url = "https://github.com/precice/python-bindings/archive/v3.1.1.tar.gz"
1818
maintainers("ajaust", "BenjaminRodenberg", "IshaanDesai")
1919

2020
# Always prefer final version of release candidate
2121
version("develop", branch="develop")
22+
version("3.1.1", sha256="50a0f1cbdb8fc362c22d316151c0e757958ff136a094e63b9b82d045d01d19c7")
23+
version("3.1.0", sha256="8d9bd9e28859001ab503a1e2f90e54b3c000079f04c14dc7c0c04c61c5666641")
24+
version("3.0.0.0", sha256="7e2c4b106a231b0df2a430d86d4a7b295f85adbe3478c425f863d1a4bebee9f7")
25+
version("2.5.0.4", sha256="7f9449573eb52ce48ca3f0ab35529ea0064942487842515ae0a2c9299aa0f0db")
26+
version("2.5.0.3", sha256="b983229b9fdf6bd4605ae8710985eb681025f6fb28ad8d7736cdf92593eef6df")
2227
version("2.5.0.2", sha256="6d7b78da830db6c5133b44617196ee90be8c7d6c8e14c8994a4800b3d4856416")
23-
version("2.5.0.1", sha256="e2602f828d4f907ea93e34f7d4adb8db086044a75a446592a4099423d56ed62c")
28+
version("2.5.0.1", sha256="d7c666e6ebff9e007c3703d8e3c3fcdf0f45289e36c2c17223b3aedc3259ab6c")
2429
version("2.5.0.0", sha256="9f55a22594bb602cde8a5987217728569f16d9576ea53ed00497e9046a2e1794")
2530
version("2.4.0.0", sha256="e80d16417b8ce1fdac80c988cb18ae1e16f785c5eb1035934d8b37ac18945242")
2631
version("2.3.0.1", sha256="ed4e48729b662680beaa4ee2a9aff724a79e760534c6c58181be739988da2789")
@@ -37,6 +42,8 @@ class PyPyprecice(PythonPackage):
3742

3843
for ver in [
3944
"develop",
45+
"3.1", # only consider major.minor from 3.1.0. See https://github.com/precice/python-bindings/pull/199
46+
"3.0.0",
4047
"2.5.0",
4148
"2.4.0",
4249
"2.3.0",
@@ -51,8 +58,8 @@ class PyPyprecice(PythonPackage):
5158
depends_on("precice@" + ver, when="@" + ver)
5259

5360
depends_on("python@3:", type=("build", "link", "run"))
54-
depends_on("py-setuptools", type="build")
55-
depends_on("py-numpy", type=("build", "link", "run"))
61+
depends_on("py-setuptools@61:71", type="build")
62+
depends_on("py-numpy@:1", type=("build", "link", "run"))
5663
depends_on("py-mpi4py", type=("build", "run"))
5764
depends_on("[email protected]:", type="build")
5865
depends_on("py-packaging", type="build")

0 commit comments

Comments
 (0)