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
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 @@ -6,14 +6,15 @@ 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
python-version: "3.14"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
uv sync --group coverage
- name: Run Tests and Record Coverage
run: |
tox -e coverage
uv run coverage run -m pytest
uv run coverage html --omit ".venv/*,unittests/*"
uv run coverage report --fail-under 80 --omit ".venv/*,unittests/*"
11 changes: 5 additions & 6 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ 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
python-version: "3.14"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[formatting]
uv sync --group formatting
- name: ${{ matrix.tool }} Code Formatter
run: |
${{ matrix.tool }} . --check
uv run ${{ matrix.tool }} . --check
15 changes: 7 additions & 8 deletions .github/workflows/packaging_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ 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
python-version: "3.14"
- name: Build the package
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run Packaging Test
uv build
- name: Check the package
run: |
tox -e test_packaging
uv publish --dry-run
31 changes: 13 additions & 18 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# It requires the Github "environments" feature (see instructions below) it might not be available for private free accounts (but works for public or organization repos).
# After creating the "release" environment in the Github repo settings, you need to enter your Github organization/user name + repo name + "python-publish.yml" workflow file name in the PyPI UI to make this work.

# This workflow uploads a Python Package using Twine when a release is created.
# This workflow uploads a Python Package using uv when a release is created.
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package
Expand All @@ -17,17 +17,16 @@ 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 tox
python-version: "3.14"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
uv sync --group tests
- name: Run tests
run: |
tox -e tests
uv run pytest

build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
Expand All @@ -41,18 +40,14 @@ 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]
python-version: "3.14"
Comment on lines 42 to +46
- name: Build wheel and source distributions
run: |
python -m build
uv build
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1

run: |
uv publish --trusted-publishing=automatic
22 changes: 14 additions & 8 deletions .github/workflows/pythonlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,27 @@ name: "Linting"
on: [push]
jobs:
pylint:
name: Python Code Quality and Lint
name: Python Code Quality and Lint (${{ matrix.linter-env }})
runs-on: ubuntu-latest
strategy:
matrix:
linter-env: ["linting", "type_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
python-version: "3.14"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run ${{ matrix.linter-env }} via Tox
uv sync --group ${{ matrix.linter-env }}
- name: Run pylint
if: matrix.linter-env == 'linting'
run: |
tox -e ${{ matrix.linter-env }}
uv run pylint src/generics
uv run pylint unittests --rcfile=unittests/.pylintrc
- name: Run mypy
if: matrix.linter-env == 'type_check'
run: |
uv run mypy --show-error-codes src/generics
uv run mypy --show-error-codes --enable-incomplete-feature=NewGenericSyntax unittests
19 changes: 10 additions & 9 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ jobs:
os: [ubuntu-latest]
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: Run the Unit Tests via Tox
uv sync --group tests
- name: Run the Unit Tests (py3.10/3.11)
if: matrix.python-version == '3.10' || matrix.python-version == '3.11'
run: |
TOXENV=tests-py${{ matrix.python-version }}
TOXENV=${TOXENV//.}
echo "Running the unit tests via Tox with the environment $TOXENV"
tox -e $TOXENV
uv run pytest --ignore=unittests/test_py_312.py
- name: Run the Unit Tests
if: matrix.python-version != '3.10' && matrix.python-version != '3.11'
run: |
uv run pytest
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,4 @@ dmypy.json
# vscode settings
.vscode/

src/_your_package_version.py
src/_generics_version.py
8 changes: 6 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.10.0
rev: 26.5.1
hooks:
- id: black
language_version: python3
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 8.0.1
hooks:
- id: isort
name: isort (python)
Expand All @@ -22,3 +22,7 @@ repos:
- id: isort
name: isort (pyi)
types: [pyi]
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.11.32
hooks:
- id: uv-lock
42 changes: 26 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,48 @@ classifiers = [
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [] # add all the dependencies from requirements.in here, too
dependencies = []
dynamic = ["readme", "version"]

[project.optional-dependencies]
[project.urls]
Changelog = "https://github.com/Hochfrequenz/python-generics/releases"
Homepage = "https://github.com/Hochfrequenz/python-generics"

[dependency-groups]
tests = [
"pydantic==2.13.4",
"pytest==9.1.1"
]
coverage = [
"coverage==7.15.2"
"coverage==7.15.2",
{include-group = "tests"}
]
formatting = [
"black==26.5.1",
"isort==8.0.1"
]
linting = [
"pylint==4.0.6"
"pylint==4.0.6",
{include-group = "tests"}
]
spellcheck = [
"codespell==2.4.3"
]
test_packaging = [
"build==1.5.1",
"twine==6.2.0"
]
tests = [
"pydantic==2.13.4",
"pytest==9.1.1"
]
type_check = [
"mypy==2.3.0"
"mypy==2.3.0",
{include-group = "tests"}
]
dev = [
{include-group = "tests"},
{include-group = "linting"},
{include-group = "type_check"},
{include-group = "coverage"},
{include-group = "formatting"},
"pre-commit"
]

[project.urls]
Changelog = "https://github.com/Hochfrequenz/python-generics/releases"
Homepage = "https://github.com/Hochfrequenz/python-generics"
[tool.uv]
default-groups = []

[tool.black]
line-length = 120
Expand Down
Empty file removed requirements.in
Empty file.
6 changes: 0 additions & 6 deletions requirements.txt

This file was deleted.

89 changes: 0 additions & 89 deletions tox.ini

This file was deleted.

Loading
Loading