shabbyrobe / grpc-stubs

gRPC typing stubs for Python
MIT License
35 stars 21 forks source link

Make it works with mypy in python 2.7 #8

Closed Evgenus closed 3 years ago

Evgenus commented 3 years ago

Yeah, I know, 2.7 is dead. Im planning to use it for mypy-protobuf and it is still using 2.7 in tests

Evgenus commented 3 years ago

Can we also remove python_requires>=3.6?

shabbyrobe commented 3 years ago

Thank you for the PR. This is an interesting dilemma. I'm a bit unsure; as you say - 2.7 is dead. Has there been any comment from the mypy-protobuf about whether there is a deprecation planned for 2.7? I think I'd prefer to see that, than 2.7 added here. It would be good to know why mypy-protobuf continues to support it, too. Do you have any info about that?

I'll leave this open for now though.

Evgenus commented 3 years ago

@nipunn1313 I guess that could be addressed to you

nipunn1313 commented 3 years ago

Currently, there's lots of legacy code getting value out of mypy-protobuf on python 2.7, however, it's not really important to make GRPC work well with python 2.7 (since support is focused on legacy code anyway), so ok with closing this! Thanks for the follow up.

Mypy-protobuf itself runs on python3 only, but the stubs it generates is backward compat to python2.7

nipunn1313 commented 3 years ago

One common strategy for deprecation is to have an older revision of the library (in your case grpc-stubs) which supports python2.7 (via the python_requires), and then update it to a newer version which drops support. That makes the people w/ legacy code at least have an option. I don't know of any such folks that are using grpc w/ python2 currently, so I wouldn't worry about it.

@Evgenus in fact put in a bunch of work into mypy-protobuf's testsuite such that the GRPC stuff only runs on python3 - and it works pretty great.

shabbyrobe commented 3 years ago

Thanks heaps for the feedback on this @nipunn1313. Please do let me know if you discover any concrete reasons for us to reopen this though. My personal preference is to avoid doing anything related to 2.7 but if there's a decent case to be made for doing something here I'm happy to explore it.