Skip to content

Commit

Permalink
chore: drop support for Python 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
dvarrazzo committed Oct 3, 2023
1 parent 2da65a7 commit abf2723
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 28 deletions.
6 changes: 6 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Current release
---------------

What's new in psycopg 2.9.9
^^^^^^^^^^^^^^^^^^^^^^^^^^^

- Drop support for Python 3.6.


What's new in psycopg 2.9.8
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
2 changes: 1 addition & 1 deletion doc/src/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ The current `!psycopg2` implementation supports:
..
NOTE: keep consistent with setup.py and the /features/ page.
- Python versions from 3.6 to 3.11
- Python versions from 3.7 to 3.11
- PostgreSQL server versions from 7.4 to 15
- PostgreSQL client library version from 9.1

Expand Down
4 changes: 2 additions & 2 deletions psycopg/python.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#ifndef PSYCOPG_PYTHON_H
#define PSYCOPG_PYTHON_H 1

#if PY_VERSION_HEX < 0x03060000
#error "psycopg requires Python 3.6"
#if PY_VERSION_HEX < 0x03070000
#error "psycopg requires Python 3.7"
#endif

#include <structmember.h>
Expand Down
20 changes: 0 additions & 20 deletions psycopg/typecast_datetime.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,8 @@ _parse_inftz(const char *str, PyObject *curs)
goto exit;
}

#if defined(PYPY_VERSION) || PY_VERSION_HEX < 0x03070000
{
PyObject *tzoff;
if (!(tzoff = PyDelta_FromDSU(0, 0, 0))) { goto exit; }
tzinfo = PyObject_CallFunctionObjArgs(tzinfo_factory, tzoff, NULL);
Py_DECREF(tzoff);
if (!tzinfo) { goto exit; }
}
#else
tzinfo = PyDateTime_TimeZone_UTC;
Py_INCREF(tzinfo);
#endif

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

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

#if PY_VERSION_HEX < 0x03070000
/* Before Python 3.7 the timezone offset had to be a whole number
* of minutes, so round the seconds to the closest minute */
tzsec = 60 * (int)round(tzsec / 60.0);
#endif
if (!(tzoff = PyDelta_FromDSU(0, tzsec, 0))) { goto exit; }
if (!(tzinfo = PyObject_CallFunctionObjArgs(tzinfo_factory, tzoff, NULL))) {
goto exit;
Expand Down
3 changes: 1 addition & 2 deletions scripts/build/appveyor.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ def py_ver(self):
For large values of 2, occasionally.
"""
rv = os.environ['PY_VER']
assert rv in ('36', '37', '38', '39', '310', '311'), rv
assert rv in ('37', '38', '39', '310', '311'), rv
return rv

@property
Expand Down Expand Up @@ -742,7 +742,6 @@ def vs_ver(self):
# Py 3.6--3.8 = VS Ver. 14.0 (VS 2015)
# Py 3.9 = VS Ver. 16.0 (VS 2019)
vsvers = {
'36': '14.0',
'37': '14.0',
'38': '14.0',
'39': '16.0',
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Expand Down Expand Up @@ -551,7 +550,7 @@ def is_py_64():
url="https://psycopg.org/",
license="LGPL with exceptions",
platforms=["any"],
python_requires='>=3.6',
python_requires='>=3.7',
description=readme.split("\n")[0],
long_description="\n".join(readme.split("\n")[2:]).lstrip(),
classifiers=[x for x in classifiers.split("\n") if x],
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = {3.6,3.7,3.8,3.9,3.10,3.11}
envlist = {3.7,3.8,3.9,3.10,3.11}

[testenv]
commands = make check
Expand Down

0 comments on commit abf2723

Please sign in to comment.