From b48078a7e537ac5d1a41dedb486e012661938950 Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Tue, 19 Oct 2021 13:00:16 +0200 Subject: [PATCH 01/11] Fix link. --- docs/ReleaseGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ReleaseGuide.md b/docs/ReleaseGuide.md index 18dcbe35..c14d4f16 100644 --- a/docs/ReleaseGuide.md +++ b/docs/ReleaseGuide.md @@ -23,6 +23,6 @@ The release of the `python-bindings` repository is made directly from a release 6. 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]. +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). 8. Update Spack package (refer to `python-bindings/spack/README.md`). From e65396e0baf18e9f6decd1fc77862efbbd86f119 Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Tue, 19 Oct 2021 13:06:25 +0200 Subject: [PATCH 02/11] Point to auto-generation feature. --- docs/ReleaseGuide.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/ReleaseGuide.md b/docs/ReleaseGuide.md index c14d4f16..56c04f43 100644 --- a/docs/ReleaseGuide.md +++ b/docs/ReleaseGuide.md @@ -16,6 +16,7 @@ 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). From d65d39b60f0d4c30058df07f3d52b16345062d87 Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Wed, 20 Oct 2021 13:13:29 +0200 Subject: [PATCH 03/11] Add note on keeping the hash constant. See #109. --- docs/ReleaseGuide.md | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/docs/ReleaseGuide.md b/docs/ReleaseGuide.md index 56c04f43..e0c0be86 100644 --- a/docs/ReleaseGuide.md +++ b/docs/ReleaseGuide.md @@ -22,8 +22,29 @@ The release of the `python-bindings` repository is made directly from a release 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 +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 +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`). From dadad118702f56bf760d1cc4da277b3c7900f64d Mon Sep 17 00:00:00 2001 From: Alexander Jaust Date: Thu, 21 Oct 2021 16:57:41 +0200 Subject: [PATCH 04/11] Update Spack recipe (v2.3.0.1, release documentation, sync packages) (#133) * [update] Bump the package to the current version included in Spack * [doc] Explain the release cycle of spack packages better * [new version] add v2.3.0.1 to Spack recipe * [ci][fix] update CI workflow for testing the bindings * [ci] print binding version at end of workflow --- .github/workflows/build-spack.yml | 2 +- spack/README.md | 35 ++++++++++- .../deactivate-version-check-via-pip.patch | 32 ---------- spack/repo/packages/py-pyprecice/package.py | 58 +++++++++---------- 4 files changed, 61 insertions(+), 66 deletions(-) delete mode 100644 spack/repo/packages/py-pyprecice/deactivate-version-check-via-pip.patch diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index efa592d3..223abeb3 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -26,4 +26,4 @@ jobs: cp -r spack/repo/packages/py-pyprecice/ /py-pyprecice-repo/packages/ - name: Try to build py-pyprecice with spack and test it run: | - . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack arch && spack find && spack dev-build pyprecice.test.py-pyprecice@develop target=x86_64 && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && mkdir runner && cd runner && python3 -c "import precice; print(precice.__version__)" + . /opt/spack/share/spack/setup-env.sh && spack env activate ci && spack arch && spack find && spack dev-build pyprecice.test.py-pyprecice@develop target=x86_64 && spack load precice py-numpy py-mpi4py py-cython openssh openmpi && export PYTHONPATH=${PWD}/build/$(ls build | grep lib.):${PYTHONPATH} && mkdir runner && cd runner && BINDINGS_VERSION=$(python3 -c "import precice; print(precice.__version__)") && echo "Installed version of bindings is ${BINDINGS_VERSION}" diff --git a/spack/README.md b/spack/README.md index a8293a6d..120213ea 100644 --- a/spack/README.md +++ b/spack/README.md @@ -8,7 +8,40 @@ The workflow `build-spack-pyprecice-deps` in `.github/workflows/build-env.yml` c 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 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 + ```bash + 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 + ``` + spack env create pyprecicetest-VERSIONNUMBER + spack env activate -p pyprecicetest-VERSIONNUMBER + spack + ``` + Note that the dots `.` in the version number must be replaced by underscores or similar. + 3. We add the `py-pyprecice` package from our repository to the environment via + ``` + 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`. + 4. Concretize the software packages + ``` + 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 + ``` + 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 ``` + despacktivate + spack env activate -p pyprecicetest-VERSIONNUMBER + ``` + 7. Ideally one runs the solverdummy with the freshly installed Python bindings. * 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. \ No newline at end of file diff --git a/spack/repo/packages/py-pyprecice/deactivate-version-check-via-pip.patch b/spack/repo/packages/py-pyprecice/deactivate-version-check-via-pip.patch deleted file mode 100644 index e7b13aa6..00000000 --- a/spack/repo/packages/py-pyprecice/deactivate-version-check-via-pip.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/setup.py b/setup.py -index 9282639..d69c285 100644 ---- a/setup.py -+++ b/setup.py -@@ -1,15 +1,20 @@ - import os - import subprocess - import warnings --from packaging import version --import pip -+from setuptools._vendor.packaging import version -+ -+# If installed with pip we need to check its version -+try: -+ import pip -+ if version.parse(pip.__version__) < version.parse("19.0"): -+ # version 19.0 is required, since we are using pyproject.toml for definition of build-time depdendencies. See https://pip.pypa.io/en/stable/news/#id209 -+ warnings.warn("You are using pip version {}. However, pip version > 19.0 is recommended. You can continue with the installation, but installation problems can occour. Please refer to https://github.com/precice/python-bindings#build-time-dependencies-cython-numpy-defined-in-pyprojecttoml-are-not-installed-automatically for help.".format(pip.__version__)) - --if version.parse(pip.__version__) < version.parse("19.0"): -- # version 19.0 is required, since we are using pyproject.toml for definition of build-time depdendencies. See https://pip.pypa.io/en/stable/news/#id209 -- warnings.warn("You are using pip version {}. However, pip version > 19.0 is recommended. You can continue with the installation, but installation problems can occour. Please refer to https://github.com/precice/python-bindings#build-time-dependencies-cython-numpy-defined-in-pyprojecttoml-are-not-installed-automatically for help.".format(pip.__version__)) -+ if version.parse(pip.__version__) < version.parse("10.0.1"): -+ warnings.warn("You are using pip version {}. However, pip version > 10.0.1 is required. If you continue with installation it is likely that you will face an error. See https://github.com/precice/python-bindings#version-of-pip3-is-too-old".format(pip.__version__)) -+except: -+ warnings.warn("Assuming that you are not using pip!") - --if version.parse(pip.__version__) < version.parse("10.0.1"): -- warnings.warn("You are using pip version {}. However, pip version > 10.0.1 is required. If you continue with installation it is likely that you will face an error. See https://github.com/precice/python-bindings#version-of-pip3-is-too-old".format(pip.__version__)) - - from enum import Enum - from setuptools import setup diff --git a/spack/repo/packages/py-pyprecice/package.py b/spack/repo/packages/py-pyprecice/package.py index 65817306..96825b07 100644 --- a/spack/repo/packages/py-pyprecice/package.py +++ b/spack/repo/packages/py-pyprecice/package.py @@ -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("precice@2.2.0", when="@2.2.0.1:2.2.0.99") - depends_on("precice@2.1.1", when="@2.1.1.1:2.1.1.99") - depends_on("precice@2.1.0", when="@2.1.0.1:2.1.0.99") - depends_on("precice@2.0.2", when="@2.0.2.1:2.0.2.99") - depends_on("precice@2.0.1", when="@2.0.1.1:2.0.1.99") - depends_on("precice@2.0.0", when="@2.0.0.1:2.0.0.99") - - depends_on("python@3:", type=("build", "run")) + depends_on("precice@2.3.0", when="@2.3.0.1:2.3.1") + depends_on("precice@2.2.1", when="@2.2.1.1:2.2.1") + depends_on("precice@2.2.0", when="@2.2.0.1:2.2.0") + depends_on("precice@2.1.1", when="@2.1.1.1:2.1.1") + depends_on("precice@2.1.0", when="@2.1.0.1:2.1.0") + depends_on("precice@2.0.2", when="@2.0.2.1:2.0.2") + depends_on("precice@2.0.1", when="@2.0.1.1:2.0.1") + depends_on("precice@2.0.0", 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("py-cython@0.29:", 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("py-cython@0.29:", 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" + ) From 4f3df8526f64fc25072d4e06746ca82ab4ab7f19 Mon Sep 17 00:00:00 2001 From: Benjamin Rodenberg Date: Mon, 21 Feb 2022 09:27:58 +0100 Subject: [PATCH 05/11] Add warning to avoid new contributions to this README We maintain our documentation on precice.org. Users should refer to the documentation on precice.org. New contributions should also go to precice.org. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index aa770c0d..bfaa308d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +⚠️ The latest version of the documentation for the python bindings can be found on [precice.org](https://precice.org/installation-bindings-python.html). The information from this `README` is currently under revision and will be moved ⚠️ + Python language bindings for the C++ library preCICE ---------------------------------------------------- From 8eee60710b786f9ae0bd6aeb5abc02b90c9f58e9 Mon Sep 17 00:00:00 2001 From: Alexander Jaust Date: Tue, 12 Apr 2022 17:11:34 +0200 Subject: [PATCH 06/11] Add C++ compiler as dependency (#140) Mention a C++ compiler as dependency for building the bindings. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index bfaa308d..bf626411 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ Please refer to [the preCICE documentation](https://www.precice.org/installation **preCICE**: Refer to [the preCICE documentation](https://precice.org/installation-overview.html) for information on building and installation. +**C++**: A working C++ compilers, e.g., `g++`. + **MPI**: `mpi4py` requires MPI to be installed on your system. # Installing the package From cd13eccb75847f0247dc8c6ecb9b8aeef86398ce Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Tue, 3 May 2022 08:49:36 +0200 Subject: [PATCH 07/11] Moving solverdummy into examples folder (#141) * Moving solverdummy into examples/ folder * Insert correct path of solverdummy in build-and-test workflow --- .github/workflows/build-and-test.yml | 4 +++- .github/workflows/run-solverdummy.yml | 2 +- {solverdummy => examples/solverdummy}/.gitignore | 0 {solverdummy => examples/solverdummy}/README.md | 0 {solverdummy => examples/solverdummy}/precice-config.xml | 0 {solverdummy => examples/solverdummy}/requirements.txt | 0 {solverdummy => examples/solverdummy}/solverdummy.py | 0 7 files changed, 4 insertions(+), 2 deletions(-) rename {solverdummy => examples/solverdummy}/.gitignore (100%) rename {solverdummy => examples/solverdummy}/README.md (100%) rename {solverdummy => examples/solverdummy}/precice-config.xml (100%) rename {solverdummy => examples/solverdummy}/requirements.txt (100%) rename {solverdummy => examples/solverdummy}/solverdummy.py (100%) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index dc4ea89b..3cea6437 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -136,5 +136,7 @@ jobs: - name: Run pip install run: pip3 install --user . - name: Run solverdummy - run: python3 solverdummy/solverdummy.py solverdummy/precice-config.xml SolverOne MeshOne & python3 solverdummy/solverdummy.py solverdummy/precice-config.xml SolverTwo MeshTwo + run: | + cd examples/solverdummy/ + python3 solverdummy.py precice-config.xml SolverOne MeshOne & python3 solverdummy.py precice-config.xml SolverTwo MeshTwo diff --git a/.github/workflows/run-solverdummy.yml b/.github/workflows/run-solverdummy.yml index 5a094ba5..60e83cf6 100644 --- a/.github/workflows/run-solverdummy.yml +++ b/.github/workflows/run-solverdummy.yml @@ -25,5 +25,5 @@ jobs: run: python3 -c "import precice; assert({item.split('=')[0]:item.split('=')[-1] for item in str(precice.get_version_information()).split(';')}['PRECICE_MPICommunication']=='Y')" - name: Run solverdummies run: | - cd solverdummy/ + cd examples/solverdummy/ python3 solverdummy.py precice-config.xml SolverOne MeshOne & python3 solverdummy.py precice-config.xml SolverTwo MeshTwo diff --git a/solverdummy/.gitignore b/examples/solverdummy/.gitignore similarity index 100% rename from solverdummy/.gitignore rename to examples/solverdummy/.gitignore diff --git a/solverdummy/README.md b/examples/solverdummy/README.md similarity index 100% rename from solverdummy/README.md rename to examples/solverdummy/README.md diff --git a/solverdummy/precice-config.xml b/examples/solverdummy/precice-config.xml similarity index 100% rename from solverdummy/precice-config.xml rename to examples/solverdummy/precice-config.xml diff --git a/solverdummy/requirements.txt b/examples/solverdummy/requirements.txt similarity index 100% rename from solverdummy/requirements.txt rename to examples/solverdummy/requirements.txt diff --git a/solverdummy/solverdummy.py b/examples/solverdummy/solverdummy.py similarity index 100% rename from solverdummy/solverdummy.py rename to examples/solverdummy/solverdummy.py From 3fdc85668768c1440e29cecbb68661b87b99403b Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Sun, 22 May 2022 11:53:20 +0200 Subject: [PATCH 08/11] Remove mesh name from solverdummy input arguments (#142) --- examples/solverdummy/README.md | 4 ++-- examples/solverdummy/solverdummy.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/solverdummy/README.md b/examples/solverdummy/README.md index e5c6cca8..db565ada 100644 --- a/examples/solverdummy/README.md +++ b/examples/solverdummy/README.md @@ -7,8 +7,8 @@ # Run You can test the dummy solver by coupling two instances with each other. Open two terminals and run - * `python3 solverdummy.py precice-config.xml SolverOne MeshOne` - * `python3 solverdummy.py precice-config.xml SolverTwo MeshTwo` + * `python3 solverdummy.py precice-config.xml SolverOne` + * `python3 solverdummy.py precice-config.xml SolverTwo` # Next Steps diff --git a/examples/solverdummy/solverdummy.py b/examples/solverdummy/solverdummy.py index b3bd0422..887f3eb5 100644 --- a/examples/solverdummy/solverdummy.py +++ b/examples/solverdummy/solverdummy.py @@ -8,26 +8,26 @@ parser.add_argument("configurationFileName", help="Name of the xml config file.", type=str) parser.add_argument("participantName", help="Name of the solver.", type=str) -parser.add_argument("meshName", help="Name of the mesh.", type=str) try: args = parser.parse_args() except SystemExit: print("") - print("Usage: python ./solverdummy precice-config participant-name mesh-name") + print("Usage: python ./solverdummy precice-config participant-name") quit() configuration_file_name = args.configurationFileName participant_name = args.participantName -mesh_name = args.meshName if participant_name == 'SolverOne': write_data_name = 'dataOne' read_data_name = 'dataTwo' + mesh_name = 'MeshOne' if participant_name == 'SolverTwo': read_data_name = 'dataOne' write_data_name = 'dataTwo' + mesh_name = 'MeshTwo' num_vertices = 3 # Number of vertices From 9ad88de59215499d6084aac4f66a042a8f8ca201 Mon Sep 17 00:00:00 2001 From: Alexander Jaust Date: Mon, 23 May 2022 11:24:10 +0200 Subject: [PATCH 09/11] Fix formatting of Spack documentation and make documentation clearer (#143) * Fix formatting of Spack documentation * Fix indentation of sublist entries * fix unclear formulations and code environment languages --- spack/README.md | 72 ++++++++++++++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 27 deletions(-) diff --git a/spack/README.md b/spack/README.md index 120213ea..ee31a2b3 100644 --- a/spack/README.md +++ b/spack/README.md @@ -1,6 +1,6 @@ # 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` @@ -10,38 +10,56 @@ The workflow `build_spack` in `.github/workflows/build-spack.yml` uses the image ## When a new Spack release is necessary -* 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`. +* 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 - ```bash - spack repo add ${REPOSITORY_ROOT}/spack/repo - ``` + + ```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 - ``` - spack env create pyprecicetest-VERSIONNUMBER - spack env activate -p pyprecicetest-VERSIONNUMBER - spack - ``` - Note that the dots `.` in the version number must be replaced by underscores or similar. + + ```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 - ``` - 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`. + + ```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 - ``` - 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 - ``` - spack spec -N py-pyprecice@VERSIONNUMBER - ``` - It will print the concretization and prefixes each packages with the repository it will be installed from. + + ```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 ``` - despacktivate - spack env activate -p pyprecicetest-VERSIONNUMBER - ``` + + 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. + * 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. \ No newline at end of file From 1c50a3844db16733322a8309ac825a01710a02c0 Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Sun, 22 May 2022 17:16:56 +0200 Subject: [PATCH 10/11] Bump version and add changelog entry --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 206b5b9b..70f12a99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. ## latest +## 2.4.0.0 + +* Move solverdummy into examples/ folder and remove MeshName from its input arguments. https://github.com/precice/python-bindings/pull/141 and https://github.com/precice/python-bindings/pull/142 + ## 2.3.0.1 * Improve CI w.r.t spack package. https://github.com/precice/python-bindings/pull/117 From 0e3020bba6a4769b1f39c7f1f29f903f503c47ae Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Tue, 24 May 2022 14:24:54 +0200 Subject: [PATCH 11/11] Minor corrections in README and CHANGELOG --- CHANGELOG.md | 3 ++- README.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70f12a99..b4b5aed7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ All notable changes to this project will be documented in this file. ## 2.4.0.0 -* Move solverdummy into examples/ folder and remove MeshName from its input arguments. https://github.com/precice/python-bindings/pull/141 and https://github.com/precice/python-bindings/pull/142 +* Move solverdummy into examples/ folder and remove MeshName from its input arguments. https://github.com/precice/python-bindings/pull/141 +* Remove MeshName from input arguments of solverdummy. https://github.com/precice/python-bindings/pull/142 ## 2.3.0.1 diff --git a/README.md b/README.md index bf626411..f07343dc 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Please refer to [the preCICE documentation](https://www.precice.org/installation **preCICE**: Refer to [the preCICE documentation](https://precice.org/installation-overview.html) for information on building and installation. -**C++**: A working C++ compilers, e.g., `g++`. +**C++**: A working C++ compiler, e.g., `g++`. **MPI**: `mpi4py` requires MPI to be installed on your system.