pythongssapi / python-gssapi

A Python interface to RFC 2743/2744 (plus common extensions)
ISC License
103 stars 45 forks source link

Cython 3 compatibility #319

Closed mgorny closed 1 year ago

mgorny commented 1 year ago

What went wrong?

Please provide support for Cython 3. It's at 3.0.0b3 right now, and the final release is nearing.

FWICS the extensions seem to build fine but don't import afterwards:

$ python -c 'import gssapi.raw'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/python-gssapi/gssapi/__init__.py", line 31, in <module>
    from gssapi.raw.types import NameType, RequirementFlag, AddressType  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/python-gssapi/gssapi/raw/__init__.py", line 45, in <module>
    importlib.import_module('{0}._enum_extensions.{1}'.format(__name__, name))
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "gssapi/raw/_enum_extensions/ext_dce.pyx", line 3, in init gssapi.raw._enum_extensions.ext_dce
    import gssapi.raw._enum_extensions as ext_registry
ModuleNotFoundError: No module named 'gssapi.raw'

How do we reproduce?

pip install --pre cython
python setup.py build_ext -i
python -c 'import gssapi.raw

Component versions (python-gssapi, Kerberos, OS / distro, etc.)

Reproduced on 86e99576be166695130fd5281efebf2ec8ee24e3.

Gentoo Linux amd64

jborean93 commented 1 year ago

While yes we should add support for Cython 3 it isn't pressing right now. The build requirements set an upper bound for < 3.0.0 https://github.com/pythongssapi/python-gssapi/blob/main/pyproject.toml#L3 so when the actual Cython 3 release comes out the build dep solver should not select it.

jborean93 commented 1 year ago

The PR fixes the incompatibility https://github.com/pythongssapi/python-gssapi/pull/321.