PyGreSQL 6.0b1__tar.gz → 6.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/LICENSE.txt +1 -1
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/PKG-INFO +10 -10
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/PyGreSQL.egg-info/PKG-INFO +10 -10
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/about.rst +1 -1
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/conf.py +10 -2
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/changelog.rst +10 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/copyright.rst +1 -1
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/ext/pgconn.c +1 -1
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/ext/pginternal.c +1 -1
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/ext/pglarge.c +1 -1
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/ext/pgmodule.c +1 -1
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/ext/pgnotice.c +1 -1
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/ext/pgquery.c +1 -1
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/ext/pgsource.c +1 -1
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/pg/__init__.py +1 -1
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/pg/adapt.py +1 -1
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/pg/db.py +9 -6
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/pgdb/__init__.py +1 -1
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/pgdb/adapt.py +1 -1
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/pyproject.toml +26 -23
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/setup.py +21 -4
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/tests/test_classic_connection.py +4 -3
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/tests/test_classic_dbwrapper.py +12 -3
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/tox.ini +13 -11
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/MANIFEST.in +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/PyGreSQL.egg-info/SOURCES.txt +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/PyGreSQL.egg-info/dependency_links.txt +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/PyGreSQL.egg-info/not-zip-safe +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/PyGreSQL.egg-info/top_level.txt +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/README.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/Makefile +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/_static/favicon.ico +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/_static/pygresql.png +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/community/homes.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/community/index.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/community/issues.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/community/mailinglist.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/community/source.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/community/support.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/examples.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/general.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/index.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/install.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/pg/adaptation.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/pg/connection.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/pg/db_types.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/pg/db_wrapper.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/pg/index.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/pg/introduction.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/pg/large_objects.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/pg/module.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/pg/notification.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/pg/query.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/pgdb/adaptation.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/pgdb/connection.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/pgdb/cursor.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/pgdb/index.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/pgdb/introduction.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/pgdb/module.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/pgdb/typecache.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/pgdb/types.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/postgres/advanced.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/postgres/basic.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/postgres/func.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/postgres/index.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/postgres/syscat.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/contents/tutorial.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/download/download.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/download/files.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/download/index.rst +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/make.bat +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/docs/requirements.txt +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/ext/pgtypes.h +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/pg/_pg.pyi +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/pg/attrs.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/pg/cast.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/pg/core.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/pg/error.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/pg/helpers.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/pg/notify.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/pg/py.typed +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/pg/tz.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/pgdb/cast.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/pgdb/connect.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/pgdb/connection.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/pgdb/constants.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/pgdb/cursor.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/pgdb/py.typed +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/pgdb/typecode.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/setup.cfg +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/tests/__init__.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/tests/config.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/tests/dbapi20.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/tests/test_classic.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/tests/test_classic_attrdict.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/tests/test_classic_functions.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/tests/test_classic_largeobj.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/tests/test_classic_notification.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/tests/test_dbapi20.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/tests/test_dbapi20_copy.py +0 -0
- {PyGreSQL-6.0b1 → pygresql-6.0.1}/tests/test_tutorial.py +0 -0
|
@@ -6,7 +6,7 @@ Copyright (c) 1995, Pascal Andre
|
|
|
6
6
|
|
|
7
7
|
Further modifications copyright (c) 1997-2008 by D'Arcy J.M. Cain
|
|
8
8
|
|
|
9
|
-
Further modifications copyright (c) 2009-
|
|
9
|
+
Further modifications copyright (c) 2009-2024 by the PyGreSQL Development Team
|
|
10
10
|
|
|
11
11
|
PyGreSQL is released under the PostgreSQL License, a liberal Open Source
|
|
12
12
|
license, similar to the BSD or MIT licenses:
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyGreSQL
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.0.1
|
|
4
4
|
Summary: Python PostgreSQL interfaces
|
|
5
5
|
Home-page: https://pygresql.github.io/
|
|
6
|
-
Download-URL: https://pygresql.github.io/
|
|
6
|
+
Download-URL: https://pygresql.github.io/download/
|
|
7
7
|
Author: D'Arcy J. M. Cain
|
|
8
8
|
Author-email: "D'Arcy J. M. Cain" <darcy@pygresql.org>, Christoph Zwerschke <cito@online.de>
|
|
9
9
|
License: Written by D'Arcy J.M. Cain (darcy@PyGreSQL.org)
|
|
@@ -14,7 +14,7 @@ License: Written by D'Arcy J.M. Cain (darcy@PyGreSQL.org)
|
|
|
14
14
|
|
|
15
15
|
Further modifications copyright (c) 1997-2008 by D'Arcy J.M. Cain
|
|
16
16
|
|
|
17
|
-
Further modifications copyright (c) 2009-
|
|
17
|
+
Further modifications copyright (c) 2009-2024 by the PyGreSQL Development Team
|
|
18
18
|
|
|
19
19
|
PyGreSQL is released under the PostgreSQL License, a liberal Open Source
|
|
20
20
|
license, similar to the BSD or MIT licenses:
|
|
@@ -37,13 +37,13 @@ License: Written by D'Arcy J.M. Cain (darcy@PyGreSQL.org)
|
|
|
37
37
|
AUTHORS HAVE NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
|
|
38
38
|
ENHANCEMENTS, OR MODIFICATIONS.
|
|
39
39
|
|
|
40
|
-
Project-URL:
|
|
41
|
-
Project-URL:
|
|
42
|
-
Project-URL:
|
|
43
|
-
Project-URL:
|
|
44
|
-
Project-URL:
|
|
45
|
-
Project-URL:
|
|
46
|
-
Project-URL:
|
|
40
|
+
Project-URL: Homepage, https://pygresql.github.io/
|
|
41
|
+
Project-URL: Documentation, https://pygresql.github.io/contents/
|
|
42
|
+
Project-URL: Source Code, https://github.com/PyGreSQL/PyGreSQL
|
|
43
|
+
Project-URL: Issue Tracker, https://github.com/PyGreSQL/PyGreSQL/issues/
|
|
44
|
+
Project-URL: Changelog, https://pygresql.github.io/contents/changelog.html
|
|
45
|
+
Project-URL: Download, https://pygresql.github.io/download/
|
|
46
|
+
Project-URL: Mailing List, https://mail.vex.net/mailman/listinfo/pygresql
|
|
47
47
|
Keywords: pygresql,postgresql,database,api,dbapi
|
|
48
48
|
Classifier: Development Status :: 6 - Mature
|
|
49
49
|
Classifier: Intended Audience :: Developers
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyGreSQL
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.0.1
|
|
4
4
|
Summary: Python PostgreSQL interfaces
|
|
5
5
|
Home-page: https://pygresql.github.io/
|
|
6
|
-
Download-URL: https://pygresql.github.io/
|
|
6
|
+
Download-URL: https://pygresql.github.io/download/
|
|
7
7
|
Author: D'Arcy J. M. Cain
|
|
8
8
|
Author-email: "D'Arcy J. M. Cain" <darcy@pygresql.org>, Christoph Zwerschke <cito@online.de>
|
|
9
9
|
License: Written by D'Arcy J.M. Cain (darcy@PyGreSQL.org)
|
|
@@ -14,7 +14,7 @@ License: Written by D'Arcy J.M. Cain (darcy@PyGreSQL.org)
|
|
|
14
14
|
|
|
15
15
|
Further modifications copyright (c) 1997-2008 by D'Arcy J.M. Cain
|
|
16
16
|
|
|
17
|
-
Further modifications copyright (c) 2009-
|
|
17
|
+
Further modifications copyright (c) 2009-2024 by the PyGreSQL Development Team
|
|
18
18
|
|
|
19
19
|
PyGreSQL is released under the PostgreSQL License, a liberal Open Source
|
|
20
20
|
license, similar to the BSD or MIT licenses:
|
|
@@ -37,13 +37,13 @@ License: Written by D'Arcy J.M. Cain (darcy@PyGreSQL.org)
|
|
|
37
37
|
AUTHORS HAVE NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
|
|
38
38
|
ENHANCEMENTS, OR MODIFICATIONS.
|
|
39
39
|
|
|
40
|
-
Project-URL:
|
|
41
|
-
Project-URL:
|
|
42
|
-
Project-URL:
|
|
43
|
-
Project-URL:
|
|
44
|
-
Project-URL:
|
|
45
|
-
Project-URL:
|
|
46
|
-
Project-URL:
|
|
40
|
+
Project-URL: Homepage, https://pygresql.github.io/
|
|
41
|
+
Project-URL: Documentation, https://pygresql.github.io/contents/
|
|
42
|
+
Project-URL: Source Code, https://github.com/PyGreSQL/PyGreSQL
|
|
43
|
+
Project-URL: Issue Tracker, https://github.com/PyGreSQL/PyGreSQL/issues/
|
|
44
|
+
Project-URL: Changelog, https://pygresql.github.io/contents/changelog.html
|
|
45
|
+
Project-URL: Download, https://pygresql.github.io/download/
|
|
46
|
+
Project-URL: Mailing List, https://mail.vex.net/mailman/listinfo/pygresql
|
|
47
47
|
Keywords: pygresql,postgresql,database,api,dbapi
|
|
48
48
|
Classifier: Development Status :: 6 - Mature
|
|
49
49
|
Classifier: Intended Audience :: Developers
|
|
@@ -8,7 +8,7 @@ powerful PostgreSQL features from Python.
|
|
|
8
8
|
|
|
9
9
|
| This software is copyright © 1995, Pascal Andre.
|
|
10
10
|
| Further modifications are copyright © 1997-2008 by D'Arcy J.M. Cain.
|
|
11
|
-
| Further modifications are copyright © 2009-
|
|
11
|
+
| Further modifications are copyright © 2009-2024 by the PyGreSQL team.
|
|
12
12
|
| For licensing details, see the full :doc:`copyright`.
|
|
13
13
|
|
|
14
14
|
**PostgreSQL** is a highly scalable, SQL compliant, open source
|
|
@@ -8,9 +8,17 @@
|
|
|
8
8
|
|
|
9
9
|
project = 'PyGreSQL'
|
|
10
10
|
author = 'The PyGreSQL team'
|
|
11
|
-
copyright = '
|
|
11
|
+
copyright = '2024, ' + author
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
def project_version():
|
|
14
|
+
with open('../pyproject.toml') as f:
|
|
15
|
+
for d in f:
|
|
16
|
+
if d.startswith("version ="):
|
|
17
|
+
version = d.split("=")[1].strip().strip('"')
|
|
18
|
+
return version
|
|
19
|
+
raise Exception("Cannot determine PyGreSQL version")
|
|
20
|
+
|
|
21
|
+
version = release = project_version()
|
|
14
22
|
|
|
15
23
|
language = 'en'
|
|
16
24
|
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
ChangeLog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
Version 6.0.1 (2024-04-19)
|
|
5
|
+
--------------------------
|
|
6
|
+
- Properly adapt falsy JSON values (#86)
|
|
7
|
+
|
|
8
|
+
Version 6.0 (2023-10-03)
|
|
9
|
+
------------------------
|
|
10
|
+
- Tested with the recent releases of Python 3.12 and PostgreSQL 16.
|
|
11
|
+
- Make pyproject.toml the only source of truth for the version number.
|
|
12
|
+
- Please also note the changes already made in version 6.0b1.
|
|
13
|
+
|
|
4
14
|
Version 6.0b1 (2023-09-06)
|
|
5
15
|
--------------------------
|
|
6
16
|
- Officially support Python 3.12 and PostgreSQL 16 (tested with rc versions).
|
|
@@ -10,7 +10,7 @@ Copyright (c) 1995, Pascal Andre
|
|
|
10
10
|
Further modifications copyright (c) 1997-2008 by D'Arcy J.M. Cain
|
|
11
11
|
(darcy@PyGreSQL.org)
|
|
12
12
|
|
|
13
|
-
Further modifications copyright (c) 2009-
|
|
13
|
+
Further modifications copyright (c) 2009-2024 by the PyGreSQL team.
|
|
14
14
|
|
|
15
15
|
Permission to use, copy, modify, and distribute this software and its
|
|
16
16
|
documentation for any purpose, without fee, and without a written agreement
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
#
|
|
5
5
|
# This file contains the classic pg module.
|
|
6
6
|
#
|
|
7
|
-
# Copyright (c)
|
|
7
|
+
# Copyright (c) 2024 by the PyGreSQL Development Team
|
|
8
8
|
#
|
|
9
9
|
# The notification handler is based on pgnotify which is
|
|
10
10
|
# Copyright (c) 2001 Ng Pheng Siong. All rights reserved.
|
|
@@ -802,8 +802,9 @@ class DB:
|
|
|
802
802
|
adapt = params.add
|
|
803
803
|
col = self.escape_identifier
|
|
804
804
|
what = 'oid, *' if qoid else '*'
|
|
805
|
-
where = ' AND '.join(
|
|
806
|
-
col(k)
|
|
805
|
+
where = ' AND '.join(
|
|
806
|
+
f'{col(k)} OPERATOR(pg_catalog.=) {adapt(row[k], attnames[k])}'
|
|
807
|
+
for k in keyname)
|
|
807
808
|
if 'oid' in row:
|
|
808
809
|
if qoid:
|
|
809
810
|
row[qoid] = row['oid']
|
|
@@ -913,8 +914,9 @@ class DB:
|
|
|
913
914
|
params = self.adapter.parameter_list()
|
|
914
915
|
adapt = params.add
|
|
915
916
|
col = self.escape_identifier
|
|
916
|
-
where = ' AND '.join(
|
|
917
|
-
col(k)
|
|
917
|
+
where = ' AND '.join(
|
|
918
|
+
f'{col(k)} OPERATOR(pg_catalog.=) {adapt(row[k], attnames[k])}'
|
|
919
|
+
for k in keynames)
|
|
918
920
|
if 'oid' in row:
|
|
919
921
|
if qoid:
|
|
920
922
|
row[qoid] = row['oid']
|
|
@@ -1103,8 +1105,9 @@ class DB:
|
|
|
1103
1105
|
params = self.adapter.parameter_list()
|
|
1104
1106
|
adapt = params.add
|
|
1105
1107
|
col = self.escape_identifier
|
|
1106
|
-
where = ' AND '.join(
|
|
1107
|
-
col(k)
|
|
1108
|
+
where = ' AND '.join(
|
|
1109
|
+
f'{col(k)} OPERATOR(pg_catalog.=) {adapt(row[k], attnames[k])}'
|
|
1110
|
+
for k in keynames)
|
|
1108
1111
|
if 'oid' in row:
|
|
1109
1112
|
if qoid:
|
|
1110
1113
|
row[qoid] = row['oid']
|
|
@@ -33,7 +33,7 @@ class DbType(frozenset):
|
|
|
33
33
|
"""Create new type object."""
|
|
34
34
|
if isinstance(values, str):
|
|
35
35
|
values = values.split()
|
|
36
|
-
return super().__new__(cls, values)
|
|
36
|
+
return super().__new__(cls, values)
|
|
37
37
|
|
|
38
38
|
def __eq__(self, other: Any) -> bool:
|
|
39
39
|
"""Check whether types are considered equal."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "PyGreSQL"
|
|
3
|
-
version = "6.
|
|
3
|
+
version = "6.0.1"
|
|
4
4
|
requires-python = ">=3.7"
|
|
5
5
|
authors = [
|
|
6
6
|
{name = "D'Arcy J. M. Cain", email = "darcy@pygresql.org"},
|
|
@@ -33,29 +33,17 @@ classifiers = [
|
|
|
33
33
|
file = "LICENSE.txt"
|
|
34
34
|
|
|
35
35
|
[project.urls]
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
36
|
+
Homepage = "https://pygresql.github.io/"
|
|
37
|
+
Documentation = "https://pygresql.github.io/contents/"
|
|
38
|
+
"Source Code" = "https://github.com/PyGreSQL/PyGreSQL"
|
|
39
|
+
"Issue Tracker" = "https://github.com/PyGreSQL/PyGreSQL/issues/"
|
|
40
|
+
Changelog = "https://pygresql.github.io/contents/changelog.html"
|
|
41
|
+
Download = "https://pygresql.github.io/download/"
|
|
42
|
+
"Mailing List" = "https://mail.vex.net/mailman/listinfo/pygresql"
|
|
43
43
|
|
|
44
44
|
[tool.ruff]
|
|
45
45
|
target-version = "py37"
|
|
46
46
|
line-length = 79
|
|
47
|
-
select = [
|
|
48
|
-
"E", # pycodestyle
|
|
49
|
-
"F", # pyflakes
|
|
50
|
-
"I", # isort
|
|
51
|
-
"N", # pep8-naming
|
|
52
|
-
"UP", # pyupgrade
|
|
53
|
-
"D", # pydocstyle
|
|
54
|
-
"B", # bugbear
|
|
55
|
-
"S", # bandit
|
|
56
|
-
"SIM", # simplify
|
|
57
|
-
"RUF", # ruff
|
|
58
|
-
]
|
|
59
47
|
exclude = [
|
|
60
48
|
"__pycache__",
|
|
61
49
|
"__pypackages__",
|
|
@@ -71,11 +59,26 @@ exclude = [
|
|
|
71
59
|
"venv",
|
|
72
60
|
]
|
|
73
61
|
|
|
74
|
-
[tool.ruff.
|
|
62
|
+
[tool.ruff.lint]
|
|
63
|
+
select = [
|
|
64
|
+
"E", # pycodestyle
|
|
65
|
+
"F", # pyflakes
|
|
66
|
+
"I", # isort
|
|
67
|
+
"N", # pep8-naming
|
|
68
|
+
"UP", # pyupgrade
|
|
69
|
+
"D", # pydocstyle
|
|
70
|
+
"B", # bugbear
|
|
71
|
+
"S", # bandit
|
|
72
|
+
"SIM", # simplify
|
|
73
|
+
"RUF", # ruff
|
|
74
|
+
]
|
|
75
|
+
ignore = ["D203", "D213"]
|
|
76
|
+
|
|
77
|
+
[tool.ruff.lint.per-file-ignores]
|
|
75
78
|
"tests/*.py" = ["D100", "D101", "D102", "D103", "D105", "D107", "S"]
|
|
76
79
|
|
|
77
80
|
[tool.mypy]
|
|
78
|
-
python_version = "3.
|
|
81
|
+
python_version = "3.12"
|
|
79
82
|
check_untyped_defs = true
|
|
80
83
|
no_implicit_optional = true
|
|
81
84
|
strict_optional = true
|
|
@@ -98,5 +101,5 @@ pg = ["pg.typed"]
|
|
|
98
101
|
pgdb = ["pg.typed"]
|
|
99
102
|
|
|
100
103
|
[build-system]
|
|
101
|
-
requires = ["setuptools>=68", "wheel>=0.
|
|
104
|
+
requires = ["setuptools>=68", "wheel>=0.42"]
|
|
102
105
|
build-backend = "setuptools.build_meta"
|
|
@@ -19,14 +19,31 @@ from distutils.sysconfig import get_python_inc, get_python_lib
|
|
|
19
19
|
from setuptools import Extension, setup
|
|
20
20
|
from setuptools.command.build_ext import build_ext
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
|
|
23
|
+
def project_version():
|
|
24
|
+
"""Read the PyGreSQL version from the pyproject.toml file."""
|
|
25
|
+
with open('pyproject.toml') as f:
|
|
26
|
+
for d in f:
|
|
27
|
+
if d.startswith("version ="):
|
|
28
|
+
version = d.split("=")[1].strip().strip('"')
|
|
29
|
+
return version
|
|
30
|
+
raise Exception("Cannot determine PyGreSQL version")
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def project_readme():
|
|
34
|
+
"""Get the content of the README file."""
|
|
35
|
+
with open('README.rst') as f:
|
|
36
|
+
return f.read()
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
version = project_version()
|
|
23
40
|
|
|
24
41
|
if not (3, 7) <= sys.version_info[:2] < (4, 0):
|
|
25
42
|
raise Exception(
|
|
26
43
|
f"Sorry, PyGreSQL {version} does not support this Python version")
|
|
27
44
|
|
|
28
|
-
|
|
29
|
-
|
|
45
|
+
long_description = project_readme()
|
|
46
|
+
|
|
30
47
|
|
|
31
48
|
# For historical reasons, PyGreSQL does not install itself as a single
|
|
32
49
|
# "pygresql" package, but as two top-level modules "pg", providing the
|
|
@@ -133,7 +150,7 @@ setup(
|
|
|
133
150
|
author="D'Arcy J. M. Cain",
|
|
134
151
|
author_email="darcy@PyGreSQL.org",
|
|
135
152
|
url='https://pygresql.github.io/',
|
|
136
|
-
download_url='https://pygresql.github.io/
|
|
153
|
+
download_url='https://pygresql.github.io/download/',
|
|
137
154
|
project_urls={
|
|
138
155
|
'Documentation': 'https://pygresql.github.io/contents/',
|
|
139
156
|
'Issue Tracker': 'https://github.com/PyGreSQL/PyGreSQL/issues/',
|
|
@@ -195,9 +195,10 @@ class TestConnectObject(unittest.TestCase):
|
|
|
195
195
|
def test_attribute_ssl_attributes(self):
|
|
196
196
|
ssl_attributes = self.connection.ssl_attributes
|
|
197
197
|
self.assertIsInstance(ssl_attributes, dict)
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
if ssl_attributes:
|
|
199
|
+
self.assertEqual(ssl_attributes, {
|
|
200
|
+
'cipher': None, 'compression': None, 'key_bits': None,
|
|
201
|
+
'library': None, 'protocol': None})
|
|
201
202
|
|
|
202
203
|
def test_attribute_status(self):
|
|
203
204
|
status_ok = 1
|
|
@@ -190,9 +190,10 @@ class TestDBClassBasic(unittest.TestCase):
|
|
|
190
190
|
def test_attribute_ssl_attributes(self):
|
|
191
191
|
ssl_attributes = self.db.ssl_attributes
|
|
192
192
|
self.assertIsInstance(ssl_attributes, dict)
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
if ssl_attributes:
|
|
194
|
+
self.assertEqual(ssl_attributes, {
|
|
195
|
+
'cipher': None, 'compression': None, 'key_bits': None,
|
|
196
|
+
'library': None, 'protocol': None})
|
|
196
197
|
|
|
197
198
|
def test_attribute_status(self):
|
|
198
199
|
status_ok = 1
|
|
@@ -4389,6 +4390,14 @@ class TestDBClassAdapter(unittest.TestCase):
|
|
|
4389
4390
|
self.assertEqual(sql, 'select $1')
|
|
4390
4391
|
self.assertEqual(params, ['{"test": [1, "it\'s fine", 3]}'])
|
|
4391
4392
|
|
|
4393
|
+
def test_adapt_query_typed_list_with_empty_json(self):
|
|
4394
|
+
format_query = self.adapter.format_query
|
|
4395
|
+
values: Any = [None, 0, False, '', [], {}]
|
|
4396
|
+
types = ('json',) * 6
|
|
4397
|
+
sql, params = format_query("select %s,%s,%s,%s,%s,%s", values, types)
|
|
4398
|
+
self.assertEqual(sql, 'select $1,$2,$3,$4,$5,$6')
|
|
4399
|
+
self.assertEqual(params, [None, '0', 'false', '', '[]', '{}'])
|
|
4400
|
+
|
|
4392
4401
|
def test_adapt_query_typed_with_hstore(self):
|
|
4393
4402
|
format_query = self.adapter.format_query
|
|
4394
4403
|
value: Any = {'one': "it's fine", 'two': 2}
|
|
@@ -4,42 +4,42 @@
|
|
|
4
4
|
envlist = py3{7,8,9,10,11,12},ruff,mypy,cformat,docs
|
|
5
5
|
|
|
6
6
|
[testenv:ruff]
|
|
7
|
-
basepython = python3.
|
|
8
|
-
deps = ruff>=0.
|
|
7
|
+
basepython = python3.12
|
|
8
|
+
deps = ruff>=0.3.7
|
|
9
9
|
commands =
|
|
10
|
-
ruff setup.py pg pgdb tests
|
|
10
|
+
ruff check setup.py pg pgdb tests
|
|
11
11
|
|
|
12
12
|
[testenv:mypy]
|
|
13
|
-
basepython = python3.
|
|
14
|
-
deps = mypy>=1.
|
|
13
|
+
basepython = python3.12
|
|
14
|
+
deps = mypy>=1.9.0
|
|
15
15
|
commands =
|
|
16
16
|
mypy pg pgdb tests
|
|
17
17
|
|
|
18
18
|
[testenv:cformat]
|
|
19
|
-
basepython = python3.
|
|
19
|
+
basepython = python3.12
|
|
20
20
|
allowlist_externals =
|
|
21
21
|
sh
|
|
22
22
|
commands =
|
|
23
23
|
sh -c "! (clang-format --style=file -n ext/*.c 2>&1 | tee /dev/tty | grep format-violations)"
|
|
24
24
|
|
|
25
25
|
[testenv:docs]
|
|
26
|
-
basepython = python3.
|
|
26
|
+
basepython = python3.12
|
|
27
27
|
deps =
|
|
28
28
|
sphinx>=7,<8
|
|
29
29
|
commands =
|
|
30
30
|
sphinx-build -b html -nEW docs docs/_build/html
|
|
31
31
|
|
|
32
32
|
[testenv:build]
|
|
33
|
-
basepython = python3.
|
|
33
|
+
basepython = python3.12
|
|
34
34
|
deps =
|
|
35
35
|
setuptools>=68
|
|
36
|
-
wheel>=0.
|
|
37
|
-
build>=
|
|
36
|
+
wheel>=0.42,<1
|
|
37
|
+
build>=1,<2
|
|
38
38
|
commands =
|
|
39
39
|
python -m build -s -n -C strict -C memory-size
|
|
40
40
|
|
|
41
41
|
[testenv:coverage]
|
|
42
|
-
basepython = python3.
|
|
42
|
+
basepython = python3.12
|
|
43
43
|
deps =
|
|
44
44
|
coverage>=7,<8
|
|
45
45
|
commands =
|
|
@@ -50,6 +50,8 @@ commands =
|
|
|
50
50
|
passenv =
|
|
51
51
|
PG*
|
|
52
52
|
PYGRESQL_*
|
|
53
|
+
deps =
|
|
54
|
+
setuptools>=68
|
|
53
55
|
commands =
|
|
54
56
|
python setup.py clean --all build_ext --force --inplace --strict --memory-size
|
|
55
57
|
python -m unittest {posargs:discover}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|