diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 16d6a88f..cc128f76 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,6 +38,9 @@ jobs: - python-version: '3.13' toxenv: 'py313-test' + - python-version: '3.14' + toxenv: 'py314-test' + - python-version: 'pypy-3.11' toxenv: 'pypy3-test' @@ -65,7 +68,7 @@ jobs: pip install -U pip # so that we can use wheels # tox creates the sdist: we need cython to be installed in the env which # creates the sdist, to generate the .c files - pip install tox==4.25.0 cython==3.0.12 + pip install tox==4.25.0 cython==3.1.7 - name: Run tox run: tox -e ${{ matrix.toxenv }} diff --git a/capnpy/_hash.h b/capnpy/_hash.h index 18f29f17..dcbda235 100644 --- a/capnpy/_hash.h +++ b/capnpy/_hash.h @@ -25,7 +25,13 @@ typedef struct { // Use values / methods from CPython 3.5 #define HASH_MASK _PyHASH_MODULUS + + // https://groups.google.com/g/cython-users/c/YQkU8oc8oSM/m/nVJ_IX8KAgAJ + #if PY_VERSION_HEX < 0x030E0000 #define strhash_f _Py_HashBytes + #else + #define strhash_f Py_HashBuffer + #endif // Unused in Python 3, but has to exist during cython compilation _Py_HashSecret_custom HashSecret; diff --git a/setup.py b/setup.py index 197544dd..a3ae716d 100644 --- a/setup.py +++ b/setup.py @@ -59,6 +59,7 @@ """ MIN_REQUIRED_CYTHON_VERSION = "0.29.30" +MAX_CYTHON_VERSION = "3.1.7" ############################################################################### # Custom distutils commands @@ -167,7 +168,7 @@ def getext(fname): if USE_CYTHON: ext_modules = get_cython_extensions() - extra_install_requires = [f'cython>={MIN_REQUIRED_CYTHON_VERSION}'] + extra_install_requires = [f'cython>={MIN_REQUIRED_CYTHON_VERSION},<={MAX_CYTHON_VERSION}'] else: ext_modules = [] extra_install_requires = [] diff --git a/tox.ini b/tox.ini index be29406b..ff3d9a38 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] # nopyx is a special env where Cython is NOT installed, and thus we run # pure-python tests -envlist = py37-test,py38-test,py39-test,py310-test,py311-test,py312-test,py313-test,pypy-{test,bench},pypy3-{test},docs +envlist = py37-test,py38-test,py39-test,py310-test,py311-test,py312-test,py313-test,py314-test,pypy-{test,bench},pypy3-{test},docs [testenv] setenv =