Skip to content

Commit

Permalink
Do not use Cython 3 on build deps
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jborean93 committed Sep 12, 2023
1 parent 3a14a03 commit 5c316ec
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -257,6 +294,7 @@ jobs:
name: publish

needs:
- assertion_build
- linux
- macos
- windows
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='[email protected]',
packages=['gssapi', 'gssapi.raw', 'gssapi.raw._enum_extensions',
Expand Down

0 comments on commit 5c316ec

Please sign in to comment.