]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Rename module from types.geometry to types.shapely
authorJacopo Farina <jacopo.farina@flixbus.com>
Wed, 15 Sep 2021 11:10:22 +0000 (13:10 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 21 Sep 2021 17:11:11 +0000 (18:11 +0100)
In case in the future further adapters for geometry types are added,
this naming makes more sense

docs/basic/pgtypes.rst
psycopg/psycopg/types/shapely.py [moved from psycopg/psycopg/types/geometry.py with 97% similarity]

index f8d81c1778df509eea7c4b0449280e54ae56ecd4..bd3113fe76e5d422f5c877969f4c17b0138623dd 100644 (file)
@@ -229,16 +229,16 @@ To support this, you will need to install Shapely_
 
 Since PostgGIS is an extension, its oid is not well known, so it is necessary
 to use `~psycopg.types.TypeInfo` to query the database and get its oid. After
-that you can use `~psycopg.types.geometry.register_shapely()` to allow dumping
+that you can use `~psycopg.types.shapely.register_shapely()` to allow dumping
 `shape`_ instances to :sql:`geometry` columns and parsing :sql:`geometry` back
 to `!shape` in the context where it is registered.
 
-.. autofunction:: psycopg.types.geometry.register_shapely
+.. autofunction:: psycopg.types.shapely.register_shapely
 
 Example::
 
     >>> from psycopg.types import TypeInfo
-    >>> from psycopg.types.geometry import register_shapely
+    >>> from psycopg.types.shapely import register_shapely
     >>> from shapely.geometry import Point
 
     >>> info = TypeInfo.fetch(conn, "geometry")
similarity index 97%
rename from psycopg/psycopg/types/geometry.py
rename to psycopg/psycopg/types/shapely.py
index 0d88a052e61d7b63450a6186b0a89c801e886c18..6a370e368695f0a98b2d4bd834d91d030b60efb6 100644 (file)
@@ -17,7 +17,7 @@ try:
 
 except ImportError:
     raise ImportError(
-        "The module psycopg.types.geometry requires the package 'Shapely'"
+        "The module psycopg.types.shapely requires the package 'Shapely'"
         " to be installed"
     )