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

Add RFC 004-Python Implementation #71

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mattrobenolt
Copy link

No description provided.

@vercel
Copy link

vercel bot commented Oct 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
connect ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 18, 2024 8:47pm

@akshayjshah
Copy link
Member

❤️ Many, many thanks for writing this up, Matt! We've been a little swamped, but this hasn't fallen off our radar.

@mattrobenolt mattrobenolt changed the title Add RFC 001-Python Client Add RFC 001-Python Implementation Dec 7, 2023
Copy link

vercel bot commented Dec 7, 2023

@mattrobenolt is attempting to deploy a commit to the connectrpc Team on Vercel.

A member of the Team first needs to authorize it.

@i2y
Copy link

i2y commented Jan 11, 2024

@mattrobenolt
Sorry to suddenly jump into this conversation, but I have something to share that may be relevant to your PoC and this PR.
At the end of last year, I clearly realized I might need a Python server implementation for my job. To get ahead of this, I spent a few hours over the New Year holiday implementing my own version, independent of your PoC implementation or design. You can find it here: Connecpy. Currently, this implementation supports only Unary RPC of Connect Protocol, but the service handler interface's type signature is compatible with Python's gRPC framework interface, which seems to be sufficient for my current use cases.

@akshayjshah @mattrobenolt
Also, I've been using buf CLI and connect-go at work, and they've been incredibly helpful. Big thanks to all the creators and contributors for your fantastic work.

@mattrobenolt mattrobenolt changed the title Add RFC 001-Python Implementation Add RFC 004-Python Implementation Apr 18, 2024
@ValentaTomas
Copy link

Thank you for creating the POC. The Connect over HTTP/1.1 is exactly what I was looking for. I might be checking the async implementation if other things related to Connect work well.

@Ankush-lastmile
Copy link

any progress on this?

@StevenACoffman
Copy link

StevenACoffman commented Nov 17, 2024

👋 So to clarify, @mattrobenolt and @i2y if someone wants to contribute code for this effort, would it be best at this point to do so at https://github.com/mattrobenolt/connect-python or at https://github.com/i2y/connecpy and how hard would it be to merge these into one effort? Even more specifically, if I dumped any missing code from one into the other, from which repo to which repo should I go?

I mean, it would also be great if someone could just get paid to work on this at their day job, but I know how hard it is to justify to management investing work on critical behind-the-scenes support when it is indirect to more immediate results. Thanks for all the volunteer work so far! ❤️

dependency

@dsludwig
Copy link

dsludwig commented Jan 7, 2025

Hi folks, I wanted to share a project that I've been working on: https://github.com/dsludwig/sonora-connect

This is a fork of the existing sonora which implemented GRPC-Web in both ASGI and WSGI handlers, without adding additional code-generators beyond the standard protobuf pb2 and pb2_grpc. It also conveniently is written as an ASGI/WSGI middleware, so that GRPC-Web handlers can easily be added to an existing application. I have added support for Connect and GRPC to my fork. (GRPC works only with an ASGI server that implements the trailers extension, which seems to just be https://github.com/nonebot/nonecorn).

I have also added conformance tests for the clients based on @mattrobenolt's conformance code, and written server conformance tests. All supported server test cases are currently passing, and there are only a few remaining client test cases that are failing due to unimplemented features.

@i2y
Copy link

i2y commented Jan 7, 2025

@dsludwig Oh, that seems to be a great approach. Also, I have not noticed "sonora." I might contribute to your repository as well. However, as you can see in one of the diagrams I included in my Japanese blog post (https://tech-blog.monotaro.com/entry/2024/06/25/090000), we have already started using "connecpy" as one of the foundational libraries for our internal libraries. For that reason, it might not be possible to switch to your solution or library immediately, although it could become a possibility in the near future. At the same time, I think having alternative approaches or solutions available isn't necessarily a bad thing in open-source initiatives, so I may use your code and @mattrobenolt's code as references to improve "connecpy." In any case, I think your approach is very clever and impressive. Thanks for the sharing👍

@rayli09
Copy link

rayli09 commented Jan 11, 2025

bumping up this thread, is there any roadmap items for supporting connectrpc on python?

@iamwavecut
Copy link

bump

@iamwavecut
Copy link

Hi folks, I wanted to share a project that I've been working on: https://github.com/dsludwig/sonora-connect

So no buf plugin as for now, yes?

@mattrobenolt
Copy link
Author

mattrobenolt commented Jan 13, 2025

Hey all 👋

So just a status update since I've been kinda MIA on this, when I expected to personally spearhead developing this.

For a bit of history, most of my career has been professionally developing Python, starting back in Python 2.3 and I was quite involved in the Python community for a large period of that time.

I mostly ended writing Python when Sentry started moving to Python 3, which was around the time Python 3.6 became popular.

Prior to this, I spent most of that time writing Python 2.6 and 2.7, with Python 3 being for small scripts and small greenfield projects.

I have since stopped writing Python entirely for anything professional. I keep writing Python for small scripts as needed, but basically just using Python 2.7 syntax in modern Python.

As a part of this project, I got really burned out with the modern Python landscape trying to catch up. Very specifically modern Python types and ASGI/asyncio are... extremely not something I like. Publishing a modern Python library would come with the expectation of strong type safety and supporting asyncio, which is something I personally strongly disagree with in Python and that alone is a strong demotivator to write modern Python and publish a public library.

On top of that, I have no personal or professional use for Connect in Python other than just a personal interest in developing it, but that personal interest kinda fizzed out by getting caught up in modern Python semantics. I have learned through this that I do not like writing modern Python, and publishing something how I'd want to do it would not be received very well, so I kinda lost a lot of interest in spending my personal time on something I find very frustrating and annoying. Connect is awesome, I just really hate modern Python.

For those interested, I had a lot of progress on this branch: https://github.com/mattrobenolt/connect-python/tree/ref that was working on passing conformance tests.

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.

9 participants