Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: run tests

on:
push:
branches:
- "main"
pull_request:


jobs:
pre-commit:
name: pre-commit checks
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install dependencies for pre-commit
run: |
python -m pip install --upgrade pip
pip install pre-commit

- name: Run pre-commit
run: pre-commit run --all-files

test:
name: "test"
runs-on: "${{ matrix.os }}"
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python: ["3.11", "3.12", "3.13"]
defaults:
run:
shell: "bash -eo pipefail {0}"

steps:
- uses: "actions/checkout@v3"
- uses: "actions/setup-python@v3"
with:
python-version: "${{ matrix.python }}"
- uses: "actions/cache@v3"
id: "cache"
with:
path: "${{ env.pythonLocation }}"
key: "test-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements/*') }}"
- run: "python --version"
- run: "python -mpip install -U pip"
- run: "python -mpip --version"
- run: "python -mpip install -r requirements/requirements.txt"
- run: "python -mpip install -e ./"
- name: "Run tests"
run: "pytest -v"
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.venv
*.pdf
*.html
*.slf
*.gpkg
__pycache*
58 changes: 58 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
ci:
autofix_prs: false
default_language_version:
python: "python3"
fail_fast: false

repos:
- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: "v4.5.0"
hooks:
- id: "check-added-large-files"
args: ["--maxkb=40000"]
- id: "check-ast"
- id: "check-byte-order-marker"
- id: "check-case-conflict"
- id: "check-docstring-first"
- id: "check-executables-have-shebangs"
- id: "check-json"
- id: "check-symlinks"
- id: "check-merge-conflict"
- id: "check-vcs-permalinks"
- id: "check-xml"
- id: "check-yaml"
- id: "debug-statements"
- id: "end-of-file-fixer"
exclude: ".+\\.ipynb"
- id: "mixed-line-ending"
- id: "name-tests-test"
- id: "trailing-whitespace"

- repo: "https://github.com/pre-commit/pygrep-hooks"
rev: "v1.10.0"
hooks:
- id: "python-check-blanket-noqa"
- id: "python-check-blanket-type-ignore"
- id: "python-use-type-annotations"

- repo: "https://github.com/asottile/reorder_python_imports"
rev: "v3.12.0"
hooks:
- id: "reorder-python-imports"
args:
- "--py310-plus"
- "--add-import"
- "from __future__ import annotations"

- repo: "https://github.com/asottile/add-trailing-comma"
rev: "v3.1.0"
hooks:
- id: "add-trailing-comma"

- repo: "https://github.com/astral-sh/ruff-pre-commit"
rev: "v0.1.7"
hooks:
- id: "ruff"
args: ["--show-fixes"]
- id: "ruff-format"
Loading
Loading