Headline changes
-
mypy 1.4: Recommended mypy version updated to 1.4.x
-
Support for
django-split-settings
,django-configurations
and other Django settings addons withstrict_settings = false
option, see README for details -
We have now adopted mypy's stubtest to automatically find discrepancies between Django and django-stubs.
If you want to contribute to django-stubs but are not sure where to start, have a look at stubtest's TODO list file, which lists the many issues discovered by stubtest.
Django 4.2 changes
- Applied Django 4.2 deprecations by @Alexerson in #1523
- Updated global settings and
AppConfig
class to match Django 4.2 by @Alexerson in #1524 - Added types for new 'system checks' in Django 4.2 by @Alexerson in #1526
- Added
ManifestStaticFilesStorage
new parameters by @Alexerson in #1528 - Added new methods to
Sitemap
class by @Alexerson in #1527 - Added new
headers=
parameter to(Async)RequestFactory
and(Async)Client
classes by @Alexerson in #1529 - GDAL-related GeoDjango updates in Django 4.2 by @Alexerson in #1525
- Added ORM
^
and~
operator support, JSON lookup classes, Postgres lookup classes,ModelForm
changes,json_script
template filter parameters by @Alexerson in #1536 - Added and updated
db.backends
DatabaseIntrospection
andDatabaseOperations
classes by @GabDug in #1571
Stubs additions
- Added
QuerySet._result_cache
attribute and_fetch_all()
method by @adamchainz in #1505 - Added
ModelAdmin.search_help_text
attribute by @adamchainz in #1546 - Added email console handler
EmailBackend.write_message()
method by @adamchainz in #1547 - Added
ModelAdmin.get_formset_kwargs()
method by @adamchainz in #1545 - Added
Signal._live_receivers()
method by @adamchainz in #1551 - Added
SQLCompiler._order_by_pairs()
method by @adamchainz in #1586 - Added
memcache_key_warnings()
function by @rvanlaar in #1562
Stubs fixes
- Fixed
create_model_instance
incorrect data argument type by @namper in #1521 - Marked
RequestSite.{save,delete}
methods asNoReturn
since they always raise by @sobolevn in #1530 - Updated
SafeExceptionReporterFilter
attributes and removed obsoleteCLEANSED_SUBSTITUTE
by @mthuurne in #1540 - Changed
AppConfig.default_auto_field
to attribute instead of method by @mthuurne in #1541 - Fixed
default_error_messages
attribute type of baseField
andGenericIPAddressField
classes by @asottile in #1538 - Improved spatialite
DatabaseWrapper
attributes by @filbasi in #1544 - Improved types for Signal
dispatch.dispatcher
by @GabDug in #1567 - Accept
str
field names forWindow.order_by()
, allowNone
forasc/desc
arguments by @GabDug in #1574 - Updated many
django.utils.*
types from stubtest by @GabDug in #1575 - Updated many
db.migrations.operations
types from stubtest by @GabDug in #1583 - Added
StepValueValidator
, fixed argument forSRIDCacheEntry
/EmailValidator
, improvedurls.resolvers
types by @GabDug in #1589
Plugin changes
- Fixed
ForeignKey
queryset filters on un-swapped models by @UnknownPlatypus in #1495 - Add
strict_settings
option, allow runtime fallbacks for custom settings by @sobolevn in #1557 - Automatically reset mypy cache when plugin settings change by @sobolevn in #1578
- Fixed unhandled exception
KeyError: 'model_bases'
and related errors by @intgr in #1563
django-stubs-ext
CI/testing
- CI: Replace isort with Ruff import sorting by @intgr in #1507
- CI: Auto-remove unused imports using Ruff by @intgr in #1508
- CI: Enable Ruff pyupgrade fixes by @intgr in #1509
- CI: Run django-stubs-ext tests in full build matrix by @intgr in #1552
- Remove typecheck test and clean things up by @sobolevn in #1556
- Add stubtest with lots of errors (currently) by @sobolevn in #1560
Housekeeping
- Removed unsupported Django versions from package classifiers by @intgr in #1553
- Removed try-except around import of
ArrayField
by @sobolevn in #1558 - Removed usage of
mypy_extensions
by @sobolevn in #1566 - Upgrade to Mypy 1.4.0 by @christianbundy in #1572
- Chore: set Black Python target to 3.8+ explicitely by @GabDug in #1573
- Update
flake8
plugins by @sobolevn in #1579 - CI: Run tests and pre-commit using newest Python version by @intgr in #1582
- Removed duplicate "import all" test file by @adamchainz in #1587
- Update compatible-mypy to 1.4.x by @intgr in #1588
- Version 4.2.2 release (django-stubs, django-stubs-ext) by @intgr in #1590
New Contributors
- @namper made their first contribution in #1521
- @filbasi made their first contribution in #1544
- @GabDug made their first contribution in #1567
- @rvanlaar made their first contribution in #1562
Full Changelog: 4.2.1...4.2.2