-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MNT] Add pre-commit, drop python 3.8, add python 3.12, add yamllint,…
… add toml-sort (#124) * use yaml format everywhere * use single quote in pyproject.toml * add codecov configuration * sort pyproject.toml * drop python 3.8, add 3.12 and sort pyproject.toml * add pre-commit and yamllint configuration * fix yaml style * fix more * better azp workflow * try different method * try again * fix doc * fix order * fix spelling * more fixes * rm check_version("mne", 1.2) * try patch for MNE 1.6 * fix type-hint * try again * fix style * fix doc build * turn warnings into errors * skip conftest in coverage and ignore pytest warn * add comment * try again * add ignore * improve test config * try github-actions for comparison * don't hard pin pytest version..... * sort pypyproject.toml * add cache to gh-action * remove plt.close("all") duplicate calls and set show to plt.isinteractive() * add cache for pip-pre * fix test * fix F401 * use constrained-layout in matplotlib * drop azp (temp, revert if needed!!) * Update pycrostates/conftest.py * Update pycrostates/conftest.py * Update pycrostates/conftest.py * fix import * Add pre-commit badge * ignore deprecation * fix joblib deprecation warning * one more --------- Co-authored-by: vferat <[email protected]>
- Loading branch information
Showing
27 changed files
with
456 additions
and
476 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,25 @@ | ||
comment: false | ||
github_checks: # too noisy, even though "a" interactively disables them | ||
annotations: false | ||
|
||
codecov: | ||
notify: | ||
require_ci_to_pass: false | ||
|
||
coverage: | ||
status: | ||
patch: | ||
default: | ||
informational: true | ||
target: 95% | ||
if_no_uploads: error | ||
if_not_found: success | ||
if_ci_failed: failure | ||
project: | ||
default: false | ||
library: | ||
informational: true | ||
target: 90% | ||
if_no_uploads: error | ||
if_not_found: success | ||
if_ci_failed: failure |
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,109 @@ | ||
name: pytest | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }} | ||
cancel-in-progress: true | ||
on: # yamllint disable-line rule:truthy | ||
pull_request: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 8 * * 1' | ||
|
||
jobs: | ||
pytest: | ||
timeout-minutes: 30 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu, macos, windows] | ||
python-version: [3.9, "3.10", "3.11", "3.12"] | ||
name: ${{ matrix.os }} - py${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }}-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: 'x64' | ||
- name: Install package | ||
run: | | ||
python -m pip install --progress-bar off --upgrade pip setuptools | ||
python -m pip install --progress-bar off .[test] | ||
- name: Display system information | ||
run: pycrostates-sys_info --developer | ||
- name: Display MNE info | ||
run: mne sys_info -pd | ||
- name: Get testing dataset version | ||
run: | | ||
curl https://raw.githubusercontent.com/mne-tools/mne-testing-data/master/version.txt -o mne_testing_data_version.txt | ||
- name: Cache testing dataset | ||
uses: actions/cache@v3 | ||
with: | ||
key: mne-testing-${{ hashFiles('mne_testing_data_version.txt') }} | ||
path: ~/mne_data | ||
- name: Download testing dataset | ||
run: python -c "import mne; mne.datasets.testing.data_path(verbose=True)" | ||
- name: Run pytest | ||
run: pytest pycrostates --cov=pycrostates --cov-report=xml --cov-config=pyproject.toml | ||
- name: Upload to codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: ./coverage.xml | ||
flags: unittests # optional | ||
name: codecov-umbrella # optional | ||
verbose: true # optional (default = false) | ||
|
||
pytest-pip-pre: | ||
timeout-minutes: 30 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.11"] | ||
name: pip pre-release - py${{ matrix.python-version }} | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: 'x64' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --progress-bar off --upgrade pip setuptools | ||
python -m pip install --progress-bar off .[test] | ||
python -m pip install --progress-bar off --upgrade git+https://github.com/mne-tools/mne-python | ||
python -m pip install --progress-bar off --upgrade --pre --only-binary :all: -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple --timeout=180 numpy scipy scikit-learn matplotlib | ||
- name: Display system information | ||
run: pycrostates-sys_info --developer | ||
- name: Display MNE info | ||
run: mne sys_info -pd | ||
- name: Get testing dataset version | ||
run: | | ||
curl https://raw.githubusercontent.com/mne-tools/mne-testing-data/master/version.txt -o mne_testing_data_version.txt | ||
- name: Cache testing dataset | ||
uses: actions/cache@v3 | ||
with: | ||
key: mne-testing-${{ hashFiles('mne_testing_data_version.txt') }} | ||
path: ~/mne_data | ||
- name: Download testing dataset | ||
run: python -c "import mne; mne.datasets.testing.data_path(verbose=True)" | ||
- name: Run pytest | ||
run: pytest pycrostates --cov=pycrostates --cov-report=xml --cov-config=pyproject.toml | ||
- name: Upload to codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: ./coverage.xml | ||
flags: unittests # optional | ||
name: codecov-umbrella # optional | ||
verbose: true # optional (default = false) |
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,55 @@ | ||
ci: | ||
skip: [codespell, pydocstyle, yamllint] | ||
|
||
repos: | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
files: pycrostates | ||
|
||
- repo: https://github.com/psf/black-pre-commit-mirror | ||
rev: 23.10.1 | ||
hooks: | ||
- id: black | ||
args: [--quiet] | ||
files: pycrostates | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.1.0 | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] | ||
files: pycrostates | ||
|
||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.2.6 | ||
hooks: | ||
- id: codespell | ||
|
||
- repo: https://github.com/pycqa/pydocstyle | ||
rev: 6.3.0 | ||
hooks: | ||
- id: pydocstyle | ||
files: pycrostates | ||
additional_dependencies: [tomli] | ||
|
||
- repo: https://github.com/mscheltienne/bibclean | ||
rev: 0.7.1 | ||
hooks: | ||
- id: bibclean-fix | ||
files: docs/references.bib | ||
args: [--exit-non-zero-on-fix] | ||
|
||
- repo: https://github.com/pappasam/toml-sort | ||
rev: v0.23.1 | ||
hooks: | ||
- id: toml-sort-fix | ||
files: pyproject.toml | ||
|
||
- repo: https://github.com/adrienverge/yamllint | ||
rev: v1.32.0 | ||
hooks: | ||
- id: yamllint | ||
args: [--strict, -c, .yamllint.yaml] | ||
files: (.github/|.codecov.yaml|.pre-commit-config.yaml|.prospector.yaml|.readthedocs.yaml) |
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 |
---|---|---|
|
@@ -28,4 +28,4 @@ pep257: | |
|
||
pylint: | ||
disable: | ||
- too-many-arguments | ||
- too-many-arguments |
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,5 @@ | ||
extends: default | ||
|
||
rules: | ||
line-length: disable | ||
document-start: disable |
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.