-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MAINT] Add CI checks, update linting, docs, and config (#7)
- Loading branch information
Showing
24 changed files
with
357 additions
and
159 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: "unit_tests" | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.type }} | ||
cancel-in-progress: true | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
branches: | ||
- "*" | ||
|
||
jobs: | ||
# Run unit tests | ||
test_pip: | ||
runs-on: ${{ matrix.os }} | ||
defaults: | ||
run: | ||
shell: bash -e {0} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
python-version: "3.10" | ||
- os: ubuntu-latest | ||
python-version: "3.12" | ||
- os: macos-13 # Intel | ||
python-version: "3.12" | ||
- os: macos-14 # arm64 | ||
python-version: "3.12" | ||
- os: windows-latest | ||
python-version: "3.12" | ||
env: | ||
TZ: Europe/Berlin | ||
FORCE_COLOR: true | ||
DISPLAY: ":99.0" | ||
OPENBLAS_NUM_THREADS: "1" | ||
PYTHONUNBUFFERED: "1" | ||
steps: | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: actions/checkout@v4 | ||
- uses: pyvista/setup-headless-display-action@main | ||
with: | ||
qt: true | ||
pyvista: false | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
pip install --upgrade --upgrade-strategy eager .[test] | ||
- name: Display versions and environment information | ||
run: | | ||
echo $TZ | ||
date | ||
python --version | ||
which python | ||
- run: pip install -e . | ||
- run: python -c "import pyparrm; print(f'PyPARRM {pyparrm.__version__}')" | ||
- name: Run pytest | ||
run: python -m coverage run && coverage report | ||
|
||
test_conda: | ||
timeout-minutes: 90 | ||
runs-on: ubuntu-20.04 | ||
defaults: | ||
run: | ||
shell: bash -el {0} | ||
env: | ||
MKL_NUM_THREADS: '1' | ||
PYTHONUNBUFFERED: '1' | ||
PYTHON_VERSION: '3.12' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pyvista/setup-headless-display-action@main | ||
with: | ||
qt: true | ||
pyvista: false | ||
- uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
environment-file: environment.yml | ||
create-args: >- # beware the >- instead of |, we don't split on newlines but on spaces | ||
python=${{ env.PYTHON_VERSION }} | ||
- name: Install package and test dependencies | ||
run: | | ||
pip install -e . | ||
pip install .[test] | ||
- name: Display version information | ||
run: python -c "import pyparrm; print(f'PyPARRM {pyparrm.__version__}')" | ||
- name: Run pytest | ||
run: python -m coverage run && coverage report |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
repos: | ||
# ruff PyPARRM | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.4.7 | ||
hooks: | ||
- id: ruff | ||
name: ruff lint pyparrm | ||
args: ["--fix"] | ||
files: ^src/pyparrm/ | ||
|
||
# ruff examples | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.4.7 | ||
hooks: | ||
- id: ruff | ||
name: ruff lint examples | ||
args: ["--fix"] | ||
files: ^examples/ | ||
|
||
# codespell | ||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.3.0 | ||
hooks: | ||
- id: codespell | ||
additional_dependencies: | ||
- tomli | ||
files: ^pyparrm/|^docs/|^examples/ | ||
types_or: [python, rst, inc] | ||
|
||
# yamllint | ||
- repo: https://github.com/adrienverge/yamllint.git | ||
rev: v1.35.1 | ||
hooks: | ||
- id: yamllint | ||
args: [--strict, -c, .yamllint.yml] | ||
|
||
# rstcheck | ||
- repo: https://github.com/rstcheck/rstcheck.git | ||
rev: v6.2.0 | ||
hooks: | ||
- id: rstcheck | ||
additional_dependencies: | ||
- tomli | ||
files: ^docs/.*\.(rst|inc)$ | ||
|
||
# toml-sort | ||
- repo: https://github.com/pappasam/toml-sort.git | ||
rev: v0.23.1 | ||
hooks: | ||
- id: toml-sort-fix | ||
|
||
ci: | ||
autofix_prs: true |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
extends: default | ||
|
||
rules: | ||
line-length: disable | ||
document-start: disable | ||
truthy: disable | ||
new-lines: | ||
type: platform |
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
API | ||
=== | ||
|
||
Here are the API references for PyPARRM. | ||
|
||
.. container:: d-none | ||
|
||
:py:mod:`pyparrm`: | ||
|
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.