Skip to content

Commit f630535

Browse files
adamchainzsobolevn
andauthored
Update contrib.gis for Django 5.1 (#2587)
* Update contrib.gis for Django 5.1 From django/django@08306ba: * In `django.contrib.gis.gdal.prototypes.raster`, these were removed: * `register_all` * `get_driver` * `get_driver_by_name` * `get_driver_count` * `get_driver_description` * In `django.contrib.gis.gdal.prototypes.ds`, these were added: * `GDAL_OF_READONLY` * `GDAL_OF_UPDATE` * `GDAL_OF_ALL` * `GDAL_OF_RASTER` * `GDAL_OF_VECTOR` * `get_driver_description` * `get_dataset_driver` * In `django.contrib.gis.gdal.prototypes.ds`, these were removed: * `get_driver_name` * `release_ds` From django/django@3f6d939: * In `django.contrib.gis.gdal.geometries`, these were added: - `LineString.m` - `Point.m` * In `django.contrib.gis.gdal.prototypes.geom`, these were added: - `getm` - `is_measured` - `set_measured` - `to_iso_wkb` - `to_iso_wkt` From django/django@cfacd69: * In `django.contrib.gis.gdal.prototypes.geom`, these were added: - `is_3d` - `set_3d` Co-authored-by: sobolevn <mail@sobolevn.me>
1 parent 5e5ddf7 commit f630535

File tree

5 files changed

+19
-31
lines changed

5 files changed

+19
-31
lines changed

django-stubs/contrib/gis/gdal/geometries.pyi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ class Point(OGRGeometry):
101101
@property
102102
def z(self) -> float | None: ...
103103
@property
104+
def m(self) -> float | None: ...
105+
@property
104106
def coords(self) -> tuple[float, float] | tuple[float, float, float]: ...
105107
@property
106108
def tuple(self) -> tuple[float, float] | tuple[float, float, float]: ...
@@ -117,6 +119,8 @@ class LineString(OGRGeometry):
117119
def y(self) -> list[float]: ...
118120
@property
119121
def z(self) -> list[float] | None: ...
122+
@property
123+
def m(self) -> list[float] | None: ...
120124

121125
class LinearRing(LineString): ...
122126

django-stubs/contrib/gis/gdal/prototypes/ds.pyi

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1-
from typing import Any
1+
from typing import Any, Final
22

33
c_int_p: Any
4+
GDAL_OF_READONLY: Final = 0x00
5+
GDAL_OF_UPDATE: Final = 0x01
6+
GDAL_OF_ALL: Final = 0x00
7+
GDAL_OF_RASTER: Final = 0x02
8+
GDAL_OF_VECTOR: Final = 0x04
49
register_all: Any
510
cleanup_all: Any
611
get_driver: Any
712
get_driver_by_name: Any
813
get_driver_count: Any
9-
get_driver_name: Any
14+
get_driver_description: Any
1015
open_ds: Any
1116
destroy_ds: Any
12-
release_ds: Any
1317
get_ds_name: Any
18+
get_dataset_driver: Any
1419
get_layer: Any
1520
get_layer_by_name: Any
1621
get_layer_count: Any

django-stubs/contrib/gis/gdal/prototypes/geom.pyi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ to_kml: Any
1010
getx: Any
1111
gety: Any
1212
getz: Any
13+
getm: Any
1314
from_wkb: Any
1415
from_wkt: Any
1516
from_gml: Any
@@ -22,11 +23,17 @@ geom_diff: Any
2223
geom_intersection: Any
2324
geom_sym_diff: Any
2425
geom_union: Any
26+
is_3d: Any
27+
set_3d: Any
28+
is_measured: Any
29+
set_measured: Any
2530
add_geom: Any
2631
import_wkt: Any
2732
destroy_geom: Any
2833
to_wkb: Any
34+
to_iso_wkb: Any
2935
to_wkt: Any
36+
to_iso_wkt: Any
3037
to_gml: Any
3138
get_wkbsize: Any
3239
assign_srs: Any

django-stubs/contrib/gis/gdal/prototypes/raster.pyi

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
from typing import Any
22

3-
register_all: Any
4-
get_driver: Any
5-
get_driver_by_name: Any
6-
get_driver_count: Any
7-
get_driver_description: Any
83
create_ds: Any
94
open_ds: Any
105
close_ds: Any

scripts/stubtest/allowlist_todo_django52.txt

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,38 +26,15 @@ django.contrib.gis.gdal.OGRGeometry.has_curve
2626
django.contrib.gis.gdal.geometries.CircularString
2727
django.contrib.gis.gdal.geometries.CompoundCurve
2828
django.contrib.gis.gdal.geometries.CurvePolygon
29-
django.contrib.gis.gdal.geometries.LineString.m
3029
django.contrib.gis.gdal.geometries.MultiCurve
3130
django.contrib.gis.gdal.geometries.MultiSurface
3231
django.contrib.gis.gdal.geometries.OGRGeometry.geos_support
3332
django.contrib.gis.gdal.geometries.OGRGeometry.get_curve_geometry
3433
django.contrib.gis.gdal.geometries.OGRGeometry.get_linear_geometry
3534
django.contrib.gis.gdal.geometries.OGRGeometry.has_curve
36-
django.contrib.gis.gdal.geometries.Point.m
37-
django.contrib.gis.gdal.prototypes.ds.GDAL_OF_ALL
38-
django.contrib.gis.gdal.prototypes.ds.GDAL_OF_RASTER
39-
django.contrib.gis.gdal.prototypes.ds.GDAL_OF_READONLY
40-
django.contrib.gis.gdal.prototypes.ds.GDAL_OF_UPDATE
41-
django.contrib.gis.gdal.prototypes.ds.GDAL_OF_VECTOR
42-
django.contrib.gis.gdal.prototypes.ds.get_dataset_driver
43-
django.contrib.gis.gdal.prototypes.ds.get_driver_description
44-
django.contrib.gis.gdal.prototypes.ds.get_driver_name
45-
django.contrib.gis.gdal.prototypes.ds.release_ds
4635
django.contrib.gis.gdal.prototypes.geom.get_curve_geom
4736
django.contrib.gis.gdal.prototypes.geom.get_linear_geom
48-
django.contrib.gis.gdal.prototypes.geom.getm
4937
django.contrib.gis.gdal.prototypes.geom.has_curve_geom
50-
django.contrib.gis.gdal.prototypes.geom.is_3d
51-
django.contrib.gis.gdal.prototypes.geom.is_measured
52-
django.contrib.gis.gdal.prototypes.geom.set_3d
53-
django.contrib.gis.gdal.prototypes.geom.set_measured
54-
django.contrib.gis.gdal.prototypes.geom.to_iso_wkb
55-
django.contrib.gis.gdal.prototypes.geom.to_iso_wkt
56-
django.contrib.gis.gdal.prototypes.raster.get_driver
57-
django.contrib.gis.gdal.prototypes.raster.get_driver_by_name
58-
django.contrib.gis.gdal.prototypes.raster.get_driver_count
59-
django.contrib.gis.gdal.prototypes.raster.get_driver_description
60-
django.contrib.gis.gdal.prototypes.raster.register_all
6138
django.contrib.gis.geos.prototypes.io.DEFAULT_TRIM_VALUE
6239
django.contrib.gis.management
6340
django.contrib.gis.management.commands

0 commit comments

Comments
 (0)