Conversation
cac62ad to
0926a5e
Compare
f5fb64d to
e453862
Compare
There was a problem hiding this comment.
Pull request overview
This PR modernizes the django-fieldsignals package by migrating from setup.py to pyproject.toml-based packaging, adding comprehensive type hints throughout the codebase, and updating CI/CD infrastructure. The changes aim to improve maintainability, provide better IDE support through type annotations, and support contemporary Python and Django versions.
Key changes:
- Migrated packaging from setup.py to pyproject.toml following PEP 621 standards
- Added comprehensive type hints with mypy strict mode and py.typed marker for type checking support
- Updated supported versions to Python 3.8-3.13 and Django 4.2+, with references to unreleased Django 5.2/6.0 (needs correction)
Reviewed changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Complete migration to modern pyproject.toml with build configuration, dependencies, and tool settings for ruff, mypy, and pytest. References Django 5.2/6.0 which don't exist yet. |
| setup.py | Removed in favor of pyproject.toml |
| tox.ini | Updated test matrix for Python 3.8-3.13 and Django 4.2/5.2/6.0, added mypy environment. References nonexistent Django versions. |
| fieldsignals/signals.py | Added comprehensive type hints with TYPE_CHECKING imports, updated to use f-strings, and modernized super() calls |
| fieldsignals/tests/test_signals.py | Added type hints to all test functions and helper classes, changed tuple to list for fields parameters, replaced django.utils.timezone.utc with datetime.timezone.utc |
| fieldsignals/init.py | Added type imports, all export list, and changed version to string format |
| fieldsignals/tests/settings.py | New minimal Django settings file for testing and django-stubs |
| fieldsignals/tests/init.py | Removed test exports since pytest discovers tests automatically |
| fieldsignals/py.typed | New empty marker file indicating the package supports type checking |
| MANIFEST.in | Removed (no longer needed with pyproject.toml) |
| CLAUDE.md | New documentation file with project overview and command reference |
| .gitignore | Added entries for ruff cache, uv.lock, and Claude settings |
| .github/workflows/test.yml | Updated to use uv for dependency management, added separate lint job, updated action versions, and expanded Python version matrix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| [tool.setuptools.packages.find] | ||
| include = ["fieldsignals*"] | ||
|
|
There was a problem hiding this comment.
The py.typed marker file needs to be explicitly included in the package. Add a [tool.setuptools.package-data] section with: fieldsignals = ["py.typed"] to ensure the type marker is included in the distribution. Without this, type checkers won't recognize this package as typed.
| [tool.setuptools.package-data] | |
| fieldsignals = ["py.typed"] |
| "Programming Language :: Python :: 3.8", | ||
| "Programming Language :: Python :: 3.10", |
There was a problem hiding this comment.
Missing Python 3.9 and 3.11 classifiers. The project should either include these versions in testing and classifiers, or explicitly document why they are skipped.
| "Programming Language :: Python :: 3.8", | |
| "Programming Language :: Python :: 3.10", | |
| "Programming Language :: Python :: 3.8", | |
| "Programming Language :: Python :: 3.9", | |
| "Programming Language :: Python :: 3.10", | |
| "Programming Language :: Python :: 3.11", |
Uh oh!
There was an error while loading. Please reload this page.