Skip to content

python 3.13 (which requires cython 3) remove 3.8 #751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cmacdonald
Copy link
Contributor

recent comments on #739 suggested problems building on Python 3.13; Through experimentation on GHAs, I found that Python 3.13 requires Cython 3.

The enclosed PR forces use of Cython 3 for Python 3.13.

Thanks to @gituser789 and @white-gecko for spotting it was about Python versions.

@white-gecko
Copy link

Unfortunately trying to install this branch with poetry fails, even without a lot of output :-\

$ poetry add git+https://github.com/cmacdonald/pyjnius.git#py3.13

Updating dependencies
Resolving dependencies... (0.1s)

Package operations: 1 install, 0 updates, 0 removals

  - Installing pyjnius (1.6.1 dbce629): Failed

In a python 3.13.2 environment.

@white-gecko
Copy link

Here is the output:

$ poetry run pip install --verbose git+https://github.com/cmacdonald/pyjnius.git@py3.13
Using pip 25.0.1 from /myhome/.cache/pypoetry/virtualenvs/pyjn--CgpPmpQ-py3.13/lib/python3.13/site-packages/pip (python 3.13)
Collecting git+https://github.com/cmacdonald/pyjnius.git@py3.13
  Cloning https://github.com/cmacdonald/pyjnius.git (to revision py3.13) to /tmp/pip-req-build-k7mu6v1r
  Running command git version
  git version 2.49.0
  Running command git clone --filter=blob:none https://github.com/cmacdonald/pyjnius.git /tmp/pip-req-build-k7mu6v1r
  Cloning into '/tmp/pip-req-build-k7mu6v1r'...
  Running command git show-ref py3.13
  dbce6298e81d248998dae715b16f171290cdcd86 refs/remotes/origin/py3.13
  Running command git symbolic-ref -q HEAD
  refs/heads/master
  Running command git checkout -b py3.13 --track origin/py3.13
  Switched to a new branch 'py3.13'
  branch 'py3.13' set up to track 'origin/py3.13'.
  Resolved https://github.com/cmacdonald/pyjnius.git to commit dbce6298e81d248998dae715b16f171290cdcd86
  Running command git rev-parse HEAD
  dbce6298e81d248998dae715b16f171290cdcd86
  Running command pip subprocess to install build dependencies
  Using pip 25.0.1 from /myhome/.cache/pypoetry/virtualenvs/pyjn--CgpPmpQ-py3.13/lib/python3.13/site-packages/pip (python 3.13)
  Ignoring Cython: markers 'python_version < "3.13"' don't match your environment
  Collecting setuptools>=58.0.0
    Obtaining dependency information for setuptools>=58.0.0 from https://files.pythonhosted.org/packages/54/21/f43f0a1fa8b06b32812e0975981f4677d28e0f3271601dc88ac5a5b83220/setuptools-78.1.0-py3-none-any.whl.metadata
    Using cached setuptools-78.1.0-py3-none-any.whl.metadata (6.6 kB)
  Collecting wheel
    Obtaining dependency information for wheel from https://files.pythonhosted.org/packages/0b/2c/87f3254fd8ffd29e4c02732eee68a83a1d3c346ae39bc6822dcbcb697f2b/wheel-0.45.1-py3-none-any.whl.metadata
    Using cached wheel-0.45.1-py3-none-any.whl.metadata (2.3 kB)
  Collecting Cython>3
    Obtaining dependency information for Cython>3 from https://files.pythonhosted.org/packages/a8/30/7f48207ea13dab46604db0dd388e807d53513ba6ad1c34462892072f8f8c/Cython-3.0.12-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
    Using cached Cython-3.0.12-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.5 kB)
  Using cached setuptools-78.1.0-py3-none-any.whl (1.3 MB)
  Using cached wheel-0.45.1-py3-none-any.whl (72 kB)
  Using cached Cython-3.0.12-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB)
  Installing collected packages: wheel, setuptools, Cython
    Creating /tmp/pip-build-env-t5jgczlh/overlay/bin
    changing mode of /tmp/pip-build-env-t5jgczlh/overlay/bin/wheel to 755
    changing mode of /tmp/pip-build-env-t5jgczlh/overlay/bin/cygdb to 755
    changing mode of /tmp/pip-build-env-t5jgczlh/overlay/bin/cython to 755
    changing mode of /tmp/pip-build-env-t5jgczlh/overlay/bin/cythonize to 755
  Successfully installed Cython-3.0.12 setuptools-78.1.0 wheel-0.45.1
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  warning: [options] bootstrap class path not set in conjunction with -source 8
  warning: [options] source value 8 is obsolete and will be removed in a future release
  warning: [options] target value 8 is obsolete and will be removed in a future release
  warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
  4 warnings
  /tmp/pip-build-env-t5jgczlh/overlay/lib/python3.13/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
  !!

          ********************************************************************************
          Please consider removing the following classifiers in favor of a SPDX license expression:

          License :: OSI Approved :: MIT License

          See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
          ********************************************************************************

  !!
    self._finalize_license_expression()
  running egg_info
  creating pyjnius.egg-info
  writing pyjnius.egg-info/PKG-INFO
  writing dependency_links to pyjnius.egg-info/dependency_links.txt
  writing requirements to pyjnius.egg-info/requires.txt
  writing top-level names to pyjnius.egg-info/top_level.txt
  writing manifest file 'pyjnius.egg-info/SOURCES.txt'
  reading manifest file 'pyjnius.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE'
  writing manifest file 'pyjnius.egg-info/SOURCES.txt'
  Getting requirements to build wheel ... done
  Running command Preparing metadata (pyproject.toml)
  warning: [options] bootstrap class path not set in conjunction with -source 8
  warning: [options] source value 8 is obsolete and will be removed in a future release
  warning: [options] target value 8 is obsolete and will be removed in a future release
  warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
  4 warnings
  /tmp/pip-build-env-t5jgczlh/overlay/lib/python3.13/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
  !!

          ********************************************************************************
          Please consider removing the following classifiers in favor of a SPDX license expression:

          License :: OSI Approved :: MIT License

          See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
          ********************************************************************************

  !!
    self._finalize_license_expression()
  running dist_info
  creating /tmp/pip-modern-metadata-tefr9o3_/pyjnius.egg-info
  writing /tmp/pip-modern-metadata-tefr9o3_/pyjnius.egg-info/PKG-INFO
  writing dependency_links to /tmp/pip-modern-metadata-tefr9o3_/pyjnius.egg-info/dependency_links.txt
  writing requirements to /tmp/pip-modern-metadata-tefr9o3_/pyjnius.egg-info/requires.txt
  writing top-level names to /tmp/pip-modern-metadata-tefr9o3_/pyjnius.egg-info/top_level.txt
  writing manifest file '/tmp/pip-modern-metadata-tefr9o3_/pyjnius.egg-info/SOURCES.txt'
  reading manifest file '/tmp/pip-modern-metadata-tefr9o3_/pyjnius.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE'
  writing manifest file '/tmp/pip-modern-metadata-tefr9o3_/pyjnius.egg-info/SOURCES.txt'
  creating '/tmp/pip-modern-metadata-tefr9o3_/pyjnius-1.6.1.dist-info'
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pyjnius
  Running command git rev-parse HEAD
  dbce6298e81d248998dae715b16f171290cdcd86
  Running command Building wheel for pyjnius (pyproject.toml)
  warning: [options] bootstrap class path not set in conjunction with -source 8
  warning: [options] source value 8 is obsolete and will be removed in a future release
  warning: [options] target value 8 is obsolete and will be removed in a future release
  warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
  4 warnings
  /tmp/pip-build-env-t5jgczlh/overlay/lib/python3.13/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
  !!

          ********************************************************************************
          Please consider removing the following classifiers in favor of a SPDX license expression:

          License :: OSI Approved :: MIT License

          See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
          ********************************************************************************

  !!
    self._finalize_license_expression()
  running bdist_wheel
  running build
  running build_py
  creating build/lib.linux-x86_64-cpython-313
  copying jnius_config.py -> build/lib.linux-x86_64-cpython-313
  copying setup_sdist.py -> build/lib.linux-x86_64-cpython-313
  creating build/lib.linux-x86_64-cpython-313/jnius
  copying jnius/__init__.py -> build/lib.linux-x86_64-cpython-313/jnius
  copying jnius/env.py -> build/lib.linux-x86_64-cpython-313/jnius
  copying jnius/signatures.py -> build/lib.linux-x86_64-cpython-313/jnius
  copying jnius/reflect.py -> build/lib.linux-x86_64-cpython-313/jnius
  copying jnius/env.py -> build/lib.linux-x86_64-cpython-313/jnius
  copying jnius/__init__.py -> build/lib.linux-x86_64-cpython-313/jnius
  creating build/lib.linux-x86_64-cpython-313/jnius/src/org/jnius
  copying jnius/src/org/jnius/NativeInvocationHandler.class -> build/lib.linux-x86_64-cpython-313/jnius/src/org/jnius
  copying jnius/src/org/jnius/NativeInvocationHandler.java -> build/lib.linux-x86_64-cpython-313/jnius/src/org/jnius
  running build_ext
  warning: jnius/jnius.pyx:102:0: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
  Compiling jnius/jnius.pyx because it changed.
  [1/1] Cythonizing jnius/jnius.pyx
  building 'jnius' extension
  creating build/temp.linux-x86_64-cpython-313/jnius
  gcc -fno-strict-overflow -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -fcf-protection -fexceptions -fcf-protection -fexceptions -fcf-protection -fexceptions -O3 -fPIC -I/usr/lib/jvm/java-21-openjdk/include -I/usr/lib/jvm/java-21-openjdk/include/linux -I/myhome/.cache/pypoetry/virtualenvs/pyjn--CgpPmpQ-py3.13/include -I/usr/include/python3.13 -c jnius/jnius.c -o build/temp.linux-x86_64-cpython-313/jnius/jnius.o
  jnius/jnius.c: In function ‘__pyx_f_5jnius_get_jnienv’:
  jnius/jnius.c:22633:76: error: passing argument 2 of ‘(*__pyx_v_5jnius_jvm)->AttachCurrentThread’ from incompatible pointer type [-Wincompatible-pointer-types]
  22633 |   (void)((__pyx_v_5jnius_jvm[0])->AttachCurrentThread(__pyx_v_5jnius_jvm, (&__pyx_v_env), NULL));
        |                                                                           ~^~~~~~~~~~~~~
        |                                                                            |
        |                                                                            const struct JNINativeInterface_ ***
  jnius/jnius.c:22633:76: note: expected ‘void **’ but argument is of type ‘const struct JNINativeInterface_ ***’
  jnius/jnius.c: In function ‘__pyx_f_5jnius_convert_jstring_to_python’:
  jnius/jnius.c:31064:19: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  31064 |   __pyx_v_j_chars = (__pyx_v_j_env[0])->GetStringChars(__pyx_v_j_env, __pyx_v_j_string, NULL);
        |                   ^
  jnius/jnius.c: In function ‘__pyx_pf_5jnius_13MetaJavaClass_8resolve_class’:
  jnius/jnius.c:43990:30: error: assignment to ‘jobject’ {aka ‘struct _jobject *’} from incompatible pointer type ‘struct _jobject **’ [-Wincompatible-pointer-types]
  43990 |           (__pyx_v_jargs[0]) = ((jobject *)__pyx_v_classLoader);
        |                              ^
  jnius/jnius.c:43999:30: error: assignment to ‘jobject’ {aka ‘struct _jobject *’} from incompatible pointer type ‘struct _jobject **’ [-Wincompatible-pointer-types]
  43999 |           (__pyx_v_jargs[1]) = __pyx_v_interfaces;
        |                              ^
  jnius/jnius.c: In function ‘__pyx_f_5jnius_create_proxy_instance’:
  jnius/jnius.c:61712:36: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  61712 |   (__pyx_v_invoke_methods[0]).name = ((char const *)"invoke0");
        |                                    ^
  jnius/jnius.c:61721:41: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  61721 |   (__pyx_v_invoke_methods[0]).signature = ((char const *)"(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;");
        |                                         ^
  error: command '/usr/bin/gcc' failed with exit code 1
  error: subprocess-exited-with-error
  
  × Building wheel for pyjnius (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /myhome/.cache/pypoetry/virtualenvs/pyjn--CgpPmpQ-py3.13/bin/python /myhome/.cache/pypoetry/virtualenvs/pyjn--CgpPmpQ-py3.13/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmpcyeovkk5
  cwd: /tmp/pip-req-build-k7mu6v1r
  Building wheel for pyjnius (pyproject.toml) ... error
  ERROR: Failed building wheel for pyjnius
Failed to build pyjnius
ERROR: Failed to build installable wheels for some pyproject.toml based projects (pyjnius)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants