From: Daniele Varrazzo Date: Sat, 26 Jun 2021 01:38:09 +0000 (+0100) Subject: Module types.text renamed to string X-Git-Tag: 3.0.dev0~17^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0941ca4bb492a35fcace1c3e7a5d0041d54f257b;p=thirdparty%2Fpsycopg.git Module types.text renamed to string --- diff --git a/psycopg3/psycopg3/types/__init__.py b/psycopg3/psycopg3/types/__init__.py index 79cdaf2b0..e79334306 100644 --- a/psycopg3/psycopg3/types/__init__.py +++ b/psycopg3/psycopg3/types/__init__.py @@ -10,10 +10,10 @@ from . import net from . import bool from . import json from . import none -from . import text from . import uuid from . import array from . import range +from . import string from . import numeric from . import datetime from . import composite @@ -29,10 +29,10 @@ def register_default_globals(ctx: "AdaptContext") -> None: bool.register_default_globals(ctx) json.register_default_globals(ctx) none.register_default_globals(ctx) - text.register_default_globals(ctx) uuid.register_default_globals(ctx) array.register_default_globals(ctx) range.register_default_globals(ctx) + string.register_default_globals(ctx) numeric.register_default_globals(ctx) datetime.register_default_globals(ctx) composite.register_default_globals(ctx) diff --git a/psycopg3/psycopg3/types/text.py b/psycopg3/psycopg3/types/string.py similarity index 100% rename from psycopg3/psycopg3/types/text.py rename to psycopg3/psycopg3/types/string.py diff --git a/psycopg3_c/psycopg3_c/_psycopg3.pyx b/psycopg3_c/psycopg3_c/_psycopg3.pyx index 6fb00d45d..7fbca0556 100644 --- a/psycopg3_c/psycopg3_c/_psycopg3.pyx +++ b/psycopg3_c/psycopg3_c/_psycopg3.pyx @@ -30,4 +30,4 @@ include "_psycopg3/transform.pyx" include "types/datetime.pyx" include "types/numeric.pyx" include "types/bool.pyx" -include "types/text.pyx" +include "types/string.pyx" diff --git a/psycopg3_c/psycopg3_c/types/text.pyx b/psycopg3_c/psycopg3_c/types/string.pyx similarity index 100% rename from psycopg3_c/psycopg3_c/types/text.pyx rename to psycopg3_c/psycopg3_c/types/string.pyx diff --git a/tests/test_adapt.py b/tests/test_adapt.py index 9c6cc856d..d835c91a2 100644 --- a/tests/test_adapt.py +++ b/tests/test_adapt.py @@ -94,7 +94,7 @@ def test_dump_subclass(conn, fmt_out): def test_subclass_dumper(conn): # This might be a C fast object: make sure that the Python code is called - from psycopg3.types.text import StringDumper + from psycopg3.types.string import StringDumper class MyStringDumper(StringDumper): def dump(self, obj): @@ -106,7 +106,7 @@ def test_subclass_dumper(conn): def test_subclass_loader(conn): # This might be a C fast object: make sure that the Python code is called - from psycopg3.types.text import TextLoader + from psycopg3.types.string import TextLoader class MyTextLoader(TextLoader): def load(self, data): diff --git a/tests/test_copy.py b/tests/test_copy.py index 034de90c8..b61bf9d21 100644 --- a/tests/test_copy.py +++ b/tests/test_copy.py @@ -259,9 +259,9 @@ def test_copy_in_empty(conn, format): @pytest.mark.parametrize("format", [Format.TEXT, Format.BINARY]) def test_subclass_adapter(conn, format): if format == Format.TEXT: - from psycopg3.types.text import StringDumper as BaseDumper + from psycopg3.types.string import StringDumper as BaseDumper else: - from psycopg3.types.text import StringBinaryDumper as BaseDumper + from psycopg3.types.string import StringBinaryDumper as BaseDumper class MyStringDumper(BaseDumper): def dump(self, obj): diff --git a/tests/types/test_text.py b/tests/types/test_string.py similarity index 100% rename from tests/types/test_text.py rename to tests/types/test_string.py