Skip to content

Commit abf2723

Browse files
committed
chore: drop support for Python 3.6
1 parent 2da65a7 commit abf2723

File tree

7 files changed

+12
-28
lines changed

7 files changed

+12
-28
lines changed

NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Current release
22
---------------
33

4+
What's new in psycopg 2.9.9
5+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
7+
- Drop support for Python 3.6.
8+
9+
410
What's new in psycopg 2.9.8
511
^^^^^^^^^^^^^^^^^^^^^^^^^^^
612

doc/src/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ The current `!psycopg2` implementation supports:
131131
..
132132
NOTE: keep consistent with setup.py and the /features/ page.
133133
134-
- Python versions from 3.6 to 3.11
134+
- Python versions from 3.7 to 3.11
135135
- PostgreSQL server versions from 7.4 to 15
136136
- PostgreSQL client library version from 9.1
137137

psycopg/python.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
#ifndef PSYCOPG_PYTHON_H
2828
#define PSYCOPG_PYTHON_H 1
2929

30-
#if PY_VERSION_HEX < 0x03060000
31-
#error "psycopg requires Python 3.6"
30+
#if PY_VERSION_HEX < 0x03070000
31+
#error "psycopg requires Python 3.7"
3232
#endif
3333

3434
#include <structmember.h>

psycopg/typecast_datetime.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,8 @@ _parse_inftz(const char *str, PyObject *curs)
103103
goto exit;
104104
}
105105

106-
#if defined(PYPY_VERSION) || PY_VERSION_HEX < 0x03070000
107-
{
108-
PyObject *tzoff;
109-
if (!(tzoff = PyDelta_FromDSU(0, 0, 0))) { goto exit; }
110-
tzinfo = PyObject_CallFunctionObjArgs(tzinfo_factory, tzoff, NULL);
111-
Py_DECREF(tzoff);
112-
if (!tzinfo) { goto exit; }
113-
}
114-
#else
115106
tzinfo = PyDateTime_TimeZone_UTC;
116107
Py_INCREF(tzinfo);
117-
#endif
118108

119109
/* m.replace(tzinfo=tzinfo) */
120110
if (!(args = PyTuple_New(0))) { goto exit; }
@@ -178,11 +168,6 @@ _parse_noninftz(const char *str, Py_ssize_t len, PyObject *curs)
178168
appropriate tzinfo object calling the factory */
179169
Dprintf("typecast_PYDATETIMETZ_cast: UTC offset = %ds", tzsec);
180170

181-
#if PY_VERSION_HEX < 0x03070000
182-
/* Before Python 3.7 the timezone offset had to be a whole number
183-
* of minutes, so round the seconds to the closest minute */
184-
tzsec = 60 * (int)round(tzsec / 60.0);
185-
#endif
186171
if (!(tzoff = PyDelta_FromDSU(0, tzsec, 0))) { goto exit; }
187172
if (!(tzinfo = PyObject_CallFunctionObjArgs(
188173
tzinfo_factory, tzoff, NULL))) {
@@ -270,11 +255,6 @@ typecast_PYTIME_cast(const char *str, Py_ssize_t len, PyObject *curs)
270255
appropriate tzinfo object calling the factory */
271256
Dprintf("typecast_PYTIME_cast: UTC offset = %ds", tzsec);
272257

273-
#if PY_VERSION_HEX < 0x03070000
274-
/* Before Python 3.7 the timezone offset had to be a whole number
275-
* of minutes, so round the seconds to the closest minute */
276-
tzsec = 60 * (int)round(tzsec / 60.0);
277-
#endif
278258
if (!(tzoff = PyDelta_FromDSU(0, tzsec, 0))) { goto exit; }
279259
if (!(tzinfo = PyObject_CallFunctionObjArgs(tzinfo_factory, tzoff, NULL))) {
280260
goto exit;

scripts/build/appveyor.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ def py_ver(self):
660660
For large values of 2, occasionally.
661661
"""
662662
rv = os.environ['PY_VER']
663-
assert rv in ('36', '37', '38', '39', '310', '311'), rv
663+
assert rv in ('37', '38', '39', '310', '311'), rv
664664
return rv
665665

666666
@property
@@ -742,7 +742,6 @@ def vs_ver(self):
742742
# Py 3.6--3.8 = VS Ver. 14.0 (VS 2015)
743743
# Py 3.9 = VS Ver. 16.0 (VS 2019)
744744
vsvers = {
745-
'36': '14.0',
746745
'37': '14.0',
747746
'38': '14.0',
748747
'39': '16.0',

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
5353
Programming Language :: Python
5454
Programming Language :: Python :: 3
55-
Programming Language :: Python :: 3.6
5655
Programming Language :: Python :: 3.7
5756
Programming Language :: Python :: 3.8
5857
Programming Language :: Python :: 3.9
@@ -551,7 +550,7 @@ def is_py_64():
551550
url="https://psycopg.org/",
552551
license="LGPL with exceptions",
553552
platforms=["any"],
554-
python_requires='>=3.6',
553+
python_requires='>=3.7',
555554
description=readme.split("\n")[0],
556555
long_description="\n".join(readme.split("\n")[2:]).lstrip(),
557556
classifiers=[x for x in classifiers.split("\n") if x],

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = {3.6,3.7,3.8,3.9,3.10,3.11}
2+
envlist = {3.7,3.8,3.9,3.10,3.11}
33

44
[testenv]
55
commands = make check

0 commit comments

Comments
 (0)