]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
docs: move documentation from shapely module docstrings to docs
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 18 Jul 2022 07:34:25 +0000 (08:34 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 18 Jul 2022 07:37:29 +0000 (08:37 +0100)
This avoids the dependency on shapely to build the docs.

docs/basic/pgtypes.rst
psycopg/psycopg/types/shapely.py

index 471187707ace5ddd5b1230da88d223166408fa7b..93dc353a75b209eb0ba3a10e7a8f6e5395ed8ff1 100644 (file)
@@ -334,7 +334,28 @@ to configure dumping `shape`_ instances to :sql:`geometry` columns and parsing
 :sql:`geometry` data back to `!shape` instances, in the context where the
 adapters are registered.
 
-.. autofunction:: psycopg.types.shapely.register_shapely
+.. function:: psycopg.types.shapely.register_shapely
+
+    Register Shapely dumper and loaders.
+
+    After invoking this function on an adapter, the queries retrieving
+    PostGIS geometry objects will return Shapely's shape object instances
+    both in text and binary mode.
+
+    Similarly, shape objects can be sent to the database.
+
+    This requires the Shapely library to be installed.
+
+    :param info: The object with the information about the geometry type.
+    :param context: The context where to register the adapters. If `!None`,
+        register it globally.
+
+    .. note::
+
+        Registering the adapters doesn't affect objects already created, even
+        if they are children of the registered context. For instance,
+        registering the adapter globally doesn't affect already existing
+        connections.
 
 Example::
 
index 54dde629bf41cf9ecef9004a1039707013f46d17..e99f2562915e0723389f2fc434fd01f01dc85000 100644 (file)
@@ -52,27 +52,7 @@ class BaseGeometryDumper(Dumper):
 
 
 def register_shapely(info: TypeInfo, context: Optional[AdaptContext] = None) -> None:
-    """Register Shapely dumper and loaders.
-
-    After invoking this function on an adapter, the queries retrieving
-    PostGIS geometry objects will return Shapely's shape object instances
-    both in text and binary mode.
-
-    Similarly, shape objects can be sent to the database.
-
-    This requires the Shapely library to be installed.
-
-    :param info: The object with the information about the geometry type.
-    :param context: The context where to register the adapters. If `!None`,
-        register it globally.
-
-    .. note::
-
-        Registering the adapters doesn't affect objects already created, even
-        if they are children of the registered context. For instance,
-        registering the adapter globally doesn't affect already existing
-        connections.
-    """
+    """Register Shapely dumper and loaders."""
 
     # A friendly error warning instead of an AttributeError in case fetch()
     # failed and it wasn't noticed.