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
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
- package-ecosystem: "uv" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ jobs:
# REPO_AND_READ_PACKAGES_PAT is a secret token on organization level
# https://github.com/organizations/Hochfrequenz/settings/secrets/dependabot/REPO_AND_READ_PACKAGES_PAT
submodules: "recursive"
- name: Set up Python
uses: actions/setup-python@v7
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
with:
python-version: "3.14"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
run: uv sync --group coverage --extra sqlmodels --extra ahbicht --extra cli
- name: Run Tests and Record Coverage
run: |
tox -e coverage
cd unittests
uv run coverage run -m pytest -vv
uv run coverage html --omit .venv/*,unittests/*
uv run coverage report --fail-under 94 --omit .venv/*,unittests/*
13 changes: 4 additions & 9 deletions .github/workflows/dev_test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "Test Dev Environment"
# Checks that the dev environment (tox -e dev) can be set up.
# Checks that the dev environment (uv sync --group dev) can be set up.
# This might not work, if different linting/testing envs refer to different versions of the same lib (e.g. typing-extensions).
# Different versions of the same package might work for isolated specific envs (only linting, only testing...) but the dev environment inherits from all of them.
on:
Expand All @@ -14,14 +14,9 @@ jobs:
python-version: ["3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Create a Dev Environment
run: |
tox -e dev
run: uv sync --group dev --extra sqlmodels --extra ahbicht --extra cli
11 changes: 4 additions & 7 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@ jobs:
tool: ["black", "isort"]
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
with:
python-version: "3.14"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[formatting]
run: uv sync --group formatting
- name: ${{ matrix.tool }} Code Formatter
run: |
${{ matrix.tool }} . --check
run: uv run ${{ matrix.tool }} . --check
13 changes: 5 additions & 8 deletions .github/workflows/packaging_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
with:
python-version: 3.14
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
python-version: "3.14"
- name: Run Packaging Test
run: |
tox -e test_packaging
uv build
uv publish --dry-run
24 changes: 8 additions & 16 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,14 @@ jobs:
token: ${{ secrets.XML_SUBMODULE_PAT }} # token with repo scope; expires never
# https://github.com/Hochfrequenz/xml-fundamend-python/settings/secrets/actions/XML_AHB_MIG_Token
submodules: "recursive"
- name: Set up Python
uses: actions/setup-python@v7
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
with:
python-version: "3.14"
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox
- name: Install dependencies
run: uv sync --group tests --extra sqlmodels --extra ahbicht
- name: Run tests
run: |
tox -e tests
run: uv run pytest -vv

build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
Expand All @@ -46,17 +43,12 @@ jobs:
needs: tests
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
with:
python-version: "3.14"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[test_packaging]
- name: Build wheel and source distributions
run: |
python -m build
run: uv build
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
28 changes: 22 additions & 6 deletions .github/workflows/pythonlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,30 @@ jobs:
linter-env: ["linting", "type_check", "spell_check"]
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
with:
python-version: "3.14"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run ${{ matrix.linter-env }} via Tox
if [ "${{ matrix.linter-env }}" = "spell_check" ]; then
uv sync --group spell_check
else
uv sync --group ${{ matrix.linter-env }} --extra sqlmodels --extra ahbicht --extra cli
fi
- name: Run ${{ matrix.linter-env }}
run: |
tox -e ${{ matrix.linter-env }}
case "${{ matrix.linter-env }}" in
linting)
uv run pylint fundamend
uv run pylint unittests --rcfile=unittests/.pylintrc
;;
type_check)
uv run mypy --show-error-codes src/fundamend --strict
uv run mypy --show-error-codes unittests --strict
;;
spell_check)
uv run codespell --ignore-words=domain-specific-terms.txt src
uv run codespell --ignore-words=domain-specific-terms.txt README.md
;;
esac
15 changes: 6 additions & 9 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,14 @@ jobs:
# REPO_AND_READ_PACKAGES_PAT is a secret token on organization level
# https://github.com/organizations/Hochfrequenz/settings/secrets/dependabot/REPO_AND_READ_PACKAGES_PAT
submodules: "recursive"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install tox
run: uv sync --group tests --extra sqlmodels --extra ahbicht
- name: install typer if requested
if: matrix.run_step == 'install_typer'
run: pip install .[cli]
- name: Run the Unit Tests via Tox
run: |
tox -e tests
run: uv sync --group tests --extra sqlmodels --extra ahbicht --extra cli
- name: Run the Unit Tests
run: uv run pytest -vv
8 changes: 6 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# to update all repo revisions just run: pre-commit autoupdate
repos:
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.11.31
hooks:
- id: uv-lock
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 24.10.0
rev: 26.5.1
hooks:
- id: black
language_version: python3
- repo: https://github.com/pycqa/isort
rev: 5.13.2
rev: 8.0.1
hooks:
- id: isort
name: isort (python)
Expand Down
47 changes: 30 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,42 @@ sqlmodels = [
ahbicht = [
"ahbicht>=2.0.0"
]
coverage = [
"coverage==7.15.2"
cli = [
"typer" # if you install fundamend[cli], the cli commands are available via typer
]
formatting = [
"black==26.5.1",
"isort==8.0.1"

[dependency-groups]
tests = [
"pytest==9.1.1",
"syrupy==5.5.3"
]
linting = [
"pylint==4.0.6"
"pylint==4.0.6",
{include-group = "tests"}
]
cli = [
"typer" # if you install fundamend[cli], the cli commands are available via typer
type_check = [
"mypy==2.3.0",
{include-group = "tests"}
]
spellcheck = [
spell_check = [
"codespell==2.4.2"
]
test_packaging = [
"build==1.5.0",
"twine==6.2.0"
coverage = [
"coverage==7.15.2",
{include-group = "tests"}
]
tests = [
"pytest==9.1.1",
"syrupy==5.5.3"
formatting = [
"black==26.5.1",
"isort==8.0.1"
]
type_check = [
"mypy==2.3.0"
dev = [
{include-group = "tests"},
{include-group = "linting"},
{include-group = "type_check"},
{include-group = "coverage"},
{include-group = "spell_check"},
{include-group = "formatting"},
"pre-commit"
]


Expand Down Expand Up @@ -90,6 +100,9 @@ truethy-bool = true
[tool.mypy]
disable_error_code = []

[tool.uv]
default-groups = []

[build-system]
requires = ["hatchling>=1.8.0", "hatch-vcs", "hatch-fancy-pypi-readme"]
build-backend = "hatchling.build"
Expand Down
23 changes: 0 additions & 23 deletions requirements.txt

This file was deleted.

Loading
Loading