Skip to content
Closed
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
53 changes: 25 additions & 28 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.12", "3.13"]

timeout-minutes: 20

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

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
Expand All @@ -29,18 +29,17 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest
pip install sh
curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync --frozen --no-editable
uv run --only-group dev pre-commit run --all-files --show-diff-on-failure --verbose

- name: List dependencies
run: |
python -m pip list
uv tree

- name: Run pytest
run: |
pytest -v
uv run pytest

run_tests_macos:
runs-on: ${{ matrix.os }}
Expand All @@ -49,7 +48,7 @@ jobs:
fail-fast: false
matrix:
os: ["macos-latest"]
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.12", "3.13"]

timeout-minutes: 20

Expand All @@ -64,18 +63,17 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest
pip install sh
curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync --frozen --no-editable
uv run --only-group dev pre-commit run --all-files --show-diff-on-failure --verbose

- name: List dependencies
run: |
python -m pip list
uv tree

- name: Run pytest
run: |
pytest -v
uv run pytest

run_tests_windows:
runs-on: ${{ matrix.os }}
Expand All @@ -84,7 +82,7 @@ jobs:
fail-fast: false
matrix:
os: ["windows-latest"]
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.12", "3.13"]

timeout-minutes: 20

Expand All @@ -99,17 +97,18 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
$env:Path = "C:\Users\runneradmin\.local\bin;$env:Path"
uv sync --frozen --no-editable
uv run --only-group dev pre-commit run --all-files --show-diff-on-failure --verbose

- name: List dependencies
run: |
python -m pip list
uv tree

- name: Run pytest
run: |
pytest -v
uv run pytest

# upload code coverage report
code-coverage:
Expand All @@ -122,18 +121,16 @@ jobs:
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest
pip install pytest-cov[toml]
pip install sh
curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync --frozen --no-editable
uv run --only-group dev pre-commit run --all-files --show-diff-on-failure --verbose

- name: Run tests and collect coverage
run: pytest --cov src # NEEDS TO BE UPDATED WHEN CHANGING THE NAME OF "src" FOLDER
run: uv run pytest --cov src # NEEDS TO BE UPDATED WHEN CHANGING THE NAME OF "src" FOLDER

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ MANIFEST
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
Expand Down Expand Up @@ -152,3 +148,5 @@ configs/local/default.yaml

# Aim logging
.aim

.DS_Store
137 changes: 10 additions & 127 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
default_language_version:
python: python3
python: python3.12

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
# list of supported hooks: https://pre-commit.com/hooks.html
- id: trailing-whitespace
Expand All @@ -17,131 +17,14 @@ repos:
- id: check-case-conflict
- id: check-added-large-files

# python code formatting
- repo: https://github.com/psf/black
rev: 23.1.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.2
hooks:
- id: black
args: [--line-length, "99"]
- id: ruff # linter
args: [ --fix ]
- id: ruff-format # formatter

# python import sorting
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.15.0
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]

# python upgrading syntax to newer version
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py38-plus]

# python docstring formatting
- repo: https://github.com/myint/docformatter
rev: v1.7.4
hooks:
- id: docformatter
args:
[
--in-place,
--wrap-summaries=99,
--wrap-descriptions=99,
--style=sphinx,
--black,
]

# python docstring coverage checking
- repo: https://github.com/econchick/interrogate
rev: 1.5.0 # or master if you're bold
hooks:
- id: interrogate
args:
[
--verbose,
--fail-under=80,
--ignore-init-module,
--ignore-init-method,
--ignore-module,
--ignore-nested-functions,
-vv,
]

# python check (PEP8), programming errors and code complexity
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
args:
[
"--extend-ignore",
"E203,E402,E501,F401,F841,RST2,RST301",
"--exclude",
"logs/*,data/*",
]
additional_dependencies: [flake8-rst-docstrings==0.3.0]

# python security linter
- repo: https://github.com/PyCQA/bandit
rev: "1.7.5"
hooks:
- id: bandit
args: ["-s", "B101"]

# yaml formatting
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.6
hooks:
- id: prettier
types: [yaml]
exclude: "environment.yaml"

# shell scripts linter
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.2
hooks:
- id: shellcheck

# md formatting
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.16
hooks:
- id: mdformat
args: ["--number"]
additional_dependencies:
- mdformat-gfm
- mdformat-tables
- mdformat_frontmatter
# - mdformat-toc
# - mdformat-black

# word spelling linter
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
args:
- --skip=logs/**,data/**,*.ipynb
# - --ignore-words-list=abc,def

# jupyter notebook cell output clearing
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
hooks:
- id: nbstripout

# jupyter notebook linting
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.6.3
hooks:
- id: nbqa-black
args: ["--line-length=99"]
- id: nbqa-isort
args: ["--profile=black"]
- id: nbqa-flake8
args:
[
"--extend-ignore=E203,E402,E501,F401,F841",
"--exclude=logs/*,data/*",
]
- id: mypy
2 changes: 0 additions & 2 deletions .project-root

This file was deleted.

30 changes: 0 additions & 30 deletions Makefile

This file was deleted.

Loading
Loading