trio-typing icon indicating copy to clipboard operation
trio-typing copied to clipboard

Merge `trio-typing` into `trio`?

Open Zac-HD opened this issue 2 years ago • 10 comments

It's been a while since https://github.com/python-trio/trio/issues/543 was opened, and the typing ecosystem has matured considerably.

I think we should aim to distribute type annotations as part of Trio directly, and retire this package.

Zac-HD avatar Mar 14 '23 00:03 Zac-HD

Strong agree. Once mypy supports TypeVarTuple we can probably do it without a plugin.

oremanj avatar Mar 28 '23 23:03 oremanj

Cross-linking, that's python/mypy/labels/topic-pep-646 and in particular https://github.com/python/mypy/issues/12280.

On the Trio side, we've considered this before and should take an incremental approach over multiple small PRs.

Zac-HD avatar Mar 29 '23 01:03 Zac-HD

Well, trio==0.23.0 has type hints so I think this issue is done? Reopen if I'm misinterpreting!

A5rocks avatar Nov 04 '23 05:11 A5rocks

I think it is! It looks like we've also released a type-annotated version of outcome, and async_generator is not needed on supported Python versions, so maybe we can archive this whole repo?

🤔 maybe we want to make one last release to emit warnings and tag with Development Status :: 7 - Inactive?

Zac-HD avatar Nov 04 '23 05:11 Zac-HD

I think some people might still want the plugin while mypy doesn't have TypeVarTuple ... and I haven't used this much so idk if there's much else here, but maybe other stuff.

A5rocks avatar Nov 04 '23 05:11 A5rocks

Ah, right, that's been merged but not released yet - https://github.com/python/mypy/pull/16354 will be in mypy 1.7 🙂

Zac-HD avatar Nov 04 '23 05:11 Zac-HD

I agree we want a warning release at some point, and would be nice with an open issue to track that, so I'll reopen this for now and we can then revisit it once we've incorporated TypeVarTuple in trio.

jakkdl avatar Nov 04 '23 09:11 jakkdl

Looking through https://github.com/python-trio/trio-typing#whats-in-the-box I think trio implements everything other than the stuff that needs TypeVarTuple. We could probably copy over some tests from here

jakkdl avatar Nov 04 '23 09:11 jakkdl

mypy 1.7 (and 1.8) is released, so I'll try and get around to making a final release and maybe run some tests to double check.

jakkdl avatar Mar 13 '24 15:03 jakkdl

I ran the test suite without the plugin installed, which caught https://github.com/python-trio/trio/pull/3022 But otherwise the only properly missing thing is Nursery.start not being properly typed due to https://github.com/python/mypy/issues/16522

jakkdl avatar Jun 25 '24 17:06 jakkdl