Skip to content

Commit 9e3f0c2

Browse files
authored
Merge pull request #518 from zodb/py314
Python 3.14 support
2 parents 8fc73c4 + 818b985 commit 9e3f0c2

File tree

17 files changed

+138
-72
lines changed

17 files changed

+138
-72
lines changed

.coveragerc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ omit =
99
# Probably not since we're now installing in non-editable mode.
1010
relative_files = True
1111

12+
# In 7.9.1, the default trace engine changed to ``sys.monitoring``
13+
# for Python 3.14rc1+, but that breaks us when we test gevent (
14+
# where me manually pass the --concurrency=greenlet arg):
15+
# ConfigError: Can't support concurrency=greenlet with SysMonitor, only threads
16+
# so force it to always be ctrace.
17+
core = ctrace
18+
1219
[report]
1320
# Coverage is run on Linux under cPython 2 and 3,
1421
# against MySQL and PostgreSQL, so

.github/actions/run-tests/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ runs:
1414
steps:
1515
- name: Test gevent concurrency
1616
shell: bash
17-
# Do we need to test this on macOS? At this writing, that's the only platform
18-
# we're testing 3.12 on, and gevent isn't out yet for 3.12.
17+
# See also .coveragerc because we force the tracer.
1918
if: startsWith(runner.os, 'Linux')
2019
run: |
2120
echo "Using coverage? ${{ inputs.useCoverage }}"

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Keep GitHub Actions up to date with GitHub's Dependabot...
2+
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
3+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
4+
version: 2
5+
updates:
6+
- package-ecosystem: github-actions
7+
directory: /
8+
groups:
9+
github-actions:
10+
patterns:
11+
- "*" # Group all Actions updates into a single larger pull request
12+
schedule:
13+
interval: monthly

.github/workflows/tests.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ jobs:
9393
- '3.11'
9494
- "3.12"
9595
- "3.13"
96-
- "pypy-3.10-v7.3.17"
96+
- "pypy-3.11"
97+
- "3.14.0-rc.3"
9798
os: [ubuntu-latest, macos-latest]
9899
exclude:
99100
# Can't build persistent on 3.12 with -UNDEBUG because it
@@ -102,14 +103,14 @@ jobs:
102103
# persistent wheel, we have to exclude that one.
103104
# The same thing goes for PyPy.
104105
- os: ubuntu-latest
105-
python-version: "pypy-3.10-v7.3.17"
106+
python-version: "pypy-3.11"
106107

107108
steps:
108109
- name: checkout
109-
uses: actions/checkout@v4
110+
uses: actions/checkout@v5
110111

111112
- name: Set up Python ${{ matrix.python-version }}
112-
uses: actions/setup-python@v5
113+
uses: actions/setup-python@v6
113114
with:
114115
python-version: ${{ matrix.python-version }}
115116
cache: 'pip'
@@ -258,7 +259,7 @@ jobs:
258259
- name: checkout
259260
uses: actions/checkout@v4
260261
- name: Set up Python ${{ matrix.python-version }}
261-
uses: actions/setup-python@v5
262+
uses: actions/setup-python@v6
262263
with:
263264
python-version: ${{ matrix.python-version }}
264265
- name: Set up QEMU
@@ -275,7 +276,7 @@ jobs:
275276
path: wheelhouse/*whl
276277
name: ${{ matrix.image }}_wheels.zip
277278
- name: Publish package to PyPI
278-
uses: pypa/gh-action-pypi-publish@v1.10.3
279+
uses: pypa/gh-action-pypi-publish@v1.13.0
279280
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
280281
with:
281282
user: __token__

.travis/zope_testrunner_gevent.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python
12
# -*- coding: utf-8 -*-
23
"""
34
Script to run zope.testrunner in a gevent monkey-patched environment.
@@ -9,10 +10,6 @@
910
threadpool isn't functional.
1011
1112
"""
12-
from __future__ import absolute_import
13-
from __future__ import division
14-
from __future__ import print_function
15-
1613
import gevent.monkey
1714
gevent.monkey.patch_all()
1815
# pylint:disable=wrong-import-position, wrong-import-order

CHANGES.rst

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,28 @@
22
Changes
33
=========
44

5-
4.1.2 (unreleased)
5+
4.3.0 (unreleased)
66
==================
77

8-
- Nothing changed yet.
8+
- Add support for Python 3.14.
9+
10+
.. note::
11+
12+
This will be the last RelStorage release to support Python 3.9.
13+
14+
.. warning::
15+
16+
Current releases of ``persistent``, up through at least 6.1.1,
17+
do not properly invalidate objects on Python 3.14. Most
18+
applications probably won't notice, but there may be issues with
19+
blobs, or if applications have a particular reliance on
20+
``__dict__`` being immediately cleared after an object is
21+
invalidated. See `PR 221 <https://github.com/zopefoundation/persistent/pull/221>`_.
22+
23+
- Include ``psycopg2`` in the ``postgresql`` extra on CPython 3.13+.
24+
See :issue:`515`.
25+
- Increase the minimum supported version of ``mysql-connector-python``
26+
from 8.0.32 to 9.2.0.
927

1028

1129
4.1.1 (2024-12-12)

appveyor.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ environment:
1515
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\.travis\\run_with_env.cmd"
1616
# Use a fixed hash seed for reproducability
1717
PYTHONHASHSEED: 8675309
18+
PYTHONWARNINGS: ignore
1819
MYSQL_PWD: "Password12!"
1920
PGPASSWORD: "Password12!"
2021
PGUSER: "postgres"
@@ -37,6 +38,11 @@ environment:
3738
# Fully supported 64-bit versions, with testing. This should be
3839
# all the current (non EOL) versions.
3940

41+
- PYTHON: "C:\\Python314-x64"
42+
PYTHON_VERSION: "3.14.0rc3"
43+
PYTHON_ARCH: "64"
44+
PYTHON_EXE: python
45+
4046
- PYTHON: "C:\\Python313-x64"
4147
PYTHON_VERSION: "3.13.0"
4248
PYTHON_ARCH: "64"

docs/mysql/options.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ driver
6262
This is the `official client
6363
<https://dev.mysql.com/doc/connector-python/en/>`_ built by
6464
Oracle and distributed as `mysql-connector-python on PyPI
65-
<https://pypi.org/project/mysql-connector-python/8.0.17/#files>`_.
65+
<https://pypi.org/project/mysql-connector-python/9.4.0/#files>`_.
6666

6767
It has an optional C extension. The C extension (which uses the
6868
MySQL client libraries) performs about as well as mysqlclient,

scripts/releases/make-manylinux

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,8 @@ if [ -d /RelStorage ] && [ -d /opt/python ]; then
5858
rm -rf wheelhouse
5959
mkdir wheelhouse
6060
ls -l /opt/python
61-
for variant in `ls -d /opt/python/cp{312,39,310,311,313}*`; do
61+
for variant in `ls -d /opt/python/cp{314,312,39,310,311,313}*`; do
6262
echo "Building $variant"
63-
if [ "$variant" = "/opt/python/cp313-cp313t" ]; then
64-
# It appears that Cython 3.0.11 cannot produce code that
65-
# works here. Lots of compiler errors.
66-
echo "Unable to build without gil"
67-
continue
68-
fi
6963
mkdir /tmp/build
7064
cd /tmp/build
7165
git clone /RelStorage RelStorage
@@ -74,9 +68,9 @@ if [ -d /RelStorage ] && [ -d /opt/python ]; then
7468
$variant/bin/pip install -U setuptools
7569
$variant/bin/pip install -U 'cython>=3.0'
7670
PATH=$variant/bin:$PATH $variant/bin/python setup.py bdist_wheel
77-
auditwheel show dist/RelStorage*.whl
78-
auditwheel repair dist/RelStorage*.whl
79-
cp wheelhouse/RelStorage*.whl /RelStorage/wheelhouse
71+
auditwheel show dist/relstorage*.whl
72+
auditwheel repair dist/relstorage*.whl
73+
cp wheelhouse/relstorage*.whl /RelStorage/wheelhouse
8074
cd /RelStorage
8175
rm -rf /tmp/build
8276
done

setup.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -165,21 +165,23 @@ def read_file(*path):
165165
packages=find_packages('src'),
166166
package_dir={'': 'src'},
167167
include_package_data=True,
168-
license="ZPL 2.1",
168+
license="ZPL-2.1",
169169
platforms=["any"],
170170
description="A backend for ZODB that stores pickles in a relational database.",
171-
# 3.8: importlib.metadata
171+
# Bump to 3.10 or even 3.11 at next release. We'll have to make changes
172+
# in this file and our CI configuration to make sure we still have the
173+
# same test coverage, as we were using just 3.9 for some things.
172174
python_requires=">=3.9",
173175
classifiers=[
174176
"Intended Audience :: Developers",
175-
"License :: OSI Approved :: Zope Public License",
176177
"Programming Language :: Python",
177178
"Programming Language :: Python :: 3 :: Only",
178179
"Programming Language :: Python :: 3.9",
179180
"Programming Language :: Python :: 3.10",
180181
"Programming Language :: Python :: 3.11",
181182
"Programming Language :: Python :: 3.12",
182183
"Programming Language :: Python :: 3.13",
184+
"Programming Language :: Python :: 3.14",
183185
"Programming Language :: Python :: Implementation :: CPython",
184186
"Programming Language :: Python :: Implementation :: PyPy",
185187
"Topic :: Database",
@@ -298,19 +300,17 @@ def read_file(*path):
298300
# and the authors specifically request that other modules not depend on
299301
# psycopg2-binary.
300302
# See http://initd.org/psycopg/docs/install.html#binary-packages
301-
'postgresql: platform_python_implementation == "CPython" and python_version != "3.13"' : [
303+
'postgresql: platform_python_implementation == "CPython"' : [
302304
# 2.4.1+ is required for proper bytea handling;
303305
# 2.6+ is needed for 64-bit lobject support;
304306
# 2.7+ is needed for Python 3.7 support and PostgreSQL 10+;
305307
# 2.7.6+ is needed for PostgreSQL 11;
306308
# 2.8 is needed for conn.info
307309
# 2.9.10 will be needed for Python 3.13, but it's not out yet.
308310
'psycopg2 >= 2.8.3',
309-
],
310-
'postgresql: platform_python_implementation == "CPython" and python_version == "3.13"': [
311-
# psycopg2 2.9.10 is needed, but not available yet.
312-
# See also 'all tested drivers'
313-
'pg8000',
311+
# However, at this writing, psycopg2 2.9.10, even though it can be built
312+
# for 3.14rc1 cannot be imported on that version. This is a fallback.
313+
'pg8000 >= 1.29.0; python_version >= "3.14" and sys_platform == "win32"',
314314
],
315315
'postgresql: platform_python_implementation == "PyPy"': [
316316
# 2.8.0+ is needed for Python 3.7
@@ -340,7 +340,7 @@ def read_file(*path):
340340
'all_tested_drivers': [
341341
# Install all the supported drivers for the platform.
342342
# Spread them out across the versions to not load any one
343-
# up too heavy for better parallelism.
343+
# up too heavy for better job-level parallelism in CI.
344344

345345
# First, mysql
346346
# pymysql on 3.9 on all platforms.
@@ -349,17 +349,17 @@ def read_file(*path):
349349
'mysqlclient >= 2.0.0',
350350
# mysql-connector-python; one of two pure-python versions
351351
# This requirement is repeated in the driver class.
352-
'mysql-connector-python >= 8.0.32; python_version == "3.10"',
352+
'mysql-connector-python >= 9.2.0; python_version == "3.10"',
353353

354354
# postgresql
355355
# pure-python
356356
# pg8000
357357
# This requirement is repeated in the driver class.
358-
'pg8000 >= 1.29.0; python_version == "3.11" or python_version == "3.13"',
358+
'pg8000 >= 1.29.0; python_version == "3.11"',
359359
# CFFI, runs on all implementations.
360360
'psycopg2cffi >= 2.7.4; python_version == "3.11" or platform_python_implementation == "PyPy"',
361361
# Psycopg2 on all CPython, it's the default
362-
'psycopg2 >= 2.8.3; platform_python_implementation == "CPython" and python_version != "3.13"',
362+
'psycopg2 >= 2.8.3; platform_python_implementation == "CPython"',
363363
],
364364
},
365365
entry_points={

0 commit comments

Comments
 (0)