-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #144 from precice/python-bindings-v2.4.0.0
Release v2.4.0.0
- Loading branch information
Showing
14 changed files
with
123 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,13 +16,35 @@ The release of the `python-bindings` repository is made directly from a release | |
|
||
* *Note:* We use the [python-versioneer](https://github.com/python-versioneer/python-versioneer/) for maintaining the version. Therefore the tag directly defines the version in all relevant places. | ||
* *Note:* If it is a pre-release then the option *This is a pre-release* needs to be selected at the bottom of the page. Use `@target:python-bindings-v2.1.1.1` for a pre-release, since we will never merge a pre-release into master. | ||
* Use the `Auto-generate release notes` feature. See, for example, https://github.com/precice/python-bindings/releases/tag/v2.3.0.1 | ||
|
||
a) If a pre-release is made: Directly hit the "Publish release" button in your Release Draft. Now you can check the artifacts (e.g. release on [PyPI](https://pypi.org/project/pyprecice/#history)) of the release. *Note:* As soon as a new tag is created github actions will take care of deploying the new version on PyPI using [this workflow](https://github.com/precice/python-bindings/actions?query=workflow%3A%22Upload+Python+Package%22). | ||
|
||
b) If this is a "real" release: As soon as one approving review is made, merge the release PR (from `python-bindings-v2.1.1.1`) into `master`. | ||
|
||
6. Merge `master` into `develop` for synchronization of `develop`. | ||
5. Merge `master` into `develop` for synchronization of `develop`. | ||
|
||
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]. | ||
6. 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). | ||
|
||
7. Add an empty commit on master via `git checkout master`, then `git commit --allow-empty -m "post-tag bump"`. Check that everything is in order via `git log`. Important: The `tag` and `origin/master` should not point to the same commit. For example: | ||
|
||
``` | ||
commit 44b715dde4e3194fa69e61045089ca4ec6925fe3 (HEAD -> master, origin/master) | ||
Author: Benjamin Rodenberg <[email protected]> | ||
Date: Wed Oct 20 10:52:41 2021 +0200 | ||
post-tag bump | ||
commit d2645cc51f84ad5eda43b9c673400aada8e1505a (tag: v2.3.0.1) | ||
Merge: 2039557 aca2354 | ||
Author: Benjamin Rodenberg <[email protected]> | ||
Date: Tue Oct 19 12:57:24 2021 +0200 | ||
Merge pull request #132 from precice/python-bindings-v2.3.0.1 | ||
Release v2.3.0.1 | ||
``` | ||
|
||
For more details refer to https://github.com/precice/python-bindings/issues/109 and https://github.com/python-versioneer/python-versioneer/issues/217. | ||
|
||
8. Update Spack package (refer to `python-bindings/spack/README.md`). |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,65 @@ | ||
# Spack package: py-pyprecice | ||
|
||
The Spack package `py-pyprecice` provides the python bindings via Spack and was submitted via https://github.com/spack/spack/pull/19558. This folder contains the Spack package script that can be used for testing whether the Spack installation works. | ||
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. | ||
|
||
## Docker image `precice/ci-spack-pyprecice-deps-1804` | ||
|
||
The workflow `build-spack-pyprecice-deps` in `.github/workflows/build-env.yml` creates the image `precice/ci-spack-pyprecice-deps-1804`. This image contains all dependencies of `py-pyprecice@develop`. | ||
|
||
The workflow `build_spack` in `.github/workflows/build-spack.yml` uses the image `precice/ci-spack-pyprecice-deps-1804` 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. | ||
|
||
## When a new spack release is necessary | ||
## When a new Spack release is necessary | ||
|
||
* Add checksum of newest version(s) to the [package recipe in `package.py`](https://github.com/precice/python-bindings/blob/develop/spack/repo/packages/py-pyprecice/package.py). You can get checksum for any released version by running `spack checksum py-pyprecice`. | ||
* Check whether the new release works locally. You can add the Spack repo in this repository and do the following: | ||
|
||
1. Add the repository to your Spack installation if you have not done that before. You can check the repositories available with your Spack installation via `spack repo list`. If there is a repository called `pyprecice.test`, check whether it points to the correct path. The correct path is the `spack/repo` directory of python-bindings repository. If the repository is missing, add it via | ||
|
||
```text | ||
spack repo add ${REPOSITORY_ROOT}/spack/repo | ||
``` | ||
2. Build the new python bindings. Usually, we use a new Spack environment. This is created and loaded via | ||
```text | ||
spack env create pyprecicetest-VERSIONNUMBER | ||
spack env activate -p pyprecicetest-VERSIONNUMBER | ||
``` | ||
Note that the dots `.` of the version number are not allowed in the name of Spack environments. One could, e.g., create an environment named `pyprecicetest-2_0_0_1` instead of `pyprecicetest-2.0.0.1`. | ||
3. We add the `py-pyprecice` package from our repository to the environment via | ||
```text | ||
spack add pyprecice.test.py-pyprecice@VERSIONNUMBER | ||
``` | ||
This ensures that one uses the local repository which has the namespace `pyprecice.test` when installing `py-precice`. Note that when speciying the `VERSIONNUMBER` you use the actual version number with dots, e.g., `2.0.0.1`, but you have to drop the `v` character from the versioning of the bindings. | ||
4. Concretize the software packages | ||
```text | ||
spack concretize -f | ||
``` | ||
and check whether everything looks good. You might want to edit the environment of the Spack environment (the `spack.yaml` file) and enforce combined concretization by adding `concretization: together` at the end of the file. You might want to double check whether the correct repository is used by calling | ||
```text | ||
spack spec -N py-pyprecice@VERSIONNUMBER | ||
``` | ||
It will print the concretization and prefixes each packages with the repository it will be installed from. | ||
5. Run `spack install` to actually install the package. | ||
6. If the installation went through, check the installation by running `python3 -c "import precice; print(precice.__version__)"`. This should print the version number of the Python bindings you have installed. *Note*: In order to make the bindings available one might have to reload the environment via | ||
```text | ||
despacktivate | ||
spack env activate -p pyprecicetest-VERSIONNUMBER | ||
``` | ||
7. Ideally one runs the solverdummy with the freshly installed Python bindings. | ||
* Add checksum of newest version(s) to https://github.com/precice/python-bindings/blob/develop/spack/repo/packages/py-pyprecice/package.py. You can get checksum for any released version by running `spack checksum py-pyprecice`. | ||
* Use `package.py` together with the patches provided in `python-bindings/spack/repo/packages/py-pyprecice` to [create a pull request for Spack](https://github.com/spack/spack/compare) and submit the new release. | ||
* After the pull request in the Spack repository is merged, merge the current package configuration into the repository of the Python bindings if necessery. |
32 changes: 0 additions & 32 deletions
32
spack/repo/packages/py-pyprecice/deactivate-version-check-via-pip.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,14 +12,17 @@ class PyPyprecice(PythonPackage): | |
C++ library preCICE. | ||
""" | ||
|
||
homepage = "https://www.precice.org" | ||
homepage = "https://precice.org" | ||
git = "https://github.com/precice/python-bindings.git" | ||
url = "https://github.com/precice/python-bindings/archive/v2.0.0.1.tar.gz" | ||
maintainers = ["ajaust", "BenjaminRodenberg"] | ||
maintainers = ["ajaust", "BenjaminRodenberg", "IshaanDesai"] | ||
|
||
# Always prefer final version of release candidate | ||
version("develop", branch="develop") | ||
version('2.2.0.1', sha256='032fa58193cfa69e3be37557977056e8f507d89b40c490a351d17271269b25ad') | ||
version('2.3.0.1', sha256='ed4e48729b662680beaa4ee2a9aff724a79e760534c6c58181be739988da2789') | ||
version('2.2.1.1', sha256='139bac5077c3807e1b7b83d8d0da5ca0fc8c17393fd0df4bc5999cd63a351b78') | ||
version('2.2.0.2', sha256='2287185f9ad7500dced53459543d27bb66bd2438c2e4bf81ee3317e6a00513d5') | ||
version('2.2.0.1', sha256='229625e2e6df03987ababce5abe2021b0974cbe5a588b936a9cba653f4908d4b') | ||
version('2.1.1.2', sha256='363eb3eeccf964fd5ee87012c1032353dd1518662868f2b51f04a6d8a7154045') | ||
version("2.1.1.1", sha256="972f574549344b6155a8dd415b6d82512e00fa154ca25ae7e36b68d4d2ed2cf4") | ||
version("2.1.0.1", sha256="ac5cb7412c6b96b08a04fa86ea38e52d91ea739a3bd1c209baa93a8275e4e01a") | ||
|
@@ -28,35 +31,26 @@ class PyPyprecice(PythonPackage): | |
version("2.0.0.2", sha256="5f055d809d65ec2e81f4d001812a250f50418de59990b47d6bcb12b88da5f5d7") | ||
version("2.0.0.1", sha256="96eafdf421ec61ad6fcf0ab1d3cf210831a815272984c470b2aea57d4d0c9e0e") | ||
|
||
# Older versions of the bindings checked versions via pip. This patch | ||
# removes the pip dependency. | ||
# See also https://github.com/spack/spack/pull/19558 | ||
patch("deactivate-version-check-via-pip.patch", when="@:2.1.1.1") | ||
|
||
depends_on("precice@develop", when="@develop") | ||
depends_on("[email protected]", when="@2.2.0.1:2.2.0.99") | ||
depends_on("[email protected]", when="@2.1.1.1:2.1.1.99") | ||
depends_on("[email protected]", when="@2.1.0.1:2.1.0.99") | ||
depends_on("[email protected]", when="@2.0.2.1:2.0.2.99") | ||
depends_on("[email protected]", when="@2.0.1.1:2.0.1.99") | ||
depends_on("[email protected]", when="@2.0.0.1:2.0.0.99") | ||
|
||
depends_on("python@3:", type=("build", "run")) | ||
depends_on("[email protected]", when="@2.3.0.1:2.3.1") | ||
depends_on("[email protected]", when="@2.2.1.1:2.2.1") | ||
depends_on("[email protected]", when="@2.2.0.1:2.2.0") | ||
depends_on("[email protected]", when="@2.1.1.1:2.1.1") | ||
depends_on("[email protected]", when="@2.1.0.1:2.1.0") | ||
depends_on("[email protected]", when="@2.0.2.1:2.0.2") | ||
depends_on("[email protected]", when="@2.0.1.1:2.0.1") | ||
depends_on("[email protected]", when="@2.0.0.1:2.0.0") | ||
|
||
depends_on("python@3:", type=("build", "link", "run")) | ||
depends_on("py-setuptools", type="build") | ||
depends_on("py-numpy", type=("build", "run")) | ||
depends_on("py-numpy", type=("build", "link", "run")) | ||
depends_on("py-mpi4py", type=("build", "run")) | ||
depends_on("[email protected]:", type=("build")) | ||
|
||
phases = ['install_lib', 'build_ext', 'install'] | ||
|
||
def build_ext_args(self, spec, prefix): | ||
return [ | ||
"--include-dirs=" + spec["precice"].headers.directories[0], | ||
"--library-dirs=" + spec["precice"].libs.directories[0] | ||
] | ||
|
||
def install(self, spec, prefix): | ||
# Older versions of the bindings had a non-standard installation routine | ||
# See also https://github.com/spack/spack/pull/19558#discussion_r513123239 | ||
if self.version <= Version("2.1.1.1"): | ||
self.setup_py("install", "--prefix={0}".format(prefix)) | ||
depends_on("[email protected]:", type="build") | ||
depends_on("py-packaging", when="@:2.1", type="build") | ||
depends_on("py-pip", when="@:2.1", type="build") | ||
|
||
@when("@:2.1") | ||
def patch(self): | ||
filter_file( | ||
"distutils.command.install", "setuptools.command.install", "setup.py" | ||
) |