File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name: Tests
2-
31on:
42 push:
53 branches:
@@ -17,7 +15,28 @@ concurrency:
1715 cancel-in-progress: true
1816
1917jobs:
18+ pre-commit:
19+ name: Pre-commit
20+ runs-on: ubuntu-latest
21+ timeout-minutes: 5
22+
23+ steps:
24+ - name: Checkout
25+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26+ with:
27+ persist-credentials: false
28+
29+ - name: Setup Python
30+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
31+ with:
32+ python-version: "3.14"
33+
34+ - name: Run pre-commit
35+ run: pipx run pre-commit run --all-files --show-diff-on-failure
36+
2037 run:
38+ name: Tests
39+ needs: pre-commit
2140 runs-on: ${{ matrix.os }}
2241 timeout-minutes: 3
2342
5271 - name: Test installation without nbdime
5372 run: pytest -v
5473
55- - name: Test flake8
56- if: ${{ matrix.python-version == '3.14' }}
57- run: flake8 matplotlib_inline --ignore=E501,W504,W503
58-
5974 - name: Test Build
6075 if: ${{ matrix.python-version == '3.14' }}
6176 run: |
6277 pip install build
6378 python -m build
64-
65- - name: Install ruff
66- if: ${{ matrix.python-version == '3.14' }}
67- run: pip install ruff
68-
69- - name: Check code with ruff
70- if: ${{ matrix.python-version == '3.14' }}
71- run: ruff check matplotlib_inline
72-
73- - name: Check formatting with ruff
74- if: ${{ matrix.python-version == '3.14' }}
75- run: ruff format matplotlib_inline --check
76-
77- - name: install Mypy
78- if: ${{ matrix.python-version == '3.14' }}
79- run : pip install mypy matplotlib
80-
81- - name: run mypy
82- if: ${{ matrix.python-version == '3.14' }}
83- run: mypy .
Original file line number Diff line number Diff line change 4444 fi
4545 - name: Publish package
4646 uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
47-
Original file line number Diff line number Diff line change 1+ repos:
2+ - repo: https://github.com/pre-commit/pre-commit-hooks
3+ rev: v6.0.0
4+ hooks:
5+ - id: check-added-large-files
6+ - id: check-merge-conflict
7+ - id: check-toml
8+ - id: check-yaml
9+ - id: debug-statements
10+ - id: end-of-file-fixer
11+ exclude: \.ipynb$
12+ - id: trailing-whitespace
13+ exclude: \.ipynb$
14+ - repo: https://github.com/astral-sh/ruff-pre-commit
15+ rev: v0.17.3
16+ hooks:
17+ - id: ruff-check
18+ exclude: \.ipynb$
19+ - id: ruff-format
20+ exclude: \.ipynb$
21+ - repo: https://github.com/pre-commit/mirrors-mypy
22+ rev: v2.4.0
23+ hooks:
24+ - id: mypy
25+ additional_dependencies: [matplotlib, traitlets]
Original file line number Diff line number Diff line change @@ -49,7 +49,6 @@ inline = "matplotlib_inline.backend_inline"
4949
5050[project.optional-dependencies]
5151test = [
52- "flake8",
5352 "nbdime",
5453 "nbval",
5554 "notebook",
You can’t perform that action at this time.
0 commit comments