Skip to content

Possibility for inclusion of grpc-stubs? #10020

Closed

Description

@shabbyrobe

I've been maintaining some stubs I wrote for grpc over at https://github.com/shabbyrobe/grpc-stubs/. People have been requesting they be added to typeshed for a while.

I'm not sure if they would be appropriate but I thought I'd reach out anyway to see. The grpc package itself has some type hinting, but it's patchy, coarse-grained and incomplete. I'm not sure if that disqualifies these stubs or not based on the criteria in CONTRIBUTING.. The stubs I have are a bit more thorough. grpc supports Python 3.7 and up, as with typeshed, so that criteria is at least met.

Looks like I'd have to clean the stubs up quite a bit to match the requirements outlined in CONTRIBUTING, but what else beyond that might need to happen to make this possible?

Also, given people who are using these stubs are probably already using typeshed, what is the potential for mess-making if the stubs suddenly start showing up in both places for folks?

Activity

  1. Akuli commented on Apr 7, 2023

    @Akuli
    Collaborator

    I think we should just move the stubs here. If the type hinting in grpc eventually becomes good enough, we can easily deprecate the typeshed stub package (we have done this many times with other projects, and we have automated most of it). Just make a pull request of what you have, so we can see how much changes are needed to pass our CI :)

    Users might be confused about how there will be both types-grpcio (typeshed package) and grpc-stubs (your old project). To help with this, once the stubs are in typeshed, you could publish one more version of grpc-stubs with a deprecation message in README that tells users to install types-grpcio instead.

    If you know a few somewhat large open source projects that use your stubs, you could add a few to mypy_primer. This way we will see how they are affected by any pull requests to the stubs.

  2. hauntsaninja commented on Apr 7, 2023

    @hauntsaninja
    Collaborator

    You could also issue a release of grpc-stubs that has no stubs but has types-grpcio as a dependency, and that way your existing users could still get updates.

  3. added
    stubs: requestOUTDATED! Request to add stubs for a new package to typeshed
    on Apr 29, 2023
  4. AlexWaygood commented on Apr 29, 2023

    @AlexWaygood
    Member

    I'm closing this issue for now, but only because the question has been answered. A PR adding these stubs to typeshed would be very welcome :)

  5. shabbyrobe commented on Apr 30, 2023

    @shabbyrobe
    ContributorAuthor

    Sounds good, just been getting my house in order a bit before submitting. There were some outstanding issues I wanted to work through first, also hoping to give the aio stubs (which have been a bit of a problem child for a while) some time to percolate since I gave them some attention. I'd rather hold off submitting until those are a bit more stable, which will hopefully save some trouble, but as soon as I'm a bit more confident I'll open up the PR discussed earlier.

    Thanks everyone for the input!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    stubs: requestOUTDATED! Request to add stubs for a new package to typeshed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions