diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 3e6a4f51..f5073a07 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -8,31 +8,6 @@ on: - "*" jobs: - setup_for_spack: - name: Run setup.py phases needed by spack - needs: [setup_test] - runs-on: ubuntu-latest - container: - image: precice/precice:develop - options: --user root - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - name: Install & upgrade pip3 - run: | - apt-get -yy update - apt-get install -y python3-pip pkg-config - rm -rf /var/lib/apt/lists/* - pip3 install --upgrade --user pip - - name: Install dependencies - run: | - pip3 install --user toml - python3 -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | pip3 install -r /dev/stdin - - name: Run setup.py phases needed by spack - run: | - python3 setup.py install_lib - python3 setup.py build_ext - setup_install: name: Run setup install runs-on: ubuntu-latest @@ -59,30 +34,6 @@ jobs: export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH python3 -c "import precice" - setup_install_single_version_externally_managed: - name: Run setup install --single-version-externally-managed (for spack) - needs: [setup_install] - runs-on: ubuntu-latest - container: - image: precice/precice:develop - options: --user root - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - name: Install pip3, pkgconfig and upgrade pip3 - run: | - su root - apt-get -yy update - apt-get install -y python3-pip pkg-config - rm -rf /var/lib/apt/lists/* - pip3 install --upgrade --user pip - - name: Install dependencies - run: | - pip3 install --user toml - python3 -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | pip3 install -r /dev/stdin - - name: Run setup install --single-version-externally-managed - run: python3 setup.py install --single-version-externally-managed --root=/ - setup_test: name: Run setup test runs-on: ubuntu-latest @@ -144,7 +95,7 @@ jobs: solverdummy_test: name: Run solverdummy - needs: [setup_install, setup_test] + needs: [pip_install] runs-on: ubuntu-latest container: image: precice/precice:develop diff --git a/.github/workflows/build-env.yml b/.github/workflows/build-env.yml deleted file mode 100644 index cf44d754..00000000 --- a/.github/workflows/build-env.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Update build environment - -on: - workflow_dispatch: # Trigger by hand from the UI - schedule: - - cron: '0 0 * * 0' # Schedule it every Sunday - -jobs: - build-spack-pyprecice-deps: - name: Builds the baseimage for spack providing dependencies - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - name: Set up Docker - uses: docker/setup-buildx-action@v1 - - name: Login to registry - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v2 - with: - push: true - context: . - file: spack/ci-spack-pyprecice-deps-2404.dockerfile - tags: precice/ci-spack-pyprecice-deps-2404 diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml deleted file mode 100644 index 8ff0b6cb..00000000 --- a/.github/workflows/build-spack.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Build Spack -on: - push: - branches: - - "*" - pull_request: - branches: - - "*" - schedule: - - cron: '0 4 * * 1' # Schedule it every Sunday - -jobs: - build_spack: - name: build_spack - runs-on: ubuntu-latest - timeout-minutes: 15 - container: precice/ci-spack-pyprecice-deps-2404 - defaults: - run: - shell: "bash --login -eo pipefail {0}" - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - name: Move Package Script - run: | - cp -r spack/repo/packages/py-pyprecice/ /py-pyprecice-repo/packages/ - - name: Try to build py-pyprecice@develop with spack and test it - run: | - . /opt/spack/share/spack/setup-env.sh - spack env activate ci && spack arch - spack remove py-pyprecice - spack add pyprecice.test.py-pyprecice@develop && spack develop pyprecice.test.py-pyprecice@develop - spack install && spack find - spack load py-pyprecice - BINDINGS_VERSION=$(python3 -c "import precice; print(precice.__version__)") && echo "Installed version of bindings is ${BINDINGS_VERSION}" \ No newline at end of file diff --git a/changelog-entries/221.md b/changelog-entries/221.md new file mode 100644 index 00000000..9475acc6 --- /dev/null +++ b/changelog-entries/221.md @@ -0,0 +1 @@ +* Removed testing of spack package diff --git a/docs/ReleaseGuide.md b/docs/ReleaseGuide.md index 5e9aa226..6f509a77 100644 --- a/docs/ReleaseGuide.md +++ b/docs/ReleaseGuide.md @@ -13,21 +13,23 @@ 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. +4. *Optional* test the [py-pyprecice Spack package](https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/py-pyprecice/package.py) using `spack dev-build py-pyprecice@develop`. + +5. [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)). * 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)). -5. As soon as one approving review is made, merge the release PR (from `python-bindings-v2.1.1.1`) into `master`. +6. 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`. +7. 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). +8. 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/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 ⚠️ +9. 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 ⚠️ -9. Add an empty commit (details https://github.com/precice/python-bindings/issues/109) on master by running the steps: +10. Add an empty commit (details https://github.com/precice/python-bindings/issues/109) on master by running the steps: ```bash git checkout master @@ -56,7 +58,7 @@ 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. -10. *Temporarily not maintained* Update Spack package (refer to `python-bindings/spack/README.md`). +11. *Temporarily not maintained* Update the [py-pyprecice Spack package](https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/py-pyprecice/package.py). ## Pre-release diff --git a/spack/README.md b/spack/README.md deleted file mode 100644 index a8f92f4c..00000000 --- a/spack/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# Spack package: py-pyprecice - -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-2404` - -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`. - -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. - -## 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. - -* 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. diff --git a/spack/ci-spack-pyprecice-deps-2404.dockerfile b/spack/ci-spack-pyprecice-deps-2404.dockerfile deleted file mode 100644 index 13051242..00000000 --- a/spack/ci-spack-pyprecice-deps-2404.dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# Build stage with Spack pre-installed and ready to be used -FROM spack/ubuntu-noble:latest - -# Mount the current sources into the build container -# and build the default environment -ADD ./spack/repo /py-pyprecice-repo -RUN spack --color=always env create --without-view ci && \ - spack --color=always -e ci repo add /py-pyprecice-repo && \ - spack --color=always -e ci add pyprecice.test.py-pyprecice@develop target=x86_64 && \ - spack --color=always -e ci install --fail-fast --only=dependencies && \ - spack --color=always clean -a diff --git a/spack/repo/packages/py-pyprecice/package.py b/spack/repo/packages/py-pyprecice/package.py deleted file mode 100644 index 7ee79d6e..00000000 --- a/spack/repo/packages/py-pyprecice/package.py +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack.package import * - - -class PyPyprecice(PythonPackage): - """ - This package provides python language bindings for the - C++ library preCICE. - """ - - homepage = "https://precice.org" - git = "https://github.com/precice/python-bindings.git" - url = "https://github.com/precice/python-bindings/archive/v3.1.1.tar.gz" - maintainers("ajaust", "BenjaminRodenberg", "IshaanDesai") - - # Always prefer final version of release candidate - version("develop", branch="develop") - version("3.1.1", sha256="50a0f1cbdb8fc362c22d316151c0e757958ff136a094e63b9b82d045d01d19c7") - version("3.1.0", sha256="8d9bd9e28859001ab503a1e2f90e54b3c000079f04c14dc7c0c04c61c5666641") - version("3.0.0.0", sha256="7e2c4b106a231b0df2a430d86d4a7b295f85adbe3478c425f863d1a4bebee9f7") - version("2.5.0.4", sha256="7f9449573eb52ce48ca3f0ab35529ea0064942487842515ae0a2c9299aa0f0db") - version("2.5.0.3", sha256="b983229b9fdf6bd4605ae8710985eb681025f6fb28ad8d7736cdf92593eef6df") - version("2.5.0.2", sha256="6d7b78da830db6c5133b44617196ee90be8c7d6c8e14c8994a4800b3d4856416") - version("2.5.0.1", sha256="d7c666e6ebff9e007c3703d8e3c3fcdf0f45289e36c2c17223b3aedc3259ab6c") - version("2.5.0.0", sha256="9f55a22594bb602cde8a5987217728569f16d9576ea53ed00497e9046a2e1794") - version("2.4.0.0", sha256="e80d16417b8ce1fdac80c988cb18ae1e16f785c5eb1035934d8b37ac18945242") - 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") - version("2.0.2.1", sha256="c6fca26332316de041f559aecbf23122a85d6348baa5d3252be4ddcd5e94c09a") - version("2.0.1.1", sha256="2791e7c7e2b04bc918f09f3dfca2d3371e6f8cbb7e57c82bd674703f4fa00be7") - version("2.0.0.2", sha256="5f055d809d65ec2e81f4d001812a250f50418de59990b47d6bcb12b88da5f5d7") - version("2.0.0.1", sha256="96eafdf421ec61ad6fcf0ab1d3cf210831a815272984c470b2aea57d4d0c9e0e") - - for ver in [ - "develop", - "3.1", # only consider major.minor from 3.1.0. See https://github.com/precice/python-bindings/pull/199 - "3.0.0", - "2.5.0", - "2.4.0", - "2.3.0", - "2.2.1", - "2.2.0", - "2.1.1", - "2.1.0", - "2.0.2", - "2.0.1", - "2.0.0", - ]: - depends_on("precice@" + ver, when="@" + ver) - - depends_on("python@3:", type=("build", "link", "run")) - depends_on("py-setuptools@61:71", type="build") - depends_on("py-numpy@:1", type=("build", "link", "run")) - depends_on("py-mpi4py", type=("build", "run")) - depends_on("py-cython@0.29:", type="build") - depends_on("py-packaging", type="build") - depends_on("py-pip@19.0.0:", type="build") - depends_on("py-pkgconfig", type="build", when="@2.5:") - - @when("@:2.1") - def patch(self): - filter_file("distutils.command.install", "setuptools.command.install", "setup.py") diff --git a/spack/repo/repo.yaml b/spack/repo/repo.yaml deleted file mode 100644 index e484875a..00000000 --- a/spack/repo/repo.yaml +++ /dev/null @@ -1,2 +0,0 @@ -repo: - namespace: 'pyprecice.test'