Skip to content
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

Python 3.11 support #30303

Closed
fredrikaverpil opened this issue Jul 15, 2022 · 5 comments
Closed

Python 3.11 support #30303

fredrikaverpil opened this issue Jul 15, 2022 · 5 comments

Comments

@fredrikaverpil
Copy link

fredrikaverpil commented Jul 15, 2022

Is your feature request related to a problem? Please describe.

Currently, grpcio does not build from source with Python 3.11.0b4.

Describe the solution you'd like

I'd like to be able to install grpcio in Python 3.11.

Describe alternatives you've considered

Well...

Additional context

Dockerfile and full build log here.

Potentially related: #30272

@phillipuniverse
Copy link

Very similar issues on the latest versions at time of writing. Dockerfile:

FROM python:3.11-rc-slim-bullseye

RUN apt-get update && apt-get -y install libpq-dev git
RUN apt-get -y install build-essential

WORKDIR /workdir

# create virtual environment and activate it
RUN python -m venv /opt/venv
ENV VIRTUAL_ENV="/opt/venv" \
    PATH="/opt/venv/bin:$PATH"

RUN pip install wheel
RUN pip install grpcio==1.48.0

@Hnasar
Copy link

Hnasar commented Sep 2, 2022

Just a heads up that Python 3.11 out on 2022-10-03 -- in one month -- but rc builds are already available.

We strongly encourage maintainers of third-party Python projects to prepare their projects for 3.11 compatibilities during this phase

https://www.python.org/downloads/release/python-3110rc1/

I see a few places in this codebase where 3.11 may need to be added:

And when I tried to build on windows 11 it also failed. Maybe I Need pthread, but there's also some other errors 🤔
https://gist.github.com/Hnasar/9651d83785ffa3b05f8a093c1e07b208

Thank you grpc maintainers! Looking forward to the nice 3.11 speedups once we get wheels & builds available!

@gnossen
Copy link
Contributor

gnossen commented Sep 9, 2022

I'm working on adding this support at the moment. Sorry for the wait there. We're working on automation to make this process speedier in the future given that Python releases are now once a year.

Oddly, I don't seem to be running into the compilation error referenced:

#12 126.3       src/python/grpcio/grpc/_cython/cygrpc.cpp:126605:23: error: ‘_PyErr_StackItem’ {aka ‘struct _err_stackitem’} has no member named ‘exc_type’
#12 126.3       126605 |     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&

I would expect this to be resolved by a fix in Cython, but I have not updated our Cython version pin. I am using rc1 instead of beta4, so that could be the issue. Any idea what the difference might be? If it's not obvious, I'll try to reproduce using the Dockerfile provided by @fredrikaverpil

@toppk
Copy link

toppk commented Sep 10, 2022

This is the fix in cython cython/cython#4584 It seems likely to be only fixed in the 3.x version of cython. I am encountering this in python 3.11.0rc1, so I am surprised you are not.

@gnossen
Copy link
Contributor

gnossen commented Sep 13, 2022

Well, as long as the artifacts build properly against 3.11, I suppose we're fine. 3.11 will be supported in 1.49.0, which is going out in the next couple of days.

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

No branches or pull requests

5 participants