Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add core/full dependencies to matrix #558

Merged
merged 9 commits into from
Jul 17, 2024
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
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
Loading