Skip to content

Commit

Permalink
Merge pull request #105 from precice/python-bindings-v2.2.1.1
Browse files Browse the repository at this point in the history
Release v2.2.1.1
  • Loading branch information
IshaanDesai authored May 27, 2021
2 parents 7eeadef + 64ffd53 commit 2039557
Show file tree
Hide file tree
Showing 11 changed files with 104 additions and 41 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,17 @@ jobs:
setup_test:
name: Run setup test
runs-on: ubuntu-latest
container: precice/ci-ubuntu-1804
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install & upgrade pip3
- name: Install & upgrade pip3 and install OpenMPI
run: |
apt-get -yy update
apt-get install -y python3-pip
rm -rf /var/lib/apt/lists/*
sudo apt-get -yy update
sudo apt-get install -y python3-pip libopenmpi-dev
sudo rm -rf /var/lib/apt/lists/*
pip3 install --upgrade --user pip
- name: Checkout precice and make required files discoverable
run: |
run: |
git clone https://github.com/precice/precice.git precice-core
mkdir -p precice
cp precice-core/src/precice/SolverInterface.hpp precice/SolverInterface.hpp
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Update docker image

on:
workflow_dispatch: # Trigger by hand from the UI
push:
branches:
- develop

jobs:
build-and-release-docker-image:
name: Builds a dockerimage with the python bindings of preCICE
runs-on: ubuntu-latest
env:
docker_username: precice
steps:
- name: Get branch name
if: github.event_name != 'pull_request'
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ env.docker_username }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Dockerfile
uses: docker/build-push-action@v2
with:
push: true
file: "./tools/releasing/packaging/docker/Dockerfile"
tags: ${{ env.docker_username }}/python-bindings:${{ env.branch }},${{ env.docker_username }}/python-bindings:latest
build-args: |
branch=${{ env.branch }}
2 changes: 2 additions & 0 deletions .github/workflows/build-spack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
push:
branches:
- "*"
schedule:
- cron: '0 4 * * 1' # Schedule it every Sunday

jobs:
build_spack:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-pep8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
id: autopep8
uses: peter-evans/autopep8@v1
with:
args: --recursive --diff --aggressive --aggressive --exit-code --ignore E402 --exclude ./spack/var/spack/repos/builtin/packages/py-pyprecice/package.py .
args: --recursive --diff --aggressive --aggressive --exit-code --ignore E402 --max-line-length 120 .
- name: Fail if autopep8 made changes
if: ${{ steps.autopep8.outputs.exit-code == 2 }}
run: echo ${{ steps.autopep8.outputs.exit-code }}
run: exit 1
25 changes: 25 additions & 0 deletions .github/workflows/run-solverdummy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Run preCICE Solverdummies
on:
push:

jobs:
run_solverdummies:
name: Run solverdummies
runs-on: ubuntu-latest
container: precice/precice
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install Dependencies
run: |
apt-get -qq update
apt-get -qq install software-properties-common python3-dev python3-pip git apt-utils
rm -rf /var/lib/apt/lists/*
- 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')"
- name: Run solverdummies
run: |
cd solverdummy/
python3 solverdummy.py precice-config.xml SolverOne MeshOne & python3 solverdummy.py precice-config.xml SolverTwo MeshTwo
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

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

## 2.2.1.1

* Remove Travis CI https://github.com/precice/python-bindings/pull/103
* Improve CI w.r.t. testing dockerimage and autopep8 formatting: https://github.com/precice/python-bindings/pull/98

## 2.2.0.2

* Improved error messgaes for all assertions. https://github.com/precice/python-bindings/pull/9
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
Python language bindings for the C++ library preCICE
----------------------------------------------------

<a style="text-decoration: none" href="https://travis-ci.com/precice/python-bindings" target="_blank">
<img src="https://travis-ci.com/precice/python-bindings.svg?branch=develop" alt="Build status">
</a>

[![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`.
Expand Down
2 changes: 2 additions & 0 deletions cyprecice/cyprecice.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ cdef class Interface:
Rank of the process
solver_process_size : int
Size of the process
communicator: mpi4py.MPI.Intracomm, optional
Custom MPI communicator to use
Returns
-------
Expand Down
2 changes: 1 addition & 1 deletion spack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The Spack package `py-pyprecice` provides the python bindings via Spack and was

## Docker image `precice/ci-spack-pyprecice-deps-1804`

The workflow `build_env` in `.github/workflows/build-spack.yml` creates the image `precice/ci-spack-pyprecice-deps-1804`. This image contains all dependencies of `py-pyprecice@develop`.
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.

Expand Down
26 changes: 26 additions & 0 deletions tools/releasing/packaging/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Dockerfile to build a ubuntu image containing the installed Debian package of a release
ARG branch=develop
ARG from=precice/precice:${branch}
FROM $from

USER root
# Installing necessary dependencies
RUN apt-get -qq update && apt-get -qq install \
apt-utils && \
apt-get -qq install \
software-properties-common \
python3-dev \
python3-pip && \
rm -rf /var/lib/apt/lists/*

USER precice

# Upgrade pip to newest version (pip version from 18.04 apt-get is outdated)
RUN python3 -m pip install --user --upgrade pip

# Rebuild image if force_rebuild after that command
ARG CACHEBUST
ARG branch=develop

# Builds the precice python bindings for python3
RUN pip3 install --user git+https://github.com/precice/python-bindings.git@$branch

0 comments on commit 2039557

Please sign in to comment.