Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 17 additions & 54 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,8 @@ on:
- "*"

jobs:
setup_install:
name: Run setup install
runs-on: ubuntu-latest
container:
image: precice/precice:nightly
options: --user root
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install pip3, pkgconfig and upgrade pip3
run: |
apt-get -yy update
apt-get install -y python3-pip python3.12-venv pkg-config
rm -rf /var/lib/apt/lists/*
- name: Create venv
run: python3 -m venv .venv
- name: Activate venv
# see https://stackoverflow.com/a/74669486
run: |
. .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Install dependencies
run: |
pip3 install 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
run: python3 setup.py install
- name: Test install
run: |
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
python3 -c "import precice"

setup_test:
name: Run setup test
run_tox:
name: Run mocked tests
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
Expand All @@ -52,9 +20,6 @@ jobs:
sudo apt-get -yy update
sudo apt-get install -y libopenmpi-dev cmake libboost-all-dev libeigen3-dev pkg-config
sudo rm -rf /var/lib/apt/lists/*
- uses: BSFishy/pip-action@v1
with:
packages: toml
- name: Checkout precice and make required files discoverable
run: |
git clone --branch develop https://github.com/precice/precice.git precice-core
Expand All @@ -65,27 +30,24 @@ jobs:
cd precice-core
mkdir build && cd build
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
- name: Run setup test
- name: Install tox
run: pip install tox
- name: Run tox
env:
PKG_CONFIG_PATH: "precice-core/build"
PKG_CONFIG_SYSTEM_INCLUDE_PATH: 1
run: |
export CFLAGS=-I$GITHUB_WORKSPACE
python3 setup.py test
export PKG_CONFIG_PATH=$(readlink -f "precice-core/build")
tox

pip_install:
name: Run pip install
needs: [setup_test]
runs-on: ubuntu-latest
container:
image: precice/precice:nightly
options: --user root
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install dependencies
run: |
apt-get -yy update
Expand All @@ -94,17 +56,18 @@ jobs:
- name: Create venv
run: |
python3 -m venv .venv
- name: Activate venv
# see https://stackoverflow.com/a/74669486
run: |
. .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Run pip install
run: pip3 install .
run: |
.venv/bin/pip3 install .
- name: Check import
run: |
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
python3 -c "import precice"
.venv/bin/python3 -c "import precice"
- name: Get version
run: |
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
.venv/bin/python3 -c "import precice; print(precice.__version__)"
.venv/bin/python3 -c "import precice; print(precice.get_version_information())"

solverdummy_test:
name: Run solverdummy
Expand All @@ -115,7 +78,7 @@ jobs:
options: --user root
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install dependencies
run: |
apt-get -yy update
Expand Down
6 changes: 4 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ include LICENSE.txt
include cyprecice/*.pyx
include cyprecice/*.pxd
include test/test_bindings_module.py
include versioneer.py
include precice/_version.py
include test/Participant.cpp

# Include mocked interface file
include test/Participant.cpp
16 changes: 6 additions & 10 deletions precice/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
from ._version import get_versions
__version__ = "unknown"

import warnings
from cyprecice import Participant, get_version_information
from importlib.metadata import version, PackageNotFoundError


__version__ = get_versions()['version']
del get_versions

from . import _version
__version__ = _version.get_versions()['version']
try:
__version__ = version("pyprecice")
except PackageNotFoundError:
# package is not installed
pass
Loading