summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2021-11-11 21:14:28 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2021-11-11 21:14:28 +0100
commit1b013b529b45e8f763cb08cefdee954dc337aaa9 (patch)
tree74af32322b47179d245f7093c468a7bdc798b100
parent898cbff5a6d1f8215d39d369581bc00ad22540da (diff)
parent0a4a4696698c419b72f70621e906b9cc5c01ea06 (diff)
downloadpsycopg2-1b013b529b45e8f763cb08cefdee954dc337aaa9.tar.gz
Merge branch 'py311'
-rw-r--r--.github/workflows/tests.yml10
-rw-r--r--NEWS1
-rw-r--r--psycopg/connection_int.c1
-rw-r--r--psycopg/connection_type.c1
-rw-r--r--psycopg/pqpath.c1
-rw-r--r--psycopg/psycopgmodule.c2
-rw-r--r--psycopg/replication_connection_type.c7
-rw-r--r--psycopg/replication_cursor_type.c7
-rw-r--r--tox.ini3
9 files changed, 27 insertions, 6 deletions
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index a913cf5..15b6eec 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -18,6 +18,7 @@ jobs:
- {python: "3.8", postgres: "12"}
- {python: "3.9", postgres: "13"}
- {python: "3.10", postgres: "14"}
+ - {python: "3.11-dev", postgres: "14"}
# Opposite extremes of the supported Py/PG range, other architecture
- {python: "3.6", postgres: "14", architecture: "x86"}
@@ -25,6 +26,7 @@ jobs:
- {python: "3.8", postgres: "12", architecture: "x86"}
- {python: "3.9", postgres: "11", architecture: "x86"}
- {python: "3.10", postgres: "10", architecture: "x86"}
+ - {python: "3.11-dev", postgres: "10", architecture: "x86"}
env:
PSYCOPG2_TESTDB: postgres
@@ -48,11 +50,13 @@ jobs:
steps:
- uses: actions/checkout@v2
+ - name: Install tox
+ run: pip install tox
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- - name: Install tox
- run: pip install tox
- name: Run tests
- run: tox -e ${{ matrix.python }}
+ env:
+ MATRIX_PYTHON: ${{ matrix.python }}
+ run: tox -e ${MATRIX_PYTHON%-dev}
timeout-minutes: 5
diff --git a/NEWS b/NEWS
index f462fc1..a0aa0d0 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ What's new in psycopg 2.9.2
- Raise `ValueError` for dates >= Y10k (:ticket:`#1307`).
- `~psycopg2.errorcodes` map and `~psycopg2.errors` classes updated to
PostgreSQL 14.
+- Add preliminary support for Python 3.11 (:tickets:`#1376, #1386`).
- Wheel package compiled against OpenSSL 1.1.1l and PostgreSQL 14.1
(:ticket:`#1388`).
diff --git a/psycopg/connection_int.c b/psycopg/connection_int.c
index 34c6957..8365e04 100644
--- a/psycopg/connection_int.c
+++ b/psycopg/connection_int.c
@@ -33,6 +33,7 @@
#include "psycopg/green.h"
#include "psycopg/notify.h"
+#include <stdlib.h>
#include <string.h>
/* String indexes match the ISOLATION_LEVEL_* consts */
diff --git a/psycopg/connection_type.c b/psycopg/connection_type.c
index 92d5a86..339f7f1 100644
--- a/psycopg/connection_type.c
+++ b/psycopg/connection_type.c
@@ -35,6 +35,7 @@
#include "psycopg/green.h"
#include "psycopg/xid.h"
+#include <stdlib.h>
#include <string.h>
#include <ctype.h>
diff --git a/psycopg/pqpath.c b/psycopg/pqpath.c
index ec02067..83ab91f 100644
--- a/psycopg/pqpath.c
+++ b/psycopg/pqpath.c
@@ -47,6 +47,7 @@
#include "psycopg/libpq_support.h"
#include "libpq-fe.h"
+#include <stdlib.h>
#ifdef _WIN32
/* select() */
#include <winsock2.h>
diff --git a/psycopg/psycopgmodule.c b/psycopg/psycopgmodule.c
index 5ab6f5f..0d284f8 100644
--- a/psycopg/psycopgmodule.c
+++ b/psycopg/psycopgmodule.c
@@ -57,6 +57,8 @@
#include <datetime.h>
#include "psycopg/adapter_datetime.h"
+#include <stdlib.h>
+
HIDDEN PyObject *psycoEncodings = NULL;
HIDDEN PyObject *sqlstate_errors = NULL;
diff --git a/psycopg/replication_connection_type.c b/psycopg/replication_connection_type.c
index b8c1d2d..7e51904 100644
--- a/psycopg/replication_connection_type.c
+++ b/psycopg/replication_connection_type.c
@@ -129,6 +129,11 @@ replicationConnection_repr(replicationConnectionObject *self)
self, self->conn.dsn, self->conn.closed);
}
+static int
+replicationConnectionType_traverse(PyObject *self, visitproc visit, void *arg)
+{
+ return connectionType.tp_traverse(self, visit, arg);
+}
/* object calculated member list */
@@ -173,7 +178,7 @@ PyTypeObject replicationConnectionType = {
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_ITER |
Py_TPFLAGS_HAVE_GC, /*tp_flags*/
replicationConnectionType_doc, /*tp_doc*/
- 0, /*tp_traverse*/
+ replicationConnectionType_traverse, /*tp_traverse*/
0, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
diff --git a/psycopg/replication_cursor_type.c b/psycopg/replication_cursor_type.c
index 689a131..ab3ad3c 100644
--- a/psycopg/replication_cursor_type.c
+++ b/psycopg/replication_cursor_type.c
@@ -346,6 +346,11 @@ replicationCursor_repr(replicationCursorObject *self)
"<ReplicationCursor object at %p; closed: %d>", self, self->cur.closed);
}
+static int
+replicationCursorType_traverse(PyObject *self, visitproc visit, void *arg)
+{
+ return cursorType.tp_traverse(self, visit, arg);
+}
/* object type */
@@ -374,7 +379,7 @@ PyTypeObject replicationCursorType = {
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_ITER |
Py_TPFLAGS_HAVE_GC, /*tp_flags*/
replicationCursorType_doc, /*tp_doc*/
- 0, /*tp_traverse*/
+ replicationCursorType_traverse, /*tp_traverse*/
0, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
diff --git a/tox.ini b/tox.ini
index 8bb5669..2675527 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,10 +1,11 @@
[tox]
-envlist = {3.6,3.7,3.8,3.9,3.10}
+envlist = {3.6,3.7,3.8,3.9,3.10,3.11}
[testenv]
commands = make check
whitelist_externals = make
passenv = PG* PSYCOPG2_TEST*
+basepython = python{envname}
[flake8]
max-line-length = 85