Skip to content

Commit

Permalink
Merge pull request #190 from precice/python-bindings-v3.0.0.0
Browse files Browse the repository at this point in the history
Release v3.0.0.0
  • Loading branch information
IshaanDesai authored Feb 5, 2024
2 parents 51cf4fb + d73996c commit c0288c8
Show file tree
Hide file tree
Showing 24 changed files with 1,385 additions and 2,123 deletions.
29 changes: 18 additions & 11 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
needs: [setup_test]
runs-on: ubuntu-latest
container:
image: precice/precice:latest
image: precice/precice:develop
options: --user root
steps:
- name: Checkout Repository
Expand All @@ -37,7 +37,7 @@ jobs:
name: Run setup install
runs-on: ubuntu-latest
container:
image: precice/precice:latest
image: precice/precice:develop
options: --user root
steps:
- name: Checkout Repository
Expand All @@ -55,20 +55,23 @@ jobs:
- name: Run setup install
run: python3 setup.py install --user
- name: Test install
run: python3 -c "import precice"
run: |
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:latest
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/*
Expand Down Expand Up @@ -97,12 +100,14 @@ jobs:
packages: toml
- name: Checkout precice and make required files discoverable
run: |
git clone -b v2.5.0 https://github.com/precice/precice.git precice-core
git clone --branch develop https://github.com/precice/precice.git precice-core
mkdir -p precice
cp precice-core/src/precice/SolverInterface.hpp precice/SolverInterface.hpp
cp precice-core/src/precice/Participant.hpp precice/Participant.hpp
cp precice-core/src/precice/Tooling.hpp precice/Tooling.hpp
cp precice-core/src/precice/Tooling.hpp precice/Tooling.cpp
cd precice-core
mkdir build && cd build
cmake .. -DPRECICE_MPICommunication=OFF -DPRECICE_PETScMapping=OFF -DPRECICE_PythonActions=OFF -DBUILD_TESTING=OFF
cmake .. -DPRECICE_FEATURE_MPI_COMMUNICATION=OFF -DPRECICE_FEATURE_PETSC_MAPPING=OFF -DPRECICE_FEATURE_PYTHON_ACTIONS=OFF -DBUILD_TESTING=OFF
- name: Install dependencies
run: |
python3 -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | pip3 install -r /dev/stdin
Expand All @@ -119,7 +124,7 @@ jobs:
needs: [setup_test]
runs-on: ubuntu-latest
container:
image: precice/precice:latest
image: precice/precice:develop
options: --user root
steps:
- name: Checkout Repository
Expand All @@ -133,14 +138,16 @@ jobs:
- name: Run pip install
run: pip3 install --user .
- name: Run pip install
run: python3 -c "import precice"
run: |
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
python3 -c "import precice"
solverdummy_test:
name: Run solverdummy
needs: [setup_install, setup_test]
runs-on: ubuntu-latest
container:
image: precice/precice:latest
image: precice/precice:develop
options: --user root
steps:
- name: Checkout Repository
Expand All @@ -155,6 +162,6 @@ jobs:
run: pip3 install --user .
- name: Run solverdummy
run: |
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
cd examples/solverdummy/
python3 solverdummy.py precice-config.xml SolverOne MeshOne & python3 solverdummy.py precice-config.xml SolverTwo MeshTwo
38 changes: 32 additions & 6 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
name: Update docker image

on:
workflow_dispatch: # Trigger by hand from the UI
workflow_dispatch: # Trigger by hand from the UI
inputs:
branch:
type: choice
description: branch to build the image from
options:
- develop
- master
push:
branches:
- develop
- master


jobs:
build-and-release-docker-image:
Expand All @@ -13,10 +22,26 @@ jobs:
env:
docker_username: precice
steps:
- name: Get branch name
if: github.event_name != 'pull_request'
- name: Set branch name for manual triggering
if: github.event_name == 'workflow_dispatch'
shell: bash
run: echo "BINDINGS_REF=${{ inputs.branch }}" >> $GITHUB_ENV
- name: Set branch name for "on pull request" triggering
if: github.event_name != 'pull_request' && github.event_name != 'workflow_dispatch'
shell: bash
run: echo "BINDINGS_REF=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Set PRECICE_TAG and the TAG depending on branch
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
run: |
if [[ '${{ env.BINDINGS_REF }}' == 'master' ]]; then
echo "PRECICE_TAG=latest" >> "$GITHUB_ENV"
echo "TAG=latest" >> "$GITHUB_ENV"
echo "Building TAG: latest"
else
echo "PRECICE_TAG=${{ env.BINDINGS_REF }}" >> "$GITHUB_ENV"
echo "TAG=${{ env.BINDINGS_REF }}" >> "$GITHUB_ENV"
echo "Building TAG: ${{ env.BINDINGS_REF }}"
fi
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
Expand All @@ -31,6 +56,7 @@ jobs:
with:
push: true
file: "./tools/releasing/packaging/docker/Dockerfile"
tags: ${{ env.docker_username }}/python-bindings:${{ env.branch }},${{ env.docker_username }}/python-bindings:latest
tags: ${{ env.docker_username }}/python-bindings:${{ env.TAG }}
build-args: |
branch=${{ env.branch }}
PRECICE_TAG=${{ env.PRECICE_TAG }}
PYTHON_BINDINGS_REF=${{ env.BINDINGS_REF }}
14 changes: 14 additions & 0 deletions .github/workflows/check-markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Lint docs
on: [push, pull_request]
jobs:
check_md:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Lint markdown files (markdownlint)
uses: articulate/actions-markdownlint@v1
with:
config: .markdownlint.json
files: '.'
ignore: changelog-entries
4 changes: 2 additions & 2 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
pkgconfig
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist
twine upload dist/*
4 changes: 2 additions & 2 deletions .github/workflows/run-solverdummy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Run solverdummies
runs-on: ubuntu-latest
container:
image: precice/precice:latest
image: precice/precice:develop
options: --user root
steps:
- name: Checkout Repository
Expand All @@ -25,7 +25,7 @@ jobs:
- name: Install bindings
run: pip3 install --user .
- name: Check whether preCICE was built with MPI # reformat version information as a dict and check whether preCICE was compiled with MPI
run: python3 -c "import precice; assert({item.split('=')[0]:item.split('=')[-1] for item in str(precice.get_version_information()).split(';')}['PRECICE_MPICommunication']=='Y')"
run: python3 -c "import precice; assert({item.split('=')[0]:item.split('=')[-1] for item in str(precice.get_version_information()).split(';')}['PRECICE_FEATURE_MPI_COMMUNICATION']=='Y')"
- name: Run solverdummies
run: |
cd examples/solverdummy/
Expand Down
7 changes: 7 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"MD013": false,
"MD014": false,
"MD024": false,
"MD034": false,
"MD033": false
}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

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

## 3.0.0.0

* Add Cython as build time dependency https://github.com/precice/python-bindings/pull/177
* Update CMake configuration flags for preCICE source installation in Actions. https://github.com/precice/python-bindings/commit/23a840144c2647d6cf09c0ed87be3b768a22feb7
* Remove API functions `has_mesh` and `has_data` and rename `get_mesh_vertices_and_ids` to `get_mesh_vertices_and_coordinates`. https://github.com/precice/python-bindings/commit/cd446d2807b841d81a4cf5c9dd6656ab43c278c3
* Update API according to preCICE v3.0.0 https://github.com/precice/python-bindings/pull/179

## 2.5.0.4

* Add `tag_prefix = v` in versioneer configuration of `setup.cfg`.
Expand Down
Loading

0 comments on commit c0288c8

Please sign in to comment.