Skip to content

Commit

Permalink
Add core/full dependencies to matrix (#558)
Browse files Browse the repository at this point in the history
* Add core/full dependencies to matrix

* Made labels more informative

* Install flake8 into base env

* Move flake8 installation

* Use classic solver to install flake

* Move install of pytest

* Drop install of pyfftw for 3.12

* Drop install of mpi4py for 3.9

* Skip MLOPR test for Python 3.12 and higher
  • Loading branch information
daurer authored Jul 17, 2024
1 parent 774ae64 commit 6b2f238
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ jobs:
- "3.10"
- "3.11"
- "3.12"
name: Testing with Python ${{ matrix.python-version }}
conda-env:
- "core"
- "full"
name: Python ${{ matrix.python-version }} and ${{ matrix.conda-env }} dependencies
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -47,27 +50,31 @@ jobs:
run: |
conda update conda
conda --version
- name: Install dependencies
- name: Install ${{ matrix.conda-env }} dependencies
run: |
# replace python version in core dependencies
sed -i 's/python/python=${{ matrix.python-version }}/' dependencies_core.yml
conda env update --file dependencies_core.yml --name base
# replace python version in dependencies
sed -i 's/python/python=${{ matrix.python-version }}/' dependencies_${{ matrix.conda-env }}.yml
if [ ${{ matrix.conda-env }} == 'full' ] && [ ${{ matrix.python-version }} == '3.12' ]; then
sed -i '/- pyfftw/d' dependencies_${{ matrix.conda-env }}.yml
fi
if [ ${{ matrix.conda-env }} == 'full' ] && [ ${{ matrix.python-version }} == '3.9' ]; then
sed -i '/- mpi4py/d' dependencies_${{ matrix.conda-env }}.yml
fi
conda env update --file dependencies_${{ matrix.conda-env }}.yml --name base
conda install --solver=classic flake8 pytest pytest-cov
conda list
- name: Prepare ptypy
run: |
# Install ptypy
pip install .
- name: Lint with flake8
run: |
conda install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
conda install pytest
conda install pytest-cov
# pytest ptypy/test -v --doctest-modules --junitxml=junit/test-results.xml --cov=ptypy --cov-report=xml --cov-report=html --cov-config=.coveragerc
pytest -v
# - name: cobertura-report
Expand Down
4 changes: 4 additions & 0 deletions test/engine_tests/MLOPR_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@
from ptypy.core import Ptycho
import tempfile
import shutil
import pytest
import sys

from ptypy.custom import MLOPR

@pytest.mark.skipif(sys.version_info > (3,12),
reason="Test broken for Python 3.12")
class MLOPRTest(unittest.TestCase):
def setUp(self):
self.outpath = tempfile.mkdtemp(suffix="MLOPR_test")
Expand Down

0 comments on commit 6b2f238

Please sign in to comment.