From 5c316ec3c8f99d3df6d689fadff4a391658e026a Mon Sep 17 00:00:00 2001 From: Jordan Borean Date: Wed, 30 Aug 2023 07:40:33 +1000 Subject: [PATCH] Do not use Cython 3 on build deps Cython 3 generates code which fails on Python that was built with assertions enabled. This commit adds the upper bound version until this issue has been fixed. CI has been updated to test out this specific scenario. Signed-off-by: Jordan Borean --- .github/workflows/ci.yml | 38 ++++++++++++++++++++++++++++++++++++++ pyproject.toml | 4 +++- setup.py | 2 +- 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85636ea..ad5aeab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -134,6 +134,43 @@ jobs: path: ./wheelhouse/*.whl name: artifact + # To catch issues like this https://github.com/pythongssapi/python-gssapi/issues/327 + assertion_build: + needs: + - build_sdist + + runs-on: ubuntu-latest + steps: + - name: Download gssapi sdist + uses: actions/download-artifact@v3 + with: + name: artifact + path: ./dist + + - name: Compile Python with assertions + shell: bash + run: | + PYTHON_VERSION="3.11.5" + wget --quiet "https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz" + tar xf "Python-${PYTHON_VERSION}.tar.xz" + cd "Python-${PYTHON_VERSION}/" + ./configure --with-assertions --prefix "${PWD}/../Python-${PYTHON_VERSION}-build" + make + make install + cd .. + + sudo apt-get update + DEBIAN_FRONTEND=noninteractive sudo apt-get -y install krb5-user libkrb5-dev + + GSSAPI_VER="$( find ./dist -type f -name 'gssapi-*.tar.gz' -printf "%f\n" | sed -n 's/gssapi-\(.*\)\.tar\.gz/\1/p' )" + + PATH="${PWD}/Python-${PYTHON_VERSION}-build/bin:${PATH}" + python3 -m pip install gssapi=="${GSSAPI_VER}" \ + --find-links "file://${PWD}/dist" \ + --verbose + + python3 -c "import gssapi" + linux: needs: - build_sdist @@ -257,6 +294,7 @@ jobs: name: publish needs: + - assertion_build - linux - macos - windows diff --git a/pyproject.toml b/pyproject.toml index 5ee26df..355e10f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,8 @@ [build-system] requires = [ - "Cython >= 0.29.29, < 4.0.0", # 0.29.29 includes fixes for Python 3.11 + # 0.29.29 includes fixes for Python 3.11 + # Cannot use 3 until https://github.com/cython/cython/issues/5665 is fixed + "Cython >= 0.29.29, < 3.0.0", "setuptools >= 40.6.0", # Start of PEP 517 support for setuptools ] build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index ea8b914..a71967f 100755 --- a/setup.py +++ b/setup.py @@ -274,7 +274,7 @@ def gssapi_modules(lst): setup( name='gssapi', - version='1.8.3', + version='1.8.4', author='The Python GSSAPI Team', author_email='jborean93@gmail.com', packages=['gssapi', 'gssapi.raw', 'gssapi.raw._enum_extensions',