Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
556cf61
remove unused decorators
LostInDarkMath Feb 9, 2026
a42a6b4
added task file
LostInDarkMath Feb 14, 2026
d2bfbf6
CI: install task
LostInDarkMath Feb 14, 2026
ff81141
CI: added a check that CHANGELOG.md is modified on feature branches
LostInDarkMath Feb 14, 2026
f9d62d7
CI: added a check that the poetry package version was updated
LostInDarkMath Feb 14, 2026
0811ef0
added ruff linter and apply some lints
LostInDarkMath Feb 14, 2026
67cabea
fixed some ruff lints
LostInDarkMath Mar 6, 2026
50ca878
removed unused decorators
LostInDarkMath Mar 6, 2026
0102ba1
removed GenericMixin.type_var
LostInDarkMath Mar 6, 2026
e66df11
fix ruff lints
LostInDarkMath Mar 14, 2026
7e86f74
fix tests
LostInDarkMath Mar 15, 2026
2002b6e
ad support for collections.abc types
LostInDarkMath Apr 3, 2026
2b92481
removed composite validator
LostInDarkMath Apr 3, 2026
5e3a7fc
add CRLF check
LostInDarkMath Apr 3, 2026
a53c660
updated dependencies and add CI check
LostInDarkMath Apr 3, 2026
7d3573e
test lock file out of sync
LostInDarkMath Apr 9, 2026
99bdc6e
Update poetry.lock
LostInDarkMath Apr 9, 2026
24235a0
update github action checkout to v6
LostInDarkMath Apr 9, 2026
f11d501
update github action setup-python
LostInDarkMath Apr 9, 2026
5c61578
added deptry check
LostInDarkMath May 13, 2026
2be86f5
fix deptry
LostInDarkMath May 13, 2026
a3b1d2b
refactor @trace
LostInDarkMath May 13, 2026
d6a3cb9
refactor decorators
LostInDarkMath May 22, 2026
cf252f1
update README and packages
LostInDarkMath Jun 11, 2026
3ce4e0e
cleanup
LostInDarkMath Jun 11, 2026
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
146 changes: 102 additions & 44 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,114 @@
name: Python Tests

on:
push:
push:
branches:
- '*'

permissions:
contents: read

jobs:
test:
feature-branch-checks:
# these checks do not run this on master itself
if: github.ref != 'refs/heads/master'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # we need history to diff properly

- &install-task # define a YAML anchor to re-use this task in other jobs
name: Install task to make use of Taskfile.yml
run: |
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
task --version

- name: Check for CRLF line endings
run: |
task list-crlf

- name: Check poetry.lock is up to date
run: |
pip install poetry
task check-lock

- name: Check dependencies in pyproject.toml have no issues
run: |
task dependencies-with-pip
task check-deps

- name: Verify CHANGELOG.md was updated
run: |
task check-changelog

- name: Verify that the package version was updated. This is needed because master is automatically deployed to pypi.org
run: |
task check-version

- name: Run code linter
run: |
pip install ruff
task lint

test:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
needs: feature-branch-checks
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11, 3.12, 3.13, 3.14]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
check-latest: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U coveralls
pip install -e .[dev]
- name: Run tests with pytest
run: |
pytest --doctest-modules --cov=pedantic --cov-branch --cov-report= --cov-report=term
- name: Coveralls
uses: coverallsapp/github-action@v2.3.6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: .coverage
deploy:
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
environment:
name: pypi-deployment
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install Build Tools
run: |
pip install -U build twine
- name: Set Twine Environment Variables
run: |
echo "TWINE_USERNAME=${{ secrets.PYPI_USERNAME }}" >> $GITHUB_ENV
echo "TWINE_PASSWORD=${{ secrets.PYPI_PASSWORD }}" >> $GITHUB_ENV
- name: Build and Upload to PyPI
run: |
python -m build
twine upload dist/*
- uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
check-latest: true

- *install-task # see above

- name: Install dependencies
run: |
task dependencies-with-pip
pip install -U coveralls

- name: Run tests with pytest
run: |
task tests-with-cov

- name: Coveralls
uses: coverallsapp/github-action@v2.3.6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: .coverage

Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
deploy:
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
environment:
name: pypi-deployment
steps:
- uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.12

- name: Install Build Tools
run: |
pip install -U build twine

- name: Set Twine Environment Variables
run: |
echo "TWINE_USERNAME=${{ secrets.PYPI_USERNAME }}" >> $GITHUB_ENV
echo "TWINE_PASSWORD=${{ secrets.PYPI_PASSWORD }}" >> $GITHUB_ENV

- name: Build and Upload to PyPI
run: |
python -m build
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
twine upload dist/*
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,33 @@
# Changelog
## Pedantic 3.0.0
- removed decorator `@count_calls`
- removed decorator `@does_same_as_function`
- removed decorator `@mock`
- removed decorator `@pedantic_require_docstring`. Use `@pedantic(require_docstring=True)` instead.
- removed decorator `@pedantic_class_require_docstring`.
- removed decorator `@rename_kwargs`
- removed decorator `@require_kwargs`
- removed decorator `@timer`
- removed decorator `@timer_class`
- removed decorator `@trace_class`. Use `@trace` instead.
- removed decorator `@uminplemented`
- removed decorator `@trace_if_returns`
- removed decorator `@pedantic_class`. Use `@pedantic` instead
- removed validator `Composite`. Just pass multiple validators directly instead.
- removed `enable_pedantic, disable_pedantic, is_enabled`
- removed `GenericMixin.type_var`. Use `GenericMixin.type_vars` instead.
- removed `GenericMixin.class_name`. Use `type(self).__name__` instead.
- added `Taskfile.yml` and use it in CI
- removed `create_pdoc.sh`
- removed `examples`
- CI: added a check that `CHANGELOG.md` is modified on feature branches
- CI: added a check that the poetry package version was updated
- added `ruff` linter and apply lint rules to code
- added helper function `run_doctest_of_single_function`
- added type checking support for `collections.abc: Generator, Iterable, Iterator, Callable`
- improved typing warnings of `@frozen_dataclass`. Added stub type `FrozenDataclass` to make `copy_with()` known by type checkers.
- updated `README.md`

## Pedantic 2.4.0
- migrate from unittest to pytest
- exclude tests from package deployment
Expand Down
Loading