From 45e8b06b13878d3b73f4ea66cd97d780743cb8b3 Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Mon, 12 Feb 2024 17:49:16 +0100 Subject: [PATCH 1/9] Update ReleaseGuide.md Add notes on docker release and point to https://github.com/precice/python-bindings/issues/195 --- docs/ReleaseGuide.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/ReleaseGuide.md b/docs/ReleaseGuide.md index 23c952fa..4c942eaa 100644 --- a/docs/ReleaseGuide.md +++ b/docs/ReleaseGuide.md @@ -27,7 +27,9 @@ The release of the `python-bindings` repository is made directly from a release 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: +7. 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 ⚠️ + +8. 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: ```bash commit 44b715dde4e3194fa69e61045089ca4ec6925fe3 (HEAD -> master, origin/master) From 6de8993bfce6cc071a6a9965b193694cd92d968e Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Mon, 12 Feb 2024 17:55:22 +0100 Subject: [PATCH 2/9] Update ReleaseGuide.md Fix numbering --- docs/ReleaseGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ReleaseGuide.md b/docs/ReleaseGuide.md index 4c942eaa..8254ff51 100644 --- a/docs/ReleaseGuide.md +++ b/docs/ReleaseGuide.md @@ -50,4 +50,4 @@ The release of the `python-bindings` repository is made directly from a release 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`). +9. Update Spack package (refer to `python-bindings/spack/README.md`). From ad3c672ff4f83e92700fbd564fd027d13cb2d454 Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Tue, 13 Feb 2024 09:47:10 +0100 Subject: [PATCH 3/9] Add user precice again to fix dockerfile. See #191. --- tools/releasing/packaging/docker/Dockerfile | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tools/releasing/packaging/docker/Dockerfile b/tools/releasing/packaging/docker/Dockerfile index 6eb6254c..ef048766 100644 --- a/tools/releasing/packaging/docker/Dockerfile +++ b/tools/releasing/packaging/docker/Dockerfile @@ -16,15 +16,15 @@ RUN apt-get -qq update && apt-get -qq install \ pkg-config && \ rm -rf /var/lib/apt/lists/* -## Needed, if base image does not create a user? See also https://github.com/precice/precice/pull/1090 -## At the moment: precice/precice:latest does not create a user, but benjaminrodenberg/precice:develop creates a user +## Needed, because precice/precice:latest does not create a user? See also https://github.com/precice/precice/pull/1090, https://github.com/precice/python-bindings/issues/191 ## ------> # Create user precice -# ARG uid=1000 -# ARG gid=1000 -# RUN groupadd -g ${gid} precice \ -# && useradd -u ${uid} -g ${gid} -m -s /bin/bash precice \ -# && sudo usermod -a -G sudo precice +ARG uid=1000 +ARG gid=1000 +RUN groupadd -g ${gid} precice \ + && useradd -u ${uid} -g ${gid} -m -s /bin/bash precice \ + && sudo usermod -a -G sudo precice +## <----- # Setup passwordless sudo RUN echo "ALL ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers @@ -36,7 +36,6 @@ ENV USER=precice # Use bash instead of default sh SHELL ["/bin/bash", "-c"] -## <----- # Upgrade pip to newest version (pip version from 18.04 apt-get is outdated) RUN python3 -m pip install --user --upgrade pip From 44c89b7ca0205dada43838d878f9857cd4bcc63e Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Fri, 16 Feb 2024 10:40:57 +0100 Subject: [PATCH 4/9] Remove user precice We assume that this user has already been created in the base image. --- tools/releasing/packaging/docker/Dockerfile | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tools/releasing/packaging/docker/Dockerfile b/tools/releasing/packaging/docker/Dockerfile index ef048766..92ce2966 100644 --- a/tools/releasing/packaging/docker/Dockerfile +++ b/tools/releasing/packaging/docker/Dockerfile @@ -16,16 +16,6 @@ RUN apt-get -qq update && apt-get -qq install \ pkg-config && \ rm -rf /var/lib/apt/lists/* -## Needed, because precice/precice:latest does not create a user? See also https://github.com/precice/precice/pull/1090, https://github.com/precice/python-bindings/issues/191 -## ------> -# Create user precice -ARG uid=1000 -ARG gid=1000 -RUN groupadd -g ${gid} precice \ - && useradd -u ${uid} -g ${gid} -m -s /bin/bash precice \ - && sudo usermod -a -G sudo precice -## <----- - # Setup passwordless sudo RUN echo "ALL ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers From 8b39adde246b630a85ace2afeb2b7f12b7dd1271 Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Fri, 16 Feb 2024 10:51:00 +0100 Subject: [PATCH 5/9] Simplify Dockerfile. --- tools/releasing/packaging/docker/Dockerfile | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tools/releasing/packaging/docker/Dockerfile b/tools/releasing/packaging/docker/Dockerfile index 92ce2966..e53c459d 100644 --- a/tools/releasing/packaging/docker/Dockerfile +++ b/tools/releasing/packaging/docker/Dockerfile @@ -16,16 +16,7 @@ RUN apt-get -qq update && apt-get -qq install \ pkg-config && \ rm -rf /var/lib/apt/lists/* -# Setup passwordless sudo -RUN echo "ALL ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers - -# Switch to the user precice USER precice -WORKDIR /home/precice -ENV USER=precice - -# Use bash instead of default sh -SHELL ["/bin/bash", "-c"] # Upgrade pip to newest version (pip version from 18.04 apt-get is outdated) RUN python3 -m pip install --user --upgrade pip From 7229cca1ed31ee8717d9c407e6166d5609f17667 Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Fri, 16 Feb 2024 17:34:18 +0100 Subject: [PATCH 6/9] Update release guide (#192) * Update release guide * Update docs/ReleaseGuide.md Co-authored-by: Benjamin Rodenberg * Update docs/ReleaseGuide.md Co-authored-by: Benjamin Rodenberg * Update docs/ReleaseGuide.md Co-authored-by: Benjamin Rodenberg * Rewording pre-release --------- Co-authored-by: Benjamin Rodenberg --- docs/ReleaseGuide.md | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/docs/ReleaseGuide.md b/docs/ReleaseGuide.md index 8254ff51..8cf10da0 100644 --- a/docs/ReleaseGuide.md +++ b/docs/ReleaseGuide.md @@ -13,23 +13,29 @@ The release of the `python-bindings` repository is made directly from a release * `CHANGELOG.md` on `python-bindings-v2.1.1.1`. * There is no need to bump the version anywhere else, since we use the [python-versioneer](https://github.com/python-versioneer/python-versioneer/) for maintaining the version everywhere else. -4. [Draft a New Release](https://github.com/precice/python-bindings/releases/new) in the `Releases` section of the repository page in a web browser. The release tag needs to be the exact version number (i.e.`v2.1.1.1` or `v2.1.1.1rc1`, compare to [existing tags](https://github.com/precice/python-bindings/tags)). Use `@target:master`. Release title is also the version number (i.e. `v2.1.1.1` or `v2.1.1.1rc1`, compare to [existing releases](https://github.com/precice/python-bindings/tags)). +4. [Draft a New Release](https://github.com/precice/python-bindings/releases/new) in the `Releases` section of the repository page in a web browser. - * *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 + * The release tag needs to be the exact version number (i.e.`v2.1.1.1` or `v2.1.1.1rc1`, compare to [existing tags](https://github.com/precice/python-bindings/tags)). + * If this is a stable release, use `@target:master`. If this is a pre-release, use `@target:python-bindings-v2.1.1.1`. If you are making a pre-release, **directly skip to the [pre-release](#pre-release) section below**. + * Release title is also the version number (i.e. `v2.1.1.1` or `v2.1.1.1rc1`, compare to [existing releases](https://github.com/precice/python-bindings/tags)). - 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). +5. As soon as one approving review is made, merge the release PR (from `python-bindings-v2.1.1.1`) into `master`. - 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). +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 ⚠️ -7. 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 ⚠️ +9. Add an empty commit (details https://github.com/precice/python-bindings/issues/109) on master by running the steps: -8. 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: + ```bash + git checkout master + git commit --allow-empty -m "post-tag bump" + git push + ``` + + Check that everything is in order via `git log`. Important: The `tag` and `origin/master` should not point to the same commit. For example: ```bash commit 44b715dde4e3194fa69e61045089ca4ec6925fe3 (HEAD -> master, origin/master) @@ -50,4 +56,8 @@ The release of the `python-bindings` repository is made directly from a release For more details refer to https://github.com/precice/python-bindings/issues/109 and https://github.com/python-versioneer/python-versioneer/issues/217. -9. Update Spack package (refer to `python-bindings/spack/README.md`). +10. *Temporarily not maintained* Update Spack package (refer to `python-bindings/spack/README.md`). + +## Pre-release + +After creating the branch and drafting a release, directly hit the "Publish release" button in your Release Draft. Please note that the release branch is not merged into the master branch during a pre-release. Merging is done only for the stable release. You can check the pre-release artifacts (e.g. release on [PyPI](https://pypi.org/project/pyprecice/#history)) of the release. No further action is required for a pre-release. From 4ec3ac3eb459a86b53ae10493a499fdcdce66a36 Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Fri, 12 Apr 2024 13:06:37 +0200 Subject: [PATCH 7/9] Change versioning scheme description in the README (#199) * Change versioning scheme description in the README * Moving old versioning scheme to the bottom of the README * Add note on why we dropped the third digit in the preCICE version --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bbbd5a54..92898c61 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Upload Python Package](https://github.com/precice/python-bindings/workflows/Upload%20Python%20Package/badge.svg?branch=master)](https://pypi.org/project/pyprecice/) -This package provides python language bindings for the C++ library [preCICE](https://github.com/precice/precice). Note that the first three digits of the version number of the bindings indicate the preCICE version that the bindings support. The last digit represents the version of the bindings. Example: `v2.0.0.1` and `v2.0.0.2` of the bindings represent versions `1` and `2` of the bindings that are compatible with preCICE `v2.0.0`. +This package provides python language bindings for the C++ library [preCICE](https://github.com/precice/precice). Note that the first two digits of the version number of the bindings indicate the major and minor version of the preCICE version that the bindings support. The last digit represents the version of the bindings. Example: `v3.1.0` and `v3.1.1` of the bindings represent versions `0` and `1` of the bindings that are compatible with preCICE `v3.1.x`. Note that this versioning scheme was introduced from bindings `v3.1.0`, which is different than the [old versioning scheme](#old-versioning-scheme). ## User documentation @@ -319,6 +319,10 @@ make sure that you are using an up-to-date version of NumPy. You can update NumP pip3 install numpy --upgrade ``` +## Old versioning scheme + +Bindings versions up to `v3.0.0.0` have four digits, where the first three digits are the supported preCICE version, and the fourth digit is the bindings version. Example: `v2.0.0.1` and `v2.0.0.2` of the bindings represent versions `1` and `2` of the bindings that are compatible with preCICE `v2.0.0`. We dropped the third digit of the preCICE version as bugfix releases are always compatible and do not impact the bindings. The new three digit format is now consistent with other preCICE bindings. + ## Contributors * [Benjamin Rodenberg](https://github.com/BenjaminRodenberg) From 4c2344f3666a2335f9c9751cb87e1c3a8e038b74 Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Fri, 12 Apr 2024 13:09:42 +0200 Subject: [PATCH 8/9] Update CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65e257ea..eb078f3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## latest + +* Change versioning scheme https://github.com/precice/python-bindings/pull/199 + ## 3.0.0.0 * Add Cython as build time dependency https://github.com/precice/python-bindings/pull/177 From 7ff249e235175be6031e1e467e4020c0b2bfc7ca Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Fri, 12 Apr 2024 13:38:11 +0200 Subject: [PATCH 9/9] Bump version --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb078f3b..221d3366 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. -## latest +## v3.1.0 * Change versioning scheme https://github.com/precice/python-bindings/pull/199