Skip to content

Commit

Permalink
update and run pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sappelhoff committed Oct 27, 2023
1 parent 758f08c commit fc678b4
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
pull_request:
branches: [ main ]
create:
branches: [main]
tags: ['**']
branches: [ main ]
tags: [ '**' ]
schedule:
- cron: "0 4 * * MON"

Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/python_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
pull_request:
branches: [ main ]
create:
branches: [main]
tags: ['**']
branches: [ main ]
tags: [ '**' ]
schedule:
- cron: "0 4 * * MON"

Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
pip install -e .
- name: Install MNE-Python (development version)
if: "matrix.mne-version == 'mne-main'"
if: matrix.mne-version == 'mne-main'
run: |
pip install git+https://github.com/mne-tools/mne-python.git@main
Expand All @@ -61,12 +61,10 @@ jobs:
mne sys_info
- name: Check formatting
if: "matrix.platform == 'ubuntu-latest'"
if: matrix.platform == 'ubuntu-latest'
run: |
flake8 --docstring-convention numpy .
check-manifest .
black . --check
isort . --check
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
- name: Test with pytest
Expand All @@ -79,7 +77,7 @@ jobs:
make -C docs/ html
- name: Upload artifacts
if: "matrix.platform == 'ubuntu-latest'"
if: matrix.platform == 'ubuntu-latest'
uses: actions/upload-artifact@v3
with:
name: docs-artifact
Expand Down
7 changes: 4 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -17,11 +17,12 @@ repos:
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: "23.7.0"
rev: "23.10.1"
hooks:
- id: black
exclude: pyprep/_version.py
- repo: https://github.com/pycqa/flake8
rev: "6.0.0"
rev: "6.1.0"
hooks:
- id: flake8
additional_dependencies: [flake8-docstrings]
1 change: 0 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ python:
- method: pip
path: .
- requirements: requirements-dev.txt

3 changes: 2 additions & 1 deletion pyprep/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
from pyprep.reference import Reference # noqa: F401

from . import _version
__version__ = _version.get_versions()['version']

__version__ = _version.get_versions()["version"]
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
[tool.black]
exclude = "matprep_artifacts"
extend-exclude = '''
# A regex preceded with ^/ will apply only to files and directories
# in the root of the project.
(
matprep_artifacts
pyprep/_version.py
)
'''

[build-system]
requires = ["setuptools", "versioneer[toml]"]
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ profile=black
skip_glob =
examples/*
matprep_artifacts/*
pyprep/_version.py

[coverage:run]
omit =
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

import sys

from setuptools import setup

import versioneer
from setuptools import setup

# Give setuptools a hint to complain if it's too old a version
# 30.3.0 allows us to put most metadata in setup.cfg
Expand Down

0 comments on commit fc678b4

Please sign in to comment.