diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7b3cef1..3fd23f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,6 +18,7 @@ concurrency: jobs: run: + name: Build and test runs-on: ${{ matrix.os }} timeout-minutes: 3 @@ -52,32 +53,8 @@ jobs: - name: Test installation without nbdime run: pytest -v - - name: Test flake8 - if: ${{ matrix.python-version == '3.14' }} - run: flake8 matplotlib_inline --ignore=E501,W504,W503 - - name: Test Build if: ${{ matrix.python-version == '3.14' }} run: | pip install build python -m build - - - name: Install ruff - if: ${{ matrix.python-version == '3.14' }} - run: pip install ruff - - - name: Check code with ruff - if: ${{ matrix.python-version == '3.14' }} - run: ruff check matplotlib_inline - - - name: Check formatting with ruff - if: ${{ matrix.python-version == '3.14' }} - run: ruff format matplotlib_inline --check - - - name: install Mypy - if: ${{ matrix.python-version == '3.14' }} - run : pip install mypy matplotlib - - - name: run mypy - if: ${{ matrix.python-version == '3.14' }} - run: mypy . diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7df3051..49fa0b4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -44,4 +44,3 @@ jobs: fi - name: Publish package uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3 - diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..8debbd2 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,25 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: check-added-large-files + - id: check-merge-conflict + - id: check-toml + - id: check-yaml + - id: debug-statements + - id: end-of-file-fixer + exclude: \.ipynb$ + - id: trailing-whitespace + exclude: \.ipynb$ + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.17.3 + hooks: + - id: ruff-check + exclude: \.ipynb$ + - id: ruff-format + exclude: \.ipynb$ + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v2.4.0 + hooks: + - id: mypy + additional_dependencies: [matplotlib, traitlets] diff --git a/pyproject.toml b/pyproject.toml index 2a2718b..0ac7fb5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,6 @@ inline = "matplotlib_inline.backend_inline" [project.optional-dependencies] test = [ - "flake8", "nbdime", "nbval", "notebook",