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
Cannot compile for Python 3.10 and 3.11 #60
Comments
It seems Cython not well support Python 3.10 yet, need wait Cython 3.0 release. A workaround is use pure python mode: VALIDR_SETUP_MODE=py pip install validr |
I checked, Cython works well on Python 3.10 $ python3.10 -m venv env
$ source env/bin/activate
(env) $ pip install cython wheel
(env) $ VALIDR_SETUP_MODE=pyx python setup.py bdist_wheel
(env) $ ls dist/
validr-1.2.1-cp310-cp310-linux_x86_64.whl The problem is in distribution itself. You uploaded on PyPI source distribution (tar.gz file) with pre-generated C code. And by default Consider to upload binary wheels for each platform/version instead. You can build them by CIBuildWheels tool. Here is how I do it on my project ValidX. And yes, I'm not a user of your library, I just run benchmarks against it. Good work, by the way :) |
Thank you for the information! You are correct. I try build in macOS but failed, maybe Cython not support it well now. docker run --platform linux/amd64 -ti python:3.10.7 /bin/bash
$ pip install cython
$ VALIDR_SETUP_MODE=pyx pip install validr
...
In file included from /usr/local/include/python3.10/unicodeobject.h:1046,
from /usr/local/include/python3.10/Python.h:83,
from src/validr/_exception_c.c:16:
/usr/local/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> validr
|
If I build it from sources (without C files), it works. If I try to install it from PyPI (with C files), it doesn't. It seems Cython doesn't generate new code, when C files already exist. |
Fixed in #61, just released version |
Steps to reproduce:
Output:
For Python 3.11 the output differs, but it's still a compilation error.
The text was updated successfully, but these errors were encountered: