optional patch solutions #1551
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## | |
| ## Copyright 2018-2025 the orix developers | |
| ## | |
| ## This file is part of orix. | |
| ## | |
| ## orix is free software: you can redistribute it and/or modify | |
| ## it under the terms of the GNU General Public License as published by | |
| ## the Free Software Foundation, either version 3 of the License, or | |
| ## (at your option) any later version. | |
| ## | |
| ## orix is distributed in the hope that it will be useful, | |
| ## but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| ## GNU General Public License for more details. | |
| ## | |
| ## You should have received a copy of the GNU General Public License | |
| ## along with orix. If not, see <http://www.gnu.org/licenses/>. | |
| ## | |
| name: build | |
| on: | |
| push: | |
| branches-ignore: | |
| - 'pre-commit-ci-update-config' | |
| pull_request: | |
| branches: | |
| - '*' | |
| workflow_dispatch: | |
| jobs: | |
| code: | |
| name: code style | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: psf/black@stable | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - uses: isort/isort-action@master | |
| with: | |
| configuration: --profile black --filter-files --force-sort-within-sections --check-only --diff | |
| - name: Install Black with Jupyter extension | |
| run: | | |
| pip install black[jupyter] | |
| - name: Check code style of Jupyter notebooks | |
| run: | | |
| black --diff --line-length 77 doc/tutorials/*.ipynb | |
| build-with-pip: | |
| name: ${{ matrix.os }}-py${{ matrix.python-version }}${{ matrix.LABEL }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 15 | |
| env: | |
| MPLBACKEND: agg | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| python-version: ['3.11', '3.12'] | |
| include: | |
| - os: ubuntu-latest | |
| python-version: '3.10' | |
| # Matplotlib 3.6.1 is not compatible with NumPy v2 | |
| DEPENDENCIES: diffpy.structure==3.0.2 matplotlib==3.6.1 "numpy<2" | |
| LABEL: -oldest | |
| - os: ubuntu-latest | |
| python-version: '3.12' | |
| LABEL: -minimum_requirement | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install core depedencies and package | |
| shell: bash | |
| run: | | |
| pip install -U -e .'[tests,coverage]' | |
| - name: Install optional dependencies | |
| if: ${{ !contains(matrix.LABEL, 'minimum_requirement') }} | |
| shell: bash | |
| run: | | |
| pip install -e .'[all]' | |
| - name: Install oldest supported version | |
| if: ${{ contains(matrix.LABEL, 'oldest') }} | |
| run: | | |
| pip install ${{ matrix.DEPENDENCIES }} | |
| - name: Display Python, pip and package versions | |
| run: | | |
| python -V | |
| pip -V | |
| pip list | |
| - name: Run docstring tests | |
| if: ${{ matrix.os == 'ubuntu-latest' }} | |
| continue-on-error: true | |
| run: | | |
| pytest --doctest-modules --ignore-glob=orix/tests orix/*.py | |
| - name: Run tests | |
| run: | | |
| pytest --pyargs orix --slow --reruns 2 -n 2 --cov=orix | |
| - name: Generate line coverage | |
| if: ${{ matrix.os == 'ubuntu-latest' }} | |
| run: | | |
| coverage report --show-missing | |
| - name: Upload coverage to Coveralls | |
| if: ${{ matrix.os == 'ubuntu-latest' }} | |
| uses: AndreMiras/coveralls-python-action@develop | |
| with: | |
| parallel: true | |
| coveralls-finish: | |
| needs: build-with-pip | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Coveralls finished | |
| uses: AndreMiras/coveralls-python-action@develop | |
| with: | |
| parallel-finished: true |