diff --git a/django-stubs/contrib/admin/__init__.pyi b/django-stubs/contrib/admin/__init__.pyi index aa7f4841c..486e4c753 100644 --- a/django-stubs/contrib/admin/__init__.pyi +++ b/django-stubs/contrib/admin/__init__.pyi @@ -24,26 +24,26 @@ from .sites import site as site def autodiscover() -> None: ... __all__ = [ - "action", - "display", - "register", - "ModelAdmin", "HORIZONTAL", "VERTICAL", - "StackedInline", - "TabularInline", "AdminSite", - "site", - "ListFilter", - "SimpleListFilter", - "FieldListFilter", + "AllValuesFieldListFilter", "BooleanFieldListFilter", - "RelatedFieldListFilter", "ChoicesFieldListFilter", "DateFieldListFilter", - "AllValuesFieldListFilter", "EmptyFieldListFilter", + "FieldListFilter", + "ListFilter", + "ModelAdmin", + "RelatedFieldListFilter", "RelatedOnlyFieldListFilter", "ShowFacets", + "SimpleListFilter", + "StackedInline", + "TabularInline", + "action", "autodiscover", + "display", + "register", + "site", ] diff --git a/django-stubs/contrib/gis/admin/__init__.pyi b/django-stubs/contrib/gis/admin/__init__.pyi index 38f226b07..64b510fc5 100644 --- a/django-stubs/contrib/gis/admin/__init__.pyi +++ b/django-stubs/contrib/gis/admin/__init__.pyi @@ -15,6 +15,7 @@ __all__ = [ "HORIZONTAL", "VERTICAL", "AdminSite", + "GISModelAdmin", "ModelAdmin", "StackedInline", "TabularInline", @@ -23,5 +24,4 @@ __all__ = [ "display", "register", "site", - "GISModelAdmin", ] diff --git a/django-stubs/contrib/gis/db/models/__init__.pyi b/django-stubs/contrib/gis/db/models/__init__.pyi index 305a2a289..67ca297d8 100644 --- a/django-stubs/contrib/gis/db/models/__init__.pyi +++ b/django-stubs/contrib/gis/db/models/__init__.pyi @@ -15,119 +15,119 @@ from django.contrib.gis.db.models.fields import RasterField as RasterField from django.db.models import * __all__ = [ + "BLANK_CHOICE_DASH", + "CASCADE", + "DEFERRED", + "DO_NOTHING", + "NOT_PROVIDED", + "PROTECT", + "RESTRICT", + "SET", + "SET_DEFAULT", + "SET_NULL", "Aggregate", + "AutoField", "Avg", - "Count", - "Max", - "Min", - "StdDev", - "Sum", - "Variance", "BaseConstraint", - "CheckConstraint", - "Deferrable", - "UniqueConstraint", - "Choices", - "IntegerChoices", - "TextChoices", - "AutoField", - "BLANK_CHOICE_DASH", "BigAutoField", "BigIntegerField", "BinaryField", "BooleanField", + "Case", "CharField", + "CheckConstraint", + "Choices", + "Collect", "CommaSeparatedIntegerField", + "CompositePrimaryKey", + "Count", "DateField", "DateTimeField", "DecimalField", + "Deferrable", "DurationField", "EmailField", "Empty", + "Exists", + "Expression", + "ExpressionList", + "ExpressionWrapper", + "Extent", + "Extent3D", + "F", "Field", + "FileField", "FilePathField", + "FilteredRelation", "FloatField", + "ForeignKey", + "ForeignObject", + "ForeignObjectRel", + "Func", + "GeneratedField", "GenericIPAddressField", + "GeometryCollectionField", + "GeometryField", "IPAddressField", + "ImageField", + "Index", + "IntegerChoices", "IntegerField", - "NOT_PROVIDED", + "JSONField", + "LineStringField", + "Lookup", + "MakeLine", + "Manager", + "ManyToManyField", + "ManyToManyRel", + "ManyToOneRel", + "Max", + "Min", + "Model", + "MultiLineStringField", + "MultiPointField", + "MultiPolygonField", "NullBooleanField", + "ObjectDoesNotExist", + "OneToOneField", + "OneToOneRel", + "OrderBy", + "OrderWrt", + "OuterRef", + "PointField", + "PolygonField", "PositiveBigIntegerField", "PositiveIntegerField", "PositiveSmallIntegerField", + "Prefetch", + "ProtectedError", + "Q", + "QuerySet", + "RasterField", + "RestrictedError", + "RowRange", "SlugField", "SmallAutoField", "SmallIntegerField", + "StdDev", + "Subquery", + "Sum", + "TextChoices", "TextField", "TimeField", + "Transform", "URLField", "UUIDField", - "Index", - "ObjectDoesNotExist", - "signals", - "CASCADE", - "DO_NOTHING", - "PROTECT", - "RESTRICT", - "SET", - "SET_DEFAULT", - "SET_NULL", - "ProtectedError", - "RestrictedError", - "Case", - "CompositePrimaryKey", - "Exists", - "Expression", - "ExpressionList", - "ExpressionWrapper", - "F", - "Func", - "OrderBy", - "OuterRef", - "RowRange", - "Subquery", + "Union", + "UniqueConstraint", "Value", "ValueRange", + "Variance", "When", "Window", "WindowFrame", "WindowFrameExclusion", - "FileField", - "ImageField", - "GeneratedField", - "JSONField", - "OrderWrt", - "Lookup", - "Transform", - "Manager", - "Prefetch", - "Q", - "QuerySet", "aprefetch_related_objects", "prefetch_related_objects", - "DEFERRED", - "Model", - "FilteredRelation", - "ForeignKey", - "ForeignObject", - "OneToOneField", - "ManyToManyField", - "ForeignObjectRel", - "ManyToOneRel", - "ManyToManyRel", - "OneToOneRel", - "Collect", - "Extent", - "Extent3D", - "MakeLine", - "Union", - "GeometryCollectionField", - "GeometryField", - "LineStringField", - "MultiLineStringField", - "MultiPointField", - "MultiPolygonField", - "PointField", - "PolygonField", - "RasterField", + "signals", ] diff --git a/django-stubs/contrib/gis/gdal/__init__.pyi b/django-stubs/contrib/gis/gdal/__init__.pyi index a1bb97b3d..d21c1ac52 100644 --- a/django-stubs/contrib/gis/gdal/__init__.pyi +++ b/django-stubs/contrib/gis/gdal/__init__.pyi @@ -15,19 +15,19 @@ from django.contrib.gis.gdal.srs import CoordTransform as CoordTransform from django.contrib.gis.gdal.srs import SpatialReference as SpatialReference __all__ = ( + "GDAL_VERSION", "AxisOrder", - "Driver", - "DataSource", "CoordTransform", + "DataSource", + "Driver", "Envelope", "GDALException", "GDALRaster", - "GDAL_VERSION", - "OGRGeometry", "OGRGeomType", - "SpatialReference", + "OGRGeometry", "SRSException", + "SpatialReference", "check_err", - "gdal_version", "gdal_full_version", + "gdal_version", ) diff --git a/django-stubs/contrib/gis/geos/io.pyi b/django-stubs/contrib/gis/geos/io.pyi index c4f6ade06..349c0d5f2 100644 --- a/django-stubs/contrib/gis/geos/io.pyi +++ b/django-stubs/contrib/gis/geos/io.pyi @@ -9,4 +9,4 @@ class WKBReader(_WKBReader): class WKTReader(_WKTReader): def read(self, wkt: bytes | str) -> GEOSGeometry: ... -__all__ = ["WKBWriter", "WKTWriter", "WKBReader", "WKTReader"] +__all__ = ["WKBReader", "WKBWriter", "WKTReader", "WKTWriter"] diff --git a/django-stubs/contrib/gis/geos/prototypes/misc.pyi b/django-stubs/contrib/gis/geos/prototypes/misc.pyi index 09f7e788f..c7970793b 100644 --- a/django-stubs/contrib/gis/geos/prototypes/misc.pyi +++ b/django-stubs/contrib/gis/geos/prototypes/misc.pyi @@ -11,4 +11,4 @@ geos_distance: Any geos_length: Any geos_isvalidreason: Any -__all__ = ["geos_area", "geos_distance", "geos_length", "geos_isvalidreason"] +__all__ = ["geos_area", "geos_distance", "geos_isvalidreason", "geos_length"] diff --git a/django-stubs/contrib/gis/utils/__init__.pyi b/django-stubs/contrib/gis/utils/__init__.pyi index bb0792dea..deed1e7ab 100644 --- a/django-stubs/contrib/gis/utils/__init__.pyi +++ b/django-stubs/contrib/gis/utils/__init__.pyi @@ -5,4 +5,4 @@ from django.contrib.gis.utils.ogrinspect import mapping as mapping from django.contrib.gis.utils.ogrinspect import ogrinspect as ogrinspect from django.contrib.gis.utils.srs import add_srs_entry as add_srs_entry -__all__ = ["add_srs_entry", "mapping", "ogrinfo", "ogrinspect", "LayerMapError", "LayerMapping"] +__all__ = ["LayerMapError", "LayerMapping", "add_srs_entry", "mapping", "ogrinfo", "ogrinspect"] diff --git a/django-stubs/contrib/messages/api.pyi b/django-stubs/contrib/messages/api.pyi index 2dc0c6319..d5585efbe 100644 --- a/django-stubs/contrib/messages/api.pyi +++ b/django-stubs/contrib/messages/api.pyi @@ -48,14 +48,14 @@ def error( ) -> None: ... __all__ = ( + "MessageFailure", "add_message", - "get_messages", - "get_level", - "set_level", "debug", + "error", + "get_level", + "get_messages", "info", + "set_level", "success", "warning", - "error", - "MessageFailure", ) diff --git a/django-stubs/contrib/postgres/aggregates/statistics.pyi b/django-stubs/contrib/postgres/aggregates/statistics.pyi index 626bc2fa8..38f6381eb 100644 --- a/django-stubs/contrib/postgres/aggregates/statistics.pyi +++ b/django-stubs/contrib/postgres/aggregates/statistics.pyi @@ -29,16 +29,16 @@ class RegrSXY(StatAggregate): ... class RegrSYY(StatAggregate): ... __all__ = [ - "CovarPop", "Corr", + "CovarPop", "RegrAvgX", "RegrAvgY", "RegrCount", "RegrIntercept", "RegrR2", - "RegrSlope", "RegrSXX", "RegrSXY", "RegrSYY", + "RegrSlope", "StatAggregate", ] diff --git a/django-stubs/contrib/postgres/fields/ranges.pyi b/django-stubs/contrib/postgres/fields/ranges.pyi index 434fc0875..53c7b7887 100644 --- a/django-stubs/contrib/postgres/fields/ranges.pyi +++ b/django-stubs/contrib/postgres/fields/ranges.pyi @@ -91,12 +91,12 @@ class UpperInfinite(models.Transform): output_field: ClassVar[models.BooleanField] __all__ = [ - "RangeField", - "IntegerRangeField", "BigIntegerRangeField", - "DecimalRangeField", - "DateTimeRangeField", "DateRangeField", + "DateTimeRangeField", + "DecimalRangeField", + "IntegerRangeField", "RangeBoundary", + "RangeField", "RangeOperators", ] diff --git a/django-stubs/contrib/postgres/forms/ranges.pyi b/django-stubs/contrib/postgres/forms/ranges.pyi index ea49e0d47..25b52824e 100644 --- a/django-stubs/contrib/postgres/forms/ranges.pyi +++ b/django-stubs/contrib/postgres/forms/ranges.pyi @@ -43,10 +43,10 @@ class DateRangeField(BaseRangeField): __all__ = [ "BaseRangeField", - "IntegerRangeField", - "DecimalRangeField", - "DateTimeRangeField", "DateRangeField", + "DateTimeRangeField", + "DecimalRangeField", "HiddenRangeWidget", + "IntegerRangeField", "RangeWidget", ] diff --git a/django-stubs/contrib/postgres/indexes.pyi b/django-stubs/contrib/postgres/indexes.pyi index 2bb5649c0..8a0788dcd 100644 --- a/django-stubs/contrib/postgres/indexes.pyi +++ b/django-stubs/contrib/postgres/indexes.pyi @@ -121,4 +121,4 @@ class OpClass(Func): name: str, ) -> None: ... -__all__ = ["BloomIndex", "BrinIndex", "BTreeIndex", "GinIndex", "GistIndex", "HashIndex", "SpGistIndex"] +__all__ = ["BTreeIndex", "BloomIndex", "BrinIndex", "GinIndex", "GistIndex", "HashIndex", "SpGistIndex"] diff --git a/django-stubs/core/cache/__init__.pyi b/django-stubs/core/cache/__init__.pyi index 7d4de9592..8cd7d3a9f 100644 --- a/django-stubs/core/cache/__init__.pyi +++ b/django-stubs/core/cache/__init__.pyi @@ -22,11 +22,11 @@ caches: CacheHandler cache: BaseCache __all__ = [ - "cache", - "caches", "DEFAULT_CACHE_ALIAS", - "InvalidCacheBackendError", - "CacheKeyWarning", "BaseCache", + "CacheKeyWarning", + "InvalidCacheBackendError", "InvalidCacheKey", + "cache", + "caches", ] diff --git a/django-stubs/core/checks/__init__.pyi b/django-stubs/core/checks/__init__.pyi index c3a61b6ea..d4ecedde1 100644 --- a/django-stubs/core/checks/__init__.pyi +++ b/django-stubs/core/checks/__init__.pyi @@ -16,19 +16,19 @@ from .registry import run_checks as run_checks from .registry import tag_exists as tag_exists __all__ = [ + "CRITICAL", + "DEBUG", + "ERROR", + "INFO", + "WARNING", "CheckMessage", + "Critical", "Debug", + "Error", "Info", + "Tags", "Warning", - "Error", - "Critical", - "DEBUG", - "INFO", - "WARNING", - "ERROR", - "CRITICAL", "register", "run_checks", "tag_exists", - "Tags", ] diff --git a/django-stubs/core/files/locks.pyi b/django-stubs/core/files/locks.pyi index ac29be860..99bb3fc28 100644 --- a/django-stubs/core/files/locks.pyi +++ b/django-stubs/core/files/locks.pyi @@ -16,4 +16,4 @@ if sys.platform == "win32": def lock(f: Any, flags: int) -> bool: ... def unlock(f: Any) -> bool: ... -__all__ = ("LOCK_EX", "LOCK_SH", "LOCK_NB", "lock", "unlock") +__all__ = ("LOCK_EX", "LOCK_NB", "LOCK_SH", "lock", "unlock") diff --git a/django-stubs/core/files/storage/__init__.pyi b/django-stubs/core/files/storage/__init__.pyi index d141d1ca8..4bf3f44d8 100644 --- a/django-stubs/core/files/storage/__init__.pyi +++ b/django-stubs/core/files/storage/__init__.pyi @@ -6,13 +6,13 @@ from .handler import InvalidStorageError, StorageHandler from .memory import InMemoryStorage __all__ = ( + "DefaultStorage", "FileSystemStorage", "InMemoryStorage", - "Storage", - "DefaultStorage", - "default_storage", "InvalidStorageError", + "Storage", "StorageHandler", + "default_storage", "storages", ) diff --git a/django-stubs/core/files/uploadedfile.pyi b/django-stubs/core/files/uploadedfile.pyi index 69e83821a..26492e877 100644 --- a/django-stubs/core/files/uploadedfile.pyi +++ b/django-stubs/core/files/uploadedfile.pyi @@ -50,8 +50,8 @@ class SimpleUploadedFile(InMemoryUploadedFile): def from_dict(cls, file_dict: dict[str, str | bytes]) -> Self: ... __all__ = ( - "UploadedFile", - "TemporaryUploadedFile", "InMemoryUploadedFile", "SimpleUploadedFile", + "TemporaryUploadedFile", + "UploadedFile", ) diff --git a/django-stubs/core/files/uploadhandler.pyi b/django-stubs/core/files/uploadhandler.pyi index 334f0cd98..c1ca5daea 100644 --- a/django-stubs/core/files/uploadhandler.pyi +++ b/django-stubs/core/files/uploadhandler.pyi @@ -86,12 +86,12 @@ class MemoryFileUploadHandler(FileUploadHandler): def load_handler(path: str, *args: Any, **kwargs: Any) -> FileUploadHandler: ... __all__ = [ - "UploadFileException", - "StopUpload", - "SkipFile", "FileUploadHandler", - "TemporaryFileUploadHandler", "MemoryFileUploadHandler", - "load_handler", + "SkipFile", "StopFutureHandlers", + "StopUpload", + "TemporaryFileUploadHandler", + "UploadFileException", + "load_handler", ] diff --git a/django-stubs/core/mail/__init__.pyi b/django-stubs/core/mail/__init__.pyi index 93e61c778..8057423d4 100644 --- a/django-stubs/core/mail/__init__.pyi +++ b/django-stubs/core/mail/__init__.pyi @@ -53,21 +53,21 @@ def mail_managers( outbox: list[EmailMessage] __all__ = [ - "CachedDnsName", + "DEFAULT_ATTACHMENT_MIME_TYPE", "DNS_NAME", + "BadHeaderError", + "CachedDnsName", + "EmailAlternative", + "EmailAttachment", "EmailMessage", "EmailMultiAlternatives", - "SafeMIMEText", "SafeMIMEMultipart", - "DEFAULT_ATTACHMENT_MIME_TYPE", - "make_msgid", - "BadHeaderError", + "SafeMIMEText", "forbid_multi_line_headers", "get_connection", - "send_mail", - "send_mass_mail", "mail_admins", "mail_managers", - "EmailAlternative", - "EmailAttachment", + "make_msgid", + "send_mail", + "send_mass_mail", ] diff --git a/django-stubs/core/servers/basehttp.pyi b/django-stubs/core/servers/basehttp.pyi index 81faaaf65..62bf4576e 100644 --- a/django-stubs/core/servers/basehttp.pyi +++ b/django-stubs/core/servers/basehttp.pyi @@ -46,4 +46,4 @@ def run( server_cls: type[WSGIServer] = ..., ) -> None: ... -__all__ = ("WSGIServer", "WSGIRequestHandler") +__all__ = ("WSGIRequestHandler", "WSGIServer") diff --git a/django-stubs/db/__init__.pyi b/django-stubs/db/__init__.pyi index c2f2ff665..d8f9e3e9e 100644 --- a/django-stubs/db/__init__.pyi +++ b/django-stubs/db/__init__.pyi @@ -23,20 +23,20 @@ def close_old_connections(**kwargs: Any) -> None: ... def reset_queries(**kwargs: Any) -> None: ... __all__ = [ - "close_old_connections", - "connection", - "connections", - "reset_queries", - "router", + "DEFAULT_DB_ALIAS", + "DJANGO_VERSION_PICKLE_KEY", + "DataError", "DatabaseError", + "Error", "IntegrityError", + "InterfaceError", "InternalError", - "ProgrammingError", - "DataError", "NotSupportedError", - "Error", - "InterfaceError", "OperationalError", - "DEFAULT_DB_ALIAS", - "DJANGO_VERSION_PICKLE_KEY", + "ProgrammingError", + "close_old_connections", + "connection", + "connections", + "reset_queries", + "router", ] diff --git a/django-stubs/db/migrations/operations/__init__.pyi b/django-stubs/db/migrations/operations/__init__.pyi index e5dfea1f9..8d81e3565 100644 --- a/django-stubs/db/migrations/operations/__init__.pyi +++ b/django-stubs/db/migrations/operations/__init__.pyi @@ -23,27 +23,27 @@ from .special import RunSQL as RunSQL from .special import SeparateDatabaseAndState as SeparateDatabaseAndState __all__ = [ - "CreateModel", - "DeleteModel", + "AddConstraint", + "AddField", + "AddIndex", + "AlterConstraint", + "AlterField", + "AlterIndexTogether", + "AlterModelManagers", + "AlterModelOptions", "AlterModelTable", "AlterModelTableComment", + "AlterOrderWithRespectTo", "AlterUniqueTogether", - "RenameModel", - "AlterIndexTogether", - "AlterModelOptions", - "AddIndex", - "RemoveIndex", - "RenameIndex", - "AddField", + "CreateModel", + "DeleteModel", + "RemoveConstraint", "RemoveField", - "AlterField", + "RemoveIndex", "RenameField", - "AddConstraint", - "RemoveConstraint", - "AlterConstraint", - "SeparateDatabaseAndState", - "RunSQL", + "RenameIndex", + "RenameModel", "RunPython", - "AlterOrderWithRespectTo", - "AlterModelManagers", + "RunSQL", + "SeparateDatabaseAndState", ] diff --git a/django-stubs/db/models/__init__.pyi b/django-stubs/db/models/__init__.pyi index 86ec755eb..af7c1af6f 100644 --- a/django-stubs/db/models/__init__.pyi +++ b/django-stubs/db/models/__init__.pyi @@ -103,105 +103,105 @@ from .query_utils import FilteredRelation as FilteredRelation from .query_utils import Q as Q __all__ = [ + "BLANK_CHOICE_DASH", + "CASCADE", + "DEFERRED", + "DO_NOTHING", + "NOT_PROVIDED", + "PROTECT", + "RESTRICT", + "SET", + "SET_DEFAULT", + "SET_NULL", "Aggregate", + "AutoField", "Avg", - "Count", - "Max", - "Min", - "StdDev", - "Sum", - "Variance", "BaseConstraint", - "CheckConstraint", - "Deferrable", - "UniqueConstraint", - "Choices", - "IntegerChoices", - "TextChoices", - "AutoField", - "BLANK_CHOICE_DASH", "BigAutoField", "BigIntegerField", "BinaryField", "BooleanField", + "Case", "CharField", + "CheckConstraint", + "Choices", "CommaSeparatedIntegerField", + "CompositePrimaryKey", + "Count", "DateField", "DateTimeField", "DecimalField", + "Deferrable", "DurationField", "EmailField", "Empty", + "Exists", + "Expression", + "ExpressionList", + "ExpressionWrapper", + "F", "Field", + "FileField", "FilePathField", + "FilteredRelation", "FloatField", + "ForeignKey", + "ForeignObject", + "ForeignObjectRel", + "Func", + "GeneratedField", "GenericIPAddressField", "IPAddressField", + "ImageField", + "Index", + "IntegerChoices", "IntegerField", - "NOT_PROVIDED", + "JSONField", + "Lookup", + "Manager", + "ManyToManyField", + "ManyToManyRel", + "ManyToOneRel", + "Max", + "Min", + "Model", "NullBooleanField", + "ObjectDoesNotExist", + "OneToOneField", + "OneToOneRel", + "OrderBy", + "OrderWrt", + "OuterRef", "PositiveBigIntegerField", "PositiveIntegerField", "PositiveSmallIntegerField", + "Prefetch", + "ProtectedError", + "Q", + "QuerySet", + "RestrictedError", + "RowRange", "SlugField", "SmallAutoField", "SmallIntegerField", + "StdDev", + "Subquery", + "Sum", + "TextChoices", "TextField", "TimeField", + "Transform", "URLField", "UUIDField", - "Index", - "ObjectDoesNotExist", - "signals", - "CASCADE", - "DO_NOTHING", - "PROTECT", - "RESTRICT", - "SET", - "SET_DEFAULT", - "SET_NULL", - "ProtectedError", - "RestrictedError", - "Case", - "CompositePrimaryKey", - "Exists", - "Expression", - "ExpressionList", - "ExpressionWrapper", - "F", - "Func", - "OrderBy", - "OuterRef", - "RowRange", - "Subquery", + "UniqueConstraint", "Value", "ValueRange", + "Variance", "When", "Window", "WindowFrame", "WindowFrameExclusion", - "FileField", - "ImageField", - "GeneratedField", - "JSONField", - "OrderWrt", - "Lookup", - "Transform", - "Manager", - "Prefetch", - "Q", - "QuerySet", "aprefetch_related_objects", "prefetch_related_objects", - "DEFERRED", - "Model", - "FilteredRelation", - "ForeignKey", - "ForeignObject", - "OneToOneField", - "ManyToManyField", - "ForeignObjectRel", - "ManyToOneRel", - "ManyToManyRel", - "OneToOneRel", + "signals", ] diff --git a/django-stubs/db/models/fields/__init__.pyi b/django-stubs/db/models/fields/__init__.pyi index 4a1981b4a..434dcccb9 100644 --- a/django-stubs/db/models/fields/__init__.pyi +++ b/django-stubs/db/models/fields/__init__.pyi @@ -635,8 +635,9 @@ class BigAutoField(AutoFieldMixin, BigIntegerField[_ST, _GT]): ... # type: igno class SmallAutoField(AutoFieldMixin, SmallIntegerField[_ST, _GT]): ... # type: ignore[misc] __all__ = [ - "AutoField", "BLANK_CHOICE_DASH", + "NOT_PROVIDED", + "AutoField", "BigAutoField", "BigIntegerField", "BinaryField", @@ -655,7 +656,6 @@ __all__ = [ "GenericIPAddressField", "IPAddressField", "IntegerField", - "NOT_PROVIDED", "NullBooleanField", "PositiveBigIntegerField", "PositiveIntegerField", diff --git a/django-stubs/db/models/functions/__init__.pyi b/django-stubs/db/models/functions/__init__.pyi index 890c3e4cf..e9d295c25 100644 --- a/django-stubs/db/models/functions/__init__.pyi +++ b/django-stubs/db/models/functions/__init__.pyi @@ -91,101 +91,101 @@ from .window import Rank as Rank from .window import RowNumber as RowNumber __all__ = [ + # text + "MD5", + "SHA1", + "SHA224", + "SHA256", + "SHA384", + "SHA512", + "ACos", + "ASin", + "ATan", + "ATan2", + # math + "Abs", # comparison and conversion "Cast", + "Ceil", + "Chr", "Coalesce", "Collate", - "Greatest", - "Least", - "NullIf", + "Concat", + "ConcatPair", + "Cos", + "Cot", + # window + "CumeDist", + "Degrees", + "DenseRank", + "Exp", # datetime "Extract", "ExtractDay", "ExtractHour", + "ExtractIsoWeekDay", + "ExtractIsoYear", "ExtractMinute", "ExtractMonth", "ExtractQuarter", "ExtractSecond", "ExtractWeek", - "ExtractIsoWeekDay", "ExtractWeekDay", - "ExtractIsoYear", "ExtractYear", - "Now", - "Trunc", - "TruncDate", - "TruncDay", - "TruncHour", - "TruncMinute", - "TruncMonth", - "TruncQuarter", - "TruncSecond", - "TruncTime", - "TruncWeek", - "TruncYear", + "FirstValue", + "Floor", + "Greatest", # json "JSONArray", "JSONObject", - # math - "Abs", - "ACos", - "ASin", - "ATan", - "ATan2", - "Ceil", - "Cos", - "Cot", - "Degrees", - "Exp", - "Floor", + "LPad", + "LTrim", + "Lag", + "LastValue", + "Lead", + "Least", + "Left", + "Length", "Ln", "Log", + "Lower", "Mod", + "Now", + "NthValue", + "Ntile", + "NullIf", + "Ord", + "PercentRank", "Pi", "Power", + "RPad", + "RTrim", "Radians", "Random", - "Round", - "Sign", - "Sin", - "Sqrt", - "Tan", - # text - "MD5", - "SHA1", - "SHA224", - "SHA256", - "SHA384", - "SHA512", - "Chr", - "Concat", - "ConcatPair", - "Left", - "Length", - "Lower", - "LPad", - "LTrim", - "Ord", + "Rank", "Repeat", "Replace", "Reverse", "Right", - "RPad", - "RTrim", + "Round", + "RowNumber", + "Sign", + "Sin", + "Sqrt", "StrIndex", "Substr", + "Tan", "Trim", + "Trunc", + "TruncDate", + "TruncDay", + "TruncHour", + "TruncMinute", + "TruncMonth", + "TruncQuarter", + "TruncSecond", + "TruncTime", + "TruncWeek", + "TruncYear", "Upper", - # window - "CumeDist", - "DenseRank", - "FirstValue", - "Lag", - "LastValue", - "Lead", - "NthValue", - "Ntile", - "PercentRank", - "Rank", - "RowNumber", ] diff --git a/django-stubs/db/models/sql/__init__.pyi b/django-stubs/db/models/sql/__init__.pyi index b8c93b825..796a8991d 100644 --- a/django-stubs/db/models/sql/__init__.pyi +++ b/django-stubs/db/models/sql/__init__.pyi @@ -8,4 +8,4 @@ from .where import AND as AND from .where import OR as OR from .where import XOR as XOR -__all__ = ["Query", "AND", "OR", "XOR"] +__all__ = ["AND", "OR", "XOR", "Query"] diff --git a/django-stubs/db/models/sql/subqueries.pyi b/django-stubs/db/models/sql/subqueries.pyi index b7865ad80..289b9754c 100644 --- a/django-stubs/db/models/sql/subqueries.pyi +++ b/django-stubs/db/models/sql/subqueries.pyi @@ -41,4 +41,4 @@ class AggregateQuery(Query): where: WhereNode where_class: type[WhereNode] -__all__ = ["DeleteQuery", "UpdateQuery", "InsertQuery", "AggregateQuery"] +__all__ = ["AggregateQuery", "DeleteQuery", "InsertQuery", "UpdateQuery"] diff --git a/django-stubs/forms/fields.pyi b/django-stubs/forms/fields.pyi index c9d86d018..07c4a3546 100644 --- a/django-stubs/forms/fields.pyi +++ b/django-stubs/forms/fields.pyi @@ -559,32 +559,32 @@ class JSONField(CharField): def has_changed(self, initial: Any | None, data: Any | None) -> bool: ... __all__ = ( - "Field", + "BooleanField", "CharField", - "IntegerField", + "ChoiceField", + "ComboField", "DateField", - "TimeField", "DateTimeField", + "DecimalField", "DurationField", - "RegexField", "EmailField", + "Field", "FileField", - "ImageField", - "URLField", - "BooleanField", - "NullBooleanField", - "ChoiceField", - "MultipleChoiceField", - "ComboField", - "MultiValueField", + "FilePathField", "FloatField", - "DecimalField", - "SplitDateTimeField", "GenericIPAddressField", - "FilePathField", + "ImageField", + "IntegerField", "JSONField", + "MultiValueField", + "MultipleChoiceField", + "NullBooleanField", + "RegexField", "SlugField", + "SplitDateTimeField", + "TimeField", "TypedChoiceField", "TypedMultipleChoiceField", + "URLField", "UUIDField", ) diff --git a/django-stubs/forms/formsets.pyi b/django-stubs/forms/formsets.pyi index 8d472df64..fbf221118 100644 --- a/django-stubs/forms/formsets.pyi +++ b/django-stubs/forms/formsets.pyi @@ -125,4 +125,4 @@ def formset_factory( ) -> type[BaseFormSet[_F]]: ... def all_valid(formsets: Sequence[BaseFormSet[_F]]) -> bool: ... -__all__ = ("BaseFormSet", "formset_factory", "all_valid") +__all__ = ("BaseFormSet", "all_valid", "formset_factory") diff --git a/django-stubs/forms/models.pyi b/django-stubs/forms/models.pyi index 6ddd4ce82..dd80293dd 100644 --- a/django-stubs/forms/models.pyi +++ b/django-stubs/forms/models.pyi @@ -316,16 +316,16 @@ def _get_foreign_key( ) -> ForeignKey: ... __all__ = ( - "ModelForm", + "ALL_FIELDS", + "BaseInlineFormSet", "BaseModelForm", - "model_to_dict", - "fields_for_model", + "BaseModelFormSet", "ModelChoiceField", + "ModelForm", "ModelMultipleChoiceField", - "ALL_FIELDS", - "BaseModelFormSet", - "modelformset_factory", - "BaseInlineFormSet", + "fields_for_model", "inlineformset_factory", + "model_to_dict", "modelform_factory", + "modelformset_factory", ) diff --git a/django-stubs/forms/widgets.pyi b/django-stubs/forms/widgets.pyi index 0aec27db8..9a3b9c1b5 100644 --- a/django-stubs/forms/widgets.pyi +++ b/django-stubs/forms/widgets.pyi @@ -320,34 +320,34 @@ class SelectDateWidget(Widget): def value_omitted_from_data(self, data: _DataT, files: _FilesT, name: str) -> bool: ... __all__ = ( - "Script", + "CheckboxInput", + "CheckboxSelectMultiple", + "ClearableFileInput", + "ColorInput", + "DateInput", + "DateTimeInput", + "EmailInput", + "FileInput", + "HiddenInput", "Media", "MediaDefiningClass", - "Widget", - "TextInput", + "MultiWidget", + "MultipleHiddenInput", + "NullBooleanSelect", "NumberInput", - "EmailInput", - "URLInput", - "ColorInput", - "SearchInput", - "TelInput", "PasswordInput", - "HiddenInput", - "MultipleHiddenInput", - "FileInput", - "ClearableFileInput", - "Textarea", - "DateInput", - "DateTimeInput", - "TimeInput", - "CheckboxInput", + "RadioSelect", + "Script", + "SearchInput", "Select", - "NullBooleanSelect", + "SelectDateWidget", "SelectMultiple", - "RadioSelect", - "CheckboxSelectMultiple", - "MultiWidget", "SplitDateTimeWidget", "SplitHiddenDateTimeWidget", - "SelectDateWidget", + "TelInput", + "TextInput", + "Textarea", + "TimeInput", + "URLInput", + "Widget", ) diff --git a/django-stubs/http/__init__.pyi b/django-stubs/http/__init__.pyi index 0707caf95..0a37ce1c6 100644 --- a/django-stubs/http/__init__.pyi +++ b/django-stubs/http/__init__.pyi @@ -23,27 +23,27 @@ from .response import JsonResponse as JsonResponse from .response import StreamingHttpResponse as StreamingHttpResponse __all__ = [ - "SimpleCookie", - "parse_cookie", + "BadHeaderError", + "FileResponse", + "Http404", "HttpHeaders", "HttpRequest", - "QueryDict", - "RawPostDataException", - "UnreadablePostError", "HttpResponse", - "HttpResponseBase", - "StreamingHttpResponse", - "HttpResponseRedirect", - "HttpResponsePermanentRedirect", - "HttpResponseNotModified", "HttpResponseBadRequest", + "HttpResponseBase", "HttpResponseForbidden", - "HttpResponseNotFound", - "HttpResponseNotAllowed", "HttpResponseGone", + "HttpResponseNotAllowed", + "HttpResponseNotFound", + "HttpResponseNotModified", + "HttpResponsePermanentRedirect", + "HttpResponseRedirect", "HttpResponseServerError", - "Http404", - "BadHeaderError", "JsonResponse", - "FileResponse", + "QueryDict", + "RawPostDataException", + "SimpleCookie", + "StreamingHttpResponse", + "UnreadablePostError", + "parse_cookie", ] diff --git a/django-stubs/http/multipartparser.pyi b/django-stubs/http/multipartparser.pyi index 2e107f9ff..5cc81c2cf 100644 --- a/django-stubs/http/multipartparser.pyi +++ b/django-stubs/http/multipartparser.pyi @@ -59,4 +59,4 @@ class Parser: def __init__(self, stream: LazyStream, boundary: bytes) -> None: ... def __iter__(self) -> Iterator[tuple[str, dict[str, tuple[str, dict[str, bytes | str]]], LazyStream]]: ... -__all__ = ("MultiPartParser", "MultiPartParserError", "InputStreamExhausted") +__all__ = ("InputStreamExhausted", "MultiPartParser", "MultiPartParserError") diff --git a/django-stubs/template/__init__.pyi b/django-stubs/template/__init__.pyi index 33387bbae..0d192cdb2 100644 --- a/django-stubs/template/__init__.pyi +++ b/django-stubs/template/__init__.pyi @@ -18,4 +18,4 @@ from .utils import EngineHandler as EngineHandler engines: EngineHandler -__all__ = ("Engine", "engines", "Template", "Context", "RequestContext") +__all__ = ("Context", "Engine", "RequestContext", "Template", "engines") diff --git a/django-stubs/test/__init__.pyi b/django-stubs/test/__init__.pyi index 1a4fa297f..0f2404255 100644 --- a/django-stubs/test/__init__.pyi +++ b/django-stubs/test/__init__.pyi @@ -19,17 +19,17 @@ __all__ = [ "AsyncClient", "AsyncRequestFactory", "Client", + "LiveServerTestCase", "RequestFactory", + "SimpleTestCase", "TestCase", "TransactionTestCase", - "SimpleTestCase", - "LiveServerTestCase", - "skipIfDBFeature", - "skipUnlessAnyDBFeature", - "skipUnlessDBFeature", "ignore_warnings", "modify_settings", "override_settings", "override_system_checks", + "skipIfDBFeature", + "skipUnlessAnyDBFeature", + "skipUnlessDBFeature", "tag", ] diff --git a/django-stubs/test/testcases.pyi b/django-stubs/test/testcases.pyi index da03dc694..008d48dd2 100644 --- a/django-stubs/test/testcases.pyi +++ b/django-stubs/test/testcases.pyi @@ -249,4 +249,4 @@ class SerializeMixin: def connections_support_transactions(aliases: Iterable[str] | None = ...) -> bool: ... -__all__ = ("TestCase", "TransactionTestCase", "SimpleTestCase", "skipIfDBFeature", "skipUnlessDBFeature") +__all__ = ("SimpleTestCase", "TestCase", "TransactionTestCase", "skipIfDBFeature", "skipUnlessDBFeature") diff --git a/django-stubs/test/utils.pyi b/django-stubs/test/utils.pyi index ef1c9a8c4..95dca9e0d 100644 --- a/django-stubs/test/utils.pyi +++ b/django-stubs/test/utils.pyi @@ -173,19 +173,19 @@ def garbage_collect() -> None: ... __all__ = ( "Approximate", + "CaptureQueriesContext", "ContextList", - "isolate_lru_cache", "garbage_collect", "get_runner", - "CaptureQueriesContext", "ignore_warnings", "isolate_apps", + "isolate_lru_cache", "modify_settings", "override_settings", "override_system_checks", - "tag", "requires_tz_support", "setup_databases", "setup_test_environment", + "tag", "teardown_test_environment", ) diff --git a/django-stubs/urls/__init__.pyi b/django-stubs/urls/__init__.pyi index 3d2c61c76..0bb0faa3a 100644 --- a/django-stubs/urls/__init__.pyi +++ b/django-stubs/urls/__init__.pyi @@ -42,10 +42,10 @@ _AnyURL: TypeAlias = URLPattern | URLResolver # noqa: PYI047 __all__ = [ "LocalePrefixPattern", "NoReverseMatch", - "URLPattern", - "URLResolver", "Resolver404", "ResolverMatch", + "URLPattern", + "URLResolver", "clear_script_prefix", "clear_url_caches", "get_callable", diff --git a/django-stubs/utils/timezone.pyi b/django-stubs/utils/timezone.pyi index 0ec29c9d0..31c8e909a 100644 --- a/django-stubs/utils/timezone.pyi +++ b/django-stubs/utils/timezone.pyi @@ -39,19 +39,19 @@ def make_aware(value: datetime, timezone: tzinfo | None = None) -> datetime: ... def make_naive(value: datetime, timezone: tzinfo | None = None) -> datetime: ... __all__ = [ - "get_fixed_timezone", - "get_default_timezone", - "get_default_timezone_name", - "get_current_timezone", - "get_current_timezone_name", "activate", "deactivate", - "override", - "localtime", - "localdate", - "now", + "get_current_timezone", + "get_current_timezone_name", + "get_default_timezone", + "get_default_timezone_name", + "get_fixed_timezone", "is_aware", "is_naive", + "localdate", + "localtime", "make_aware", "make_naive", + "now", + "override", ] diff --git a/django-stubs/utils/translation/__init__.pyi b/django-stubs/utils/translation/__init__.pyi index 34c2c8edd..413eea909 100644 --- a/django-stubs/utils/translation/__init__.pyi +++ b/django-stubs/utils/translation/__init__.pyi @@ -50,24 +50,24 @@ def round_away_from_one(value: int) -> int: ... __all__ = [ "activate", + "check_for_language", "deactivate", - "override", "deactivate_all", "get_language", + "get_language_bidi", "get_language_from_request", "get_language_info", - "get_language_bidi", - "check_for_language", - "to_language", - "to_locale", - "templatize", "gettext", "gettext_lazy", "gettext_noop", "ngettext", "ngettext_lazy", - "pgettext", - "pgettext_lazy", "npgettext", "npgettext_lazy", + "override", + "pgettext", + "pgettext_lazy", + "templatize", + "to_language", + "to_locale", ] diff --git a/django-stubs/views/generic/__init__.pyi b/django-stubs/views/generic/__init__.pyi index 92676b0ea..0b818d3f2 100644 --- a/django-stubs/views/generic/__init__.pyi +++ b/django-stubs/views/generic/__init__.pyi @@ -18,21 +18,21 @@ from .list import ListView as ListView class GenericViewError(Exception): ... __all__ = [ - "View", - "TemplateView", - "RedirectView", "ArchiveIndexView", - "YearArchiveView", - "MonthArchiveView", - "WeekArchiveView", - "DayArchiveView", - "TodayArchiveView", + "CreateView", "DateDetailView", + "DayArchiveView", + "DeleteView", "DetailView", "FormView", - "CreateView", - "UpdateView", - "DeleteView", - "ListView", "GenericViewError", + "ListView", + "MonthArchiveView", + "RedirectView", + "TemplateView", + "TodayArchiveView", + "UpdateView", + "View", + "WeekArchiveView", + "YearArchiveView", ] diff --git a/ext/django_stubs_ext/__init__.py b/ext/django_stubs_ext/__init__.py index ba252b8d3..6e6c793aa 100644 --- a/ext/django_stubs_ext/__init__.py +++ b/ext/django_stubs_ext/__init__.py @@ -7,12 +7,12 @@ from .types import AnyAttrAllowed as AnyAttrAllowed __all__ = [ - "monkeypatch", - "QuerySetAny", - "ValuesQuerySet", - "WithAnnotations", "Annotations", "AnyAttrAllowed", - "StrPromise", + "QuerySetAny", "StrOrPromise", + "StrPromise", + "ValuesQuerySet", + "WithAnnotations", + "monkeypatch", ] diff --git a/ext/django_stubs_ext/aliases.py b/ext/django_stubs_ext/aliases.py index a9d0172a4..8d582cf92 100644 --- a/ext/django_stubs_ext/aliases.py +++ b/ext/django_stubs_ext/aliases.py @@ -17,4 +17,4 @@ QuerySetAny = QuerySet ValuesQuerySet = QuerySet -__all__ = ["StrOrPromise", "StrPromise", "QuerySetAny", "ValuesQuerySet"] +__all__ = ["QuerySetAny", "StrOrPromise", "StrPromise", "ValuesQuerySet"] diff --git a/mypy_django_plugin/config.py b/mypy_django_plugin/config.py index be65d1971..ac1c841f3 100644 --- a/mypy_django_plugin/config.py +++ b/mypy_django_plugin/config.py @@ -2,10 +2,12 @@ import os import sys import textwrap -from collections.abc import Callable from functools import partial from pathlib import Path -from typing import Any, NoReturn +from typing import TYPE_CHECKING, Any, NoReturn + +if TYPE_CHECKING: + from collections.abc import Callable if sys.version_info[:2] >= (3, 11): import tomllib @@ -58,7 +60,7 @@ def exit_with_error(msg: str, is_toml: bool = False) -> NoReturn: class DjangoPluginConfig: - __slots__ = ("django_settings_module", "strict_settings", "strict_model_abstract_attrs") + __slots__ = ("django_settings_module", "strict_model_abstract_attrs", "strict_settings") django_settings_module: str strict_settings: bool diff --git a/mypy_django_plugin/django/context.py b/mypy_django_plugin/django/context.py index 12aee2a53..ed883feda 100644 --- a/mypy_django_plugin/django/context.py +++ b/mypy_django_plugin/django/context.py @@ -454,7 +454,7 @@ def resolve_lookup_into_field( solved_lookup = self.solve_lookup_type(model_cls, lookup) if solved_lookup is None: return None, model_cls - lookup_parts, field_parts, is_expression = solved_lookup + lookup_parts, field_parts, _ = solved_lookup if lookup_parts: raise LookupsAreUnsupported() return self._resolve_field_from_parts(field_parts, model_cls) diff --git a/mypy_django_plugin/lib/helpers.py b/mypy_django_plugin/lib/helpers.py index 04a725999..8afbc1643 100644 --- a/mypy_django_plugin/lib/helpers.py +++ b/mypy_django_plugin/lib/helpers.py @@ -2,7 +2,6 @@ from typing import TYPE_CHECKING, Any, Literal, NamedTuple, TypedDict, cast from django.db.models.base import Model -from django.db.models.fields import Field from django.db.models.fields.related import RelatedField from django.db.models.fields.reverse_related import ForeignObjectRel from mypy import checker @@ -60,6 +59,8 @@ from mypy_django_plugin.lib import fullnames if TYPE_CHECKING: + from django.db.models.fields import Field + from mypy_django_plugin.django.context import DjangoContext @@ -75,11 +76,11 @@ class DjangoTypeMetadata(TypedDict, total=False): def get_django_metadata(model_info: TypeInfo) -> DjangoTypeMetadata: - return cast(DjangoTypeMetadata, model_info.metadata.setdefault("django", {})) + return cast("DjangoTypeMetadata", model_info.metadata.setdefault("django", {})) def get_django_metadata_bases(model_info: TypeInfo, key: Literal["baseform_bases"]) -> dict[str, int]: - return get_django_metadata(model_info).setdefault(key, cast(dict[str, int], {})) + return get_django_metadata(model_info).setdefault(key, cast("dict[str, int]", {})) def get_reverse_manager_info( @@ -492,7 +493,7 @@ def make_oneoff_named_tuple( if extra_bases is None: extra_bases = [] namedtuple_info = add_new_class_for_module( - current_module, name, bases=[api.named_generic_type("typing.NamedTuple", [])] + extra_bases, fields=fields + current_module, name, bases=[api.named_generic_type("typing.NamedTuple", []), *extra_bases], fields=fields ) return TupleType(list(fields.values()), fallback=Instance(namedtuple_info, [])) diff --git a/mypy_django_plugin/main.py b/mypy_django_plugin/main.py index 5041623dc..d3822666a 100644 --- a/mypy_django_plugin/main.py +++ b/mypy_django_plugin/main.py @@ -123,7 +123,8 @@ def get_additional_deps(self, file: MypyFile) -> list[tuple[int, str, int]]: if related_model_module != file.fullname: deps.add(self._new_dependency(related_model_module)) - return list(deps) + [ + return [ + *deps, # For `QuerySet.annotate` self._new_dependency("django_stubs_ext"), # For `TypedModelMeta` lookup in model transformers diff --git a/mypy_django_plugin/transformers/fields.py b/mypy_django_plugin/transformers/fields.py index f70ac0587..dec419f36 100644 --- a/mypy_django_plugin/transformers/fields.py +++ b/mypy_django_plugin/transformers/fields.py @@ -138,7 +138,7 @@ def set_descriptor_types_for_field_callback(ctx: FunctionContext, django_context def set_descriptor_types_for_field( ctx: FunctionContext, *, is_set_nullable: bool = False, is_get_nullable: bool = False ) -> Instance: - default_return_type = cast(Instance, ctx.default_return_type) + default_return_type = cast("Instance", ctx.default_return_type) is_nullable = helpers.get_bool_call_argument_by_name(ctx, "null", default=False) is_primary_key = helpers.get_bool_call_argument_by_name(ctx, "primary_key", default=False) diff --git a/mypy_django_plugin/transformers/manytomany.py b/mypy_django_plugin/transformers/manytomany.py index 2f76e7708..814edf6fd 100644 --- a/mypy_django_plugin/transformers/manytomany.py +++ b/mypy_django_plugin/transformers/manytomany.py @@ -161,7 +161,7 @@ def refine_many_to_many_related_manager(ctx: MethodContext) -> MypyType: if related_objects is None: return ctx.default_return_type - many_related_manager, related_model_instance, through_model_instance = related_objects + _, related_model_instance, through_model_instance = related_objects checker = helpers.get_typechecker_api(ctx) related_manager_info = helpers.get_many_to_many_manager_info( checker, to=related_model_instance.type, derived_from="_default_manager" diff --git a/mypy_django_plugin/transformers/models.py b/mypy_django_plugin/transformers/models.py index 246374d84..0ddf1c9b0 100644 --- a/mypy_django_plugin/transformers/models.py +++ b/mypy_django_plugin/transformers/models.py @@ -48,7 +48,7 @@ class ModelClassInitializer: api: SemanticAnalyzer def __init__(self, ctx: ClassDefContext, django_context: DjangoContext) -> None: - self.api = cast(SemanticAnalyzer, ctx.api) + self.api = cast("SemanticAnalyzer", ctx.api) self.model_classdef = ctx.cls self.django_context = django_context self.ctx = ctx diff --git a/mypy_django_plugin/transformers/querysets.py b/mypy_django_plugin/transformers/querysets.py index df83e1873..c7375ea7a 100644 --- a/mypy_django_plugin/transformers/querysets.py +++ b/mypy_django_plugin/transformers/querysets.py @@ -487,8 +487,7 @@ def check_valid_attr_value( # 1. Conflict with another symbol on the model (If not de-selected via a prior .values/.values_list call). # Ex: # User.objects.prefetch_related(Prefetch(..., to_attr="id")) - model.typ.type.get(attr_name) - and (deselected_fields is None or attr_name not in deselected_fields) + (model.typ.type.get(attr_name) and (deselected_fields is None or attr_name not in deselected_fields)) # 2. Conflict with a previous annotation. # Ex: # User.objects.annotate(foo=...).prefetch_related(Prefetch(...,to_attr="foo")) diff --git a/pyproject.toml b/pyproject.toml index 531cab2bb..49be6f4c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -98,20 +98,25 @@ select = [ "B", # bugbear "E", # pycodestyle "F", # pyflakes + "FURB", # refurb "INP", # flake8-tidy-imports "W", # pycodestyle "I", # isort + "ISC001", # Implicitly concatenated string literals on one line + "ISC002", # Implicitly concatenated string literals over multiple lines "UP", # pyupgrade "TID251", # Disallowed imports (flake8-tidy-imports.banned-api) "PYI", # flake8-pyi "RUF100", # Equivalent to flake8-noqa NQA103 "PGH004", # Equivalent to flake8-noqa NQA104 "PGH003", # Disallowed blanket `type: ignore` annotations. - "RET504", # Unnecessary assignment to {name} before return statement - "RET505", # Unnecessary {branch} after return statement - "RET506", # Unnecessary {branch} after raise statement - "RET507", # Unnecessary {branch} after continue statement - "RET508", # Unnecessary {branch} after break statement + "RET504", # Unnecessary assignment to {name} before return statement + "RET505", # Unnecessary {branch} after return statement + "RET506", # Unnecessary {branch} after raise statement + "RET507", # Unnecessary {branch} after continue statement + "RET508", # Unnecessary {branch} after break statement + "RUF", # Ruff specific rules + "TC", # flake8-type-checking ] ignore = [ "PYI021", # We have a few meaningful docstrings for stubs only constructs/utilities. @@ -130,7 +135,7 @@ ignore = [ "F822", "F821", ] -"tests/*.py" = ["INP001", "PGH003"] +"tests/*.py" = ["INP001", "PGH003", "RUF012"] "ext/tests/*.py" = ["INP001"] "setup.py" = ["INP001"]