From dc5ff7a5ce2f965f25dd28e24c22bfc053d6de32 Mon Sep 17 00:00:00 2001 From: Taku Fukada Date: Wed, 4 Jan 2023 23:40:57 +0900 Subject: [PATCH] Remove unneccesory re-exports --- django-stubs/contrib/gis/admin/options.pyi | 2 +- django-stubs/contrib/gis/apps.pyi | 2 +- django-stubs/contrib/gis/gdal/datasource.pyi | 6 +++--- django-stubs/contrib/gis/gdal/driver.pyi | 2 +- django-stubs/contrib/gis/gdal/feature.pyi | 8 ++++---- django-stubs/contrib/gis/gdal/field.pyi | 2 +- django-stubs/contrib/gis/gdal/geometries.pyi | 6 +++--- django-stubs/contrib/gis/gdal/layer.pyi | 16 ++++++++-------- django-stubs/contrib/gis/gdal/raster/band.pyi | 2 +- django-stubs/contrib/gis/gdal/raster/base.pyi | 2 +- django-stubs/contrib/gis/gdal/raster/source.pyi | 8 ++++---- django-stubs/contrib/gis/gdal/srs.pyi | 2 +- django-stubs/contrib/gis/geos/collections.pyi | 3 +-- django-stubs/contrib/gis/geos/coordseq.pyi | 2 +- django-stubs/contrib/gis/geos/geometry.pyi | 11 ++++------- django-stubs/contrib/gis/geos/linestring.pyi | 3 +-- django-stubs/contrib/gis/geos/point.pyi | 2 +- django-stubs/contrib/gis/geos/polygon.pyi | 4 ++-- django-stubs/contrib/gis/geos/prepared.pyi | 4 ++-- django-stubs/contrib/gis/utils/layermapping.pyi | 4 ++-- 20 files changed, 43 insertions(+), 48 deletions(-) diff --git a/django-stubs/contrib/gis/admin/options.pyi b/django-stubs/contrib/gis/admin/options.pyi index 34ebd9ecc4..a8e014c94c 100644 --- a/django-stubs/contrib/gis/admin/options.pyi +++ b/django-stubs/contrib/gis/admin/options.pyi @@ -1,6 +1,6 @@ from typing import Any -from django.contrib.admin import ModelAdmin as ModelAdmin +from django.contrib.admin import ModelAdmin from django.contrib.gis.forms import BaseGeometryWidget spherical_mercator_srid: int diff --git a/django-stubs/contrib/gis/apps.pyi b/django-stubs/contrib/gis/apps.pyi index a169c0be31..ffef1b725b 100644 --- a/django-stubs/contrib/gis/apps.pyi +++ b/django-stubs/contrib/gis/apps.pyi @@ -1,3 +1,3 @@ -from django.apps import AppConfig as AppConfig +from django.apps import AppConfig class GISConfig(AppConfig): ... diff --git a/django-stubs/contrib/gis/gdal/datasource.pyi b/django-stubs/contrib/gis/gdal/datasource.pyi index c54faed303..aaaf621ed4 100644 --- a/django-stubs/contrib/gis/gdal/datasource.pyi +++ b/django-stubs/contrib/gis/gdal/datasource.pyi @@ -1,8 +1,8 @@ from typing import Any -from django.contrib.gis.gdal.base import GDALBase as GDALBase -from django.contrib.gis.gdal.driver import Driver as Driver -from django.contrib.gis.gdal.layer import Layer as Layer +from django.contrib.gis.gdal.base import GDALBase +from django.contrib.gis.gdal.driver import Driver +from django.contrib.gis.gdal.layer import Layer class DataSource(GDALBase): destructor: Any diff --git a/django-stubs/contrib/gis/gdal/driver.pyi b/django-stubs/contrib/gis/gdal/driver.pyi index c94ad3b593..504a599023 100644 --- a/django-stubs/contrib/gis/gdal/driver.pyi +++ b/django-stubs/contrib/gis/gdal/driver.pyi @@ -1,6 +1,6 @@ from typing import Any -from django.contrib.gis.gdal.base import GDALBase as GDALBase +from django.contrib.gis.gdal.base import GDALBase class Driver(GDALBase): ptr: Any diff --git a/django-stubs/contrib/gis/gdal/feature.pyi b/django-stubs/contrib/gis/gdal/feature.pyi index 3bff413fa2..7fe283b008 100644 --- a/django-stubs/contrib/gis/gdal/feature.pyi +++ b/django-stubs/contrib/gis/gdal/feature.pyi @@ -1,9 +1,9 @@ from typing import Any -from django.contrib.gis.gdal.base import GDALBase as GDALBase -from django.contrib.gis.gdal.field import Field as Field -from django.contrib.gis.gdal.geometries import OGRGeometry as OGRGeometry -from django.contrib.gis.gdal.geomtype import OGRGeomType as OGRGeomType +from django.contrib.gis.gdal.base import GDALBase +from django.contrib.gis.gdal.field import Field +from django.contrib.gis.gdal.geometries import OGRGeometry +from django.contrib.gis.gdal.geomtype import OGRGeomType class Feature(GDALBase): destructor: Any diff --git a/django-stubs/contrib/gis/gdal/field.pyi b/django-stubs/contrib/gis/gdal/field.pyi index 0c5ac2400d..6d1a27a3b0 100644 --- a/django-stubs/contrib/gis/gdal/field.pyi +++ b/django-stubs/contrib/gis/gdal/field.pyi @@ -1,6 +1,6 @@ from typing import Any -from django.contrib.gis.gdal.base import GDALBase as GDALBase +from django.contrib.gis.gdal.base import GDALBase class Field(GDALBase): ptr: Any diff --git a/django-stubs/contrib/gis/gdal/geometries.pyi b/django-stubs/contrib/gis/gdal/geometries.pyi index ecb261bd6c..d55a0aa73d 100644 --- a/django-stubs/contrib/gis/gdal/geometries.pyi +++ b/django-stubs/contrib/gis/gdal/geometries.pyi @@ -1,9 +1,9 @@ from typing import Any, AnyStr from django.contrib.gis.gdal import CoordTransform, SpatialReference -from django.contrib.gis.gdal.base import GDALBase as GDALBase -from django.contrib.gis.gdal.envelope import Envelope as Envelope -from django.contrib.gis.gdal.geomtype import OGRGeomType as OGRGeomType +from django.contrib.gis.gdal.base import GDALBase +from django.contrib.gis.gdal.envelope import Envelope +from django.contrib.gis.gdal.geomtype import OGRGeomType from django.contrib.gis.geos import GEOSGeometry class OGRGeometry(GDALBase): diff --git a/django-stubs/contrib/gis/gdal/layer.pyi b/django-stubs/contrib/gis/gdal/layer.pyi index 7d2e7d9295..61536322fc 100644 --- a/django-stubs/contrib/gis/gdal/layer.pyi +++ b/django-stubs/contrib/gis/gdal/layer.pyi @@ -1,14 +1,14 @@ from collections.abc import Iterator from typing import Any, AnyStr, overload -from django.contrib.gis.gdal.base import GDALBase as GDALBase -from django.contrib.gis.gdal.envelope import Envelope as Envelope -from django.contrib.gis.gdal.feature import Feature as Feature -from django.contrib.gis.gdal.field import Field as Field -from django.contrib.gis.gdal.geometries import OGRGeometry as OGRGeometry -from django.contrib.gis.gdal.geomtype import OGRGeomType as OGRGeomType -from django.contrib.gis.gdal.srs import SpatialReference as SpatialReference -from django.contrib.gis.geos.geometry import GEOSGeometry as GEOSGeometry +from django.contrib.gis.gdal.base import GDALBase +from django.contrib.gis.gdal.envelope import Envelope +from django.contrib.gis.gdal.feature import Feature +from django.contrib.gis.gdal.field import Field +from django.contrib.gis.gdal.geometries import OGRGeometry +from django.contrib.gis.gdal.geomtype import OGRGeomType +from django.contrib.gis.gdal.srs import SpatialReference +from django.contrib.gis.geos.geometry import GEOSGeometry from typing_extensions import Literal class Layer(GDALBase): diff --git a/django-stubs/contrib/gis/gdal/raster/band.pyi b/django-stubs/contrib/gis/gdal/raster/band.pyi index e5469b4eef..590b600f4d 100644 --- a/django-stubs/contrib/gis/gdal/raster/band.pyi +++ b/django-stubs/contrib/gis/gdal/raster/band.pyi @@ -1,6 +1,6 @@ from typing import Any, overload -from django.contrib.gis.gdal.raster.base import GDALRasterBase as GDALRasterBase +from django.contrib.gis.gdal.raster.base import GDALRasterBase from typing_extensions import Literal class GDALBand(GDALRasterBase): diff --git a/django-stubs/contrib/gis/gdal/raster/base.pyi b/django-stubs/contrib/gis/gdal/raster/base.pyi index fabfebf443..3850e028fd 100644 --- a/django-stubs/contrib/gis/gdal/raster/base.pyi +++ b/django-stubs/contrib/gis/gdal/raster/base.pyi @@ -1,6 +1,6 @@ from typing import Any -from django.contrib.gis.gdal.base import GDALBase as GDALBase +from django.contrib.gis.gdal.base import GDALBase class GDALRasterBase(GDALBase): @property diff --git a/django-stubs/contrib/gis/gdal/raster/source.pyi b/django-stubs/contrib/gis/gdal/raster/source.pyi index a66e4676c7..fb3dbffdb7 100644 --- a/django-stubs/contrib/gis/gdal/raster/source.pyi +++ b/django-stubs/contrib/gis/gdal/raster/source.pyi @@ -1,10 +1,10 @@ from collections.abc import Sequence from typing import Any -from django.contrib.gis.gdal.driver import Driver as Driver -from django.contrib.gis.gdal.raster.band import BandList as BandList -from django.contrib.gis.gdal.raster.base import GDALRasterBase as GDALRasterBase -from django.contrib.gis.gdal.srs import SpatialReference as SpatialReference +from django.contrib.gis.gdal.driver import Driver +from django.contrib.gis.gdal.raster.band import BandList +from django.contrib.gis.gdal.raster.base import GDALRasterBase +from django.contrib.gis.gdal.srs import SpatialReference class TransformPoint(list[Sequence[float]]): indices: dict[str, tuple[int, int]] diff --git a/django-stubs/contrib/gis/gdal/srs.pyi b/django-stubs/contrib/gis/gdal/srs.pyi index 14f597848b..e7ba613cd7 100644 --- a/django-stubs/contrib/gis/gdal/srs.pyi +++ b/django-stubs/contrib/gis/gdal/srs.pyi @@ -2,7 +2,7 @@ from enum import IntEnum from typing import Any, AnyStr from _typeshed import Self -from django.contrib.gis.gdal.base import GDALBase as GDALBase +from django.contrib.gis.gdal.base import GDALBase class AxisOrder(IntEnum): TRADITIONAL: int diff --git a/django-stubs/contrib/gis/geos/collections.pyi b/django-stubs/contrib/gis/geos/collections.pyi index 5a12c713da..afa14c1813 100644 --- a/django-stubs/contrib/gis/geos/collections.pyi +++ b/django-stubs/contrib/gis/geos/collections.pyi @@ -1,8 +1,7 @@ from collections.abc import Iterator from typing import Any -from django.contrib.gis.geos.geometry import GEOSGeometry as GEOSGeometry -from django.contrib.gis.geos.geometry import LinearGeometryMixin as LinearGeometryMixin +from django.contrib.gis.geos.geometry import GEOSGeometry, LinearGeometryMixin class GeometryCollection(GEOSGeometry): def __init__(self, *args: Any, **kwargs: Any) -> None: ... diff --git a/django-stubs/contrib/gis/geos/coordseq.pyi b/django-stubs/contrib/gis/geos/coordseq.pyi index 4f9650fca8..94b8976d6b 100644 --- a/django-stubs/contrib/gis/geos/coordseq.pyi +++ b/django-stubs/contrib/gis/geos/coordseq.pyi @@ -2,7 +2,7 @@ from collections.abc import Iterator from typing import Any from _typeshed import Self -from django.contrib.gis.geos.base import GEOSBase as GEOSBase +from django.contrib.gis.geos.base import GEOSBase class GEOSCoordSeq(GEOSBase): ptr_type: Any diff --git a/django-stubs/contrib/gis/geos/geometry.pyi b/django-stubs/contrib/gis/geos/geometry.pyi index 21e507c927..fb954b6431 100644 --- a/django-stubs/contrib/gis/geos/geometry.pyi +++ b/django-stubs/contrib/gis/geos/geometry.pyi @@ -3,14 +3,11 @@ from typing import Any from _typeshed import Self from django.contrib.gis.gdal import CoordTransform, SpatialReference from django.contrib.gis.gdal.geometries import OGRGeometry -from django.contrib.gis.geometry import hex_regex as hex_regex # noqa: F401 -from django.contrib.gis.geometry import json_regex as json_regex -from django.contrib.gis.geometry import wkt_regex as wkt_regex -from django.contrib.gis.geos.base import GEOSBase as GEOSBase -from django.contrib.gis.geos.coordseq import GEOSCoordSeq as GEOSCoordSeq -from django.contrib.gis.geos.mutable_list import ListMixin as ListMixin +from django.contrib.gis.geos.base import GEOSBase +from django.contrib.gis.geos.coordseq import GEOSCoordSeq +from django.contrib.gis.geos.mutable_list import ListMixin from django.contrib.gis.geos.point import Point -from django.contrib.gis.geos.prepared import PreparedGeometry as PreparedGeometry +from django.contrib.gis.geos.prepared import PreparedGeometry class GEOSGeometryBase(GEOSBase): ptr_type: Any diff --git a/django-stubs/contrib/gis/geos/linestring.pyi b/django-stubs/contrib/gis/geos/linestring.pyi index fde773cab1..d7a6fc6146 100644 --- a/django-stubs/contrib/gis/geos/linestring.pyi +++ b/django-stubs/contrib/gis/geos/linestring.pyi @@ -1,8 +1,7 @@ from collections.abc import Iterator from typing import Any -from django.contrib.gis.geos.geometry import GEOSGeometry as GEOSGeometry -from django.contrib.gis.geos.geometry import LinearGeometryMixin as LinearGeometryMixin +from django.contrib.gis.geos.geometry import GEOSGeometry, LinearGeometryMixin class LineString(LinearGeometryMixin, GEOSGeometry): has_cs: bool diff --git a/django-stubs/contrib/gis/geos/point.pyi b/django-stubs/contrib/gis/geos/point.pyi index cdc40d35d4..791fe202fb 100644 --- a/django-stubs/contrib/gis/geos/point.pyi +++ b/django-stubs/contrib/gis/geos/point.pyi @@ -1,7 +1,7 @@ from collections.abc import Iterator from typing import Any -from django.contrib.gis.geos.geometry import GEOSGeometry as GEOSGeometry +from django.contrib.gis.geos.geometry import GEOSGeometry class Point(GEOSGeometry): has_cs: bool diff --git a/django-stubs/contrib/gis/geos/polygon.pyi b/django-stubs/contrib/gis/geos/polygon.pyi index 8e5a3898c6..4d818e0150 100644 --- a/django-stubs/contrib/gis/geos/polygon.pyi +++ b/django-stubs/contrib/gis/geos/polygon.pyi @@ -1,8 +1,8 @@ from collections.abc import Iterator from typing import Any -from django.contrib.gis.geos.geometry import GEOSGeometry as GEOSGeometry -from django.contrib.gis.geos.linestring import LinearRing as LinearRing +from django.contrib.gis.geos.geometry import GEOSGeometry +from django.contrib.gis.geos.linestring import LinearRing class Polygon(GEOSGeometry): def __init__(self, *args: Any, **kwargs: Any) -> None: ... diff --git a/django-stubs/contrib/gis/geos/prepared.pyi b/django-stubs/contrib/gis/geos/prepared.pyi index b6f6e42473..f71ea3b97a 100644 --- a/django-stubs/contrib/gis/geos/prepared.pyi +++ b/django-stubs/contrib/gis/geos/prepared.pyi @@ -1,7 +1,7 @@ from typing import Any -from .base import GEOSBase as GEOSBase -from .geometry import GEOSGeometry as GEOSGeometry +from .base import GEOSBase +from .geometry import GEOSGeometry class PreparedGeometry(GEOSBase): ptr_type: Any diff --git a/django-stubs/contrib/gis/utils/layermapping.pyi b/django-stubs/contrib/gis/utils/layermapping.pyi index ad0cbb92b4..a69f8f5ecf 100644 --- a/django-stubs/contrib/gis/utils/layermapping.pyi +++ b/django-stubs/contrib/gis/utils/layermapping.pyi @@ -2,8 +2,8 @@ from collections.abc import Mapping from pathlib import Path from typing import Any, Protocol +import django.contrib.gis.gdal.field from django.contrib.gis.gdal import DataSource, OGRGeomType -from django.contrib.gis.gdal.field import Field as OGRField from django.contrib.gis.gdal.layer import Layer from django.db.backends.base.operations import BaseDatabaseOperations from django.db.models import Field, Model @@ -19,7 +19,7 @@ class _Writer(Protocol): class LayerMapping: MULTI_TYPES: dict[int, OGRGeomType] - FIELD_TYPES: dict[Field, OGRField | tuple[OGRField, ...]] + FIELD_TYPES: dict[Field, django.contrib.gis.gdal.field.Field | tuple[django.contrib.gis.gdal.field.Field, ...]] ds: DataSource layer: Layer using: str