chore: drop support for Python 3.8

This commit is contained in:
Daniele Varrazzo 2025-10-09 01:46:29 +02:00
parent c4a3866c30
commit 4ce9cc168c
8 changed files with 19 additions and 32 deletions

View File

@ -66,7 +66,7 @@ jobs:
matrix:
platform: [manylinux, musllinux]
arch: [x86_64, aarch64, ppc64le]
pyver: [cp38, cp39, cp310, cp311, cp312, cp313]
pyver: [cp39, cp310, cp311, cp312, cp313]
runs-on: ubuntu-latest
steps:
@ -184,7 +184,7 @@ jobs:
fail-fast: false
matrix:
arch: [win_amd64]
pyver: [cp38, cp39, cp310, cp311, cp312, cp313]
pyver: [cp39, cp310, cp311, cp312, cp313]
package_name: [psycopg2, psycopg2-binary]
defaults:

View File

@ -16,7 +16,6 @@ jobs:
fail-fast: false
matrix:
include:
- {python: "3.8", postgres: "12"}
- {python: "3.9", postgres: "13"}
- {python: "3.10", postgres: "14"}
- {python: "3.11", postgres: "15"}
@ -24,12 +23,11 @@ jobs:
- {python: "3.13", postgres: "17"}
# Opposite extremes of the supported Py/PG range, other architecture
- {python: "3.8", postgres: "17", architecture: "x86"}
- {python: "3.9", postgres: "16", architecture: "x86"}
- {python: "3.10", postgres: "15", architecture: "x86"}
- {python: "3.11", postgres: "14", architecture: "x86"}
- {python: "3.12", postgres: "13", architecture: "x86"}
- {python: "3.13", postgres: "12", architecture: "x86"}
- {python: "3.9", postgres: "17", architecture: "x86"}
- {python: "3.10", postgres: "16", architecture: "x86"}
- {python: "3.11", postgres: "15", architecture: "x86"}
- {python: "3.12", postgres: "14", architecture: "x86"}
- {python: "3.13", postgres: "13", architecture: "x86"}
env:
PSYCOPG2_TESTDB: postgres

6
NEWS
View File

@ -1,6 +1,12 @@
Current release
---------------
What's new in psycopg 2.9.11
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Drop support for Python 3.8.
What's new in psycopg 2.9.10
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -131,7 +131,7 @@ The current `!psycopg2` implementation supports:
..
NOTE: keep consistent with setup.py and the /features/ page.
- Python versions from 3.8 to 3.13
- Python versions from 3.9 to 3.13
- PostgreSQL server versions from 7.4 to 17
- PostgreSQL client library version from 9.1

View File

@ -27,8 +27,8 @@
#ifndef PSYCOPG_PYTHON_H
#define PSYCOPG_PYTHON_H 1
#if PY_VERSION_HEX < 0x03080000
#error "psycopg requires Python 3.8"
#if PY_VERSION_HEX < 0x03090000
#error "psycopg requires Python 3.9"
#endif
#include <structmember.h>

View File

@ -395,25 +395,9 @@ psyco_is_main_interp(void)
#if PY_VERSION_HEX >= 0x030d0000
/* tested with Python 3.13.0a6 */
return PyInterpreterState_Get() == PyInterpreterState_Main();
#elif PY_VERSION_HEX >= 0x03080000
#else
/* tested with Python 3.8.0a2 */
return _PyInterpreterState_Get() == PyInterpreterState_Main();
#else
static PyInterpreterState *main_interp = NULL; /* Cached reference */
PyInterpreterState *interp;
if (main_interp) {
return (main_interp == PyThreadState_Get()->interp);
}
/* No cached value: cache the proper value and try again. */
interp = PyInterpreterState_Head();
while (interp->next)
interp = interp->next;
main_interp = interp;
assert (main_interp);
return psyco_is_main_interp();
#endif
}

View File

@ -51,7 +51,6 @@ Intended Audience :: Developers
License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
@ -524,7 +523,7 @@ setup(name="psycopg2",
url="https://psycopg.org/",
license="LGPL with exceptions",
platforms=["any"],
python_requires='>=3.8',
python_requires='>=3.9',
description=readme.split("\n")[0],
long_description="\n".join(readme.split("\n")[2:]).lstrip(),
classifiers=[x for x in classifiers.split("\n") if x],

View File

@ -1,5 +1,5 @@
[tox]
envlist = {3.8,3.9,3.10,3.11,3.12,3.13}
envlist = {3.9,3.10,3.11,3.12,3.13}
[testenv]
commands = make check