Skip to content

Commit

Permalink
Add Python 3.12 to build and manylinux.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Jun 29, 2023
1 parent a5c9dbb commit f57ae5a
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
matrix:
# XXX: PyPy 3.9 is failing to build zope.interface 6.0!
# Need to take this up with the zope.interface repo.
python-version: [3.8, 3.9, '3.10', '3.11']
python-version: ['3.12-dev', 3.8, 3.9, '3.10', '3.11']
os: [ubuntu-latest, macos-latest]
exclude:
- os: macos-latest
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
- Add the "Requires Python" metadata to prevent installation on Python
< 3.8.
- Add support for Python 3.11.
- Add preliminary support for Python 3.12. This is using a pre-release
version of Cython 3.
- Bump tested database drivers to their latest versions. In
particular, the ``mysql-connector-python`` supported version is now
8.0.32, which introduces charset changes.
Expand Down
2 changes: 1 addition & 1 deletion docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Installation
==============

RelStorage 3.0 is supported on Python 3.8, through 3.11, as well as
RelStorage 3.0 is supported on Python 3.8, through 3.12, as well as
PyPy3 3.9 or later.

.. seealso:: :doc:`supported-databases`
Expand Down
11 changes: 10 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,14 @@ requires = [
# failing in Python 2 (https://travis-ci.org/github/gevent/gevent/jobs/683782800);
# This was fixed in 3.0a5 (https://github.com/cython/cython/issues/3578).
# 3.0 in general has improved language support.
"Cython >= 3.0b3",
# Python 3.12 requires a snapshot at this writing (2023-06-29). This is just before
# 3.0rc1
"Cython >= 3.0b3; python_version < '3.12'",
"Cython @ https://github.com/cython/cython/archive/37f4dcdc04547875e2836fda076f5707ec50e579.zip",
# cffi on py3.12 macOS at least fails to install from its wheel if we let it get installed
# as part of persistent:
# OSError: [Errno 66] Directory not empty: '///persistent.../.eggs/cffi-1.15.1-py3.12-macosx-10.9-universal2.egg/cffi-1.15.1.dist-info' -> '//persistent_/.eggs/cffi-1.15.1-py3.12-macosx-10.9-universal2.egg/EGG-INFO'
# Installing it here seems to get us past that
"cffi; python_version >= '3.12'"

]
14 changes: 6 additions & 8 deletions scripts/releases/make-manylinux
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Initially based on a snippet from the greenlet project.
# This needs to be run from the root of the project.
# To update: docker pull quay.io/pypa/manylinux2010_x86_64
set -e
set -evo pipefail
export PYTHONUNBUFFERED=1
export PYTHONDONTWRITEBYTECODE=1

Expand Down Expand Up @@ -38,7 +38,7 @@ export CCACHE_DIR="/ccache"

# Disable some warnings produced by libev especially and also some Cython generated code.
# Note that changing the value of these variables invalidates configure caches

SLOW_BUILD=''
GEVENT_WARNFLAGS="-Wno-strict-aliasing -Wno-comment -Wno-unused-value -Wno-unused-but-set-variable -Wno-sign-compare -Wno-parentheses -Wno-unused-function -Wno-tautological-compare -Wno-strict-prototypes -Wno-return-type -Wno-misleading-indentation"
OPTIMIZATION_FLAGS="-pipe"
if [ -n "$GITHUB_ACTIONS" ]; then
Expand Down Expand Up @@ -97,17 +97,15 @@ if [ -d /RelStorage -a -d /opt/python ]; then
cd /RelStorage
rm -rf wheelhouse
mkdir wheelhouse

for variant in `ls -d /opt/python/cp{38,39,310,311}*`; do
# XXX: Cython 3.0b3 doesn't compile correctly on Python 3.12; the long object
# has changed.
ls -l /opt/python
for variant in `ls -d /opt/python/cp{312,38,39,310,311}*`; do
echo "Building $variant"
mkdir /tmp/build
cd /tmp/build
git clone /RelStorage RelStorage
cd RelStorage
$variant/bin/pip install -U pip
$variant/bin/pip install -U 'cython>=3.0b3' setuptools
#$variant/bin/pip install -U 'cython>=3.0b3' setuptools
PATH=$variant/bin:$PATH $variant/bin/python setup.py bdist_wheel
auditwheel show dist/RelStorage*.whl
auditwheel repair dist/RelStorage*.whl
Expand All @@ -133,5 +131,5 @@ if [ ! -d $HOME/.ccache ]; then
mkdir $HOME/.ccache
fi

docker run --rm -e GITHUB_ACTIONS -e DOCKER_IMAGE -v "$(pwd):/RelStorage" -v "$LCACHE:/cache" -v "$HOME/.ccache:/ccache" ${DOCKER_IMAGE:-quay.io/pypa/manylinux2010_x86_64} /RelStorage/scripts/releases/$(basename $0)
docker run --rm -e GITHUB_ACTIONS -e DOCKER_IMAGE -v "$(pwd):/RelStorage" -v "$LCACHE:/cache" -v "$HOME/.ccache:/ccache" ${DOCKER_IMAGE:-quay.io/pypa/manylinux2014_aarch64} /RelStorage/scripts/releases/$(basename $0)
ls -l wheelhouse
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ def read_file(*path):
PY3 = sys.version_info[0] == 3

memcache_require = [
'pylibmc; platform_python_implementation=="CPython" and sys_platform != "win32"',
# Couldn't get this building on 3.12b3;
# It's deprecated though.
'pylibmc; platform_python_implementation=="CPython" and sys_platform != "win32" and python_version < "3.12"',
'python-memcached; platform_python_implementation=="PyPy" or sys_platform == "win32"',
]

Expand Down Expand Up @@ -112,8 +114,7 @@ def read_file(*path):
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
# 3.12 pending Cython updates.
#"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Database",
Expand Down

0 comments on commit f57ae5a

Please sign in to comment.