Skip to content

Commit

Permalink
Pre-commit hooks (modflowpy#61)
Browse files Browse the repository at this point in the history
Install pre-commit hooks with pixi run -e dev install. On each commit pre-commit will do some checks to sanitize the code.
Update python to 3.11 to comply to spec-0000, because we use scipy and numpy in our code base.
  • Loading branch information
deltamarnix authored Dec 12, 2024
1 parent d25f351 commit 45702d6
Show file tree
Hide file tree
Showing 4 changed files with 1,267 additions and 3,414 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@ jobs:
- name: Setup pixi
uses: prefix-dev/[email protected]
with:
pixi-version: v0.32.0
pixi-version: v0.39.2
environments: dev
activate-environment: true

- name: Run ruff
run: pixi run lint

build:
name: Build
runs-on: ubuntu-latest
steps:

- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup pixi
uses: prefix-dev/[email protected]
with:
pixi-version: v0.32.0
pixi-version: v0.39.2
environments: dev
activate-environment: true

Expand All @@ -61,14 +61,14 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-22.04, macos-13, windows-2022 ]
python: [ "310", "311", "312", "313" ]
python: [ "311", "312", "313" ]
env:
GCC_V: 11
steps:

- name: Checkout repo
uses: actions/checkout@v4

- name: Install nightly build
uses: modflowpy/install-modflow-action@v1
with:
Expand All @@ -77,7 +77,7 @@ jobs:
- name: Setup pixi
uses: prefix-dev/[email protected]
with:
pixi-version: v0.32.0
pixi-version: v0.39.2
environments: test${{ matrix.python }}
activate-environment: true

Expand Down
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-toml
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
types_or: [python, pyi, jupyter]
Loading

0 comments on commit 45702d6

Please sign in to comment.