Skip to content

Add PosArgT typing to trio.run#3022

Merged
jakkdl merged 3 commits intopython-trio:masterfrom
jakkdl:trio_typing_improvements
Jun 26, 2024
Merged

Add PosArgT typing to trio.run#3022
jakkdl merged 3 commits intopython-trio:masterfrom
jakkdl:trio_typing_improvements

Conversation

@jakkdl
Copy link
Member

@jakkdl jakkdl commented Jun 25, 2024

I noticed this when going through the trio-typing test suite. I don't see any reason why this would've been intentionally skipped in #2881, so I suspect it just got missed?

@jakkdl jakkdl force-pushed the trio_typing_improvements branch from f6e62ed to e668396 Compare June 25, 2024 16:51
@codecov
Copy link

codecov bot commented Jun 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.63%. Comparing base (a7db0e4) to head (945a3b5).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3022   +/-   ##
=======================================
  Coverage   99.63%   99.63%           
=======================================
  Files         120      120           
  Lines       17865    17865           
  Branches     3216     3216           
=======================================
  Hits        17800    17800           
  Misses         46       46           
  Partials       19       19           
Files with missing lines Coverage Δ
src/trio/_core/_run.py 99.38% <ø> (ø)
src/trio/_core/_tests/test_run.py 100.00% <100.00%> (ø)

Copy link
Member

@Zac-HD Zac-HD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Should we consider moving over some of the trio-typing test suite, since apparently that catches some issues that the trio tests don't?

Copy link
Contributor

@TeamSpen210 TeamSpen210 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must have been missed, yes.

Copy link
Contributor

@A5rocks A5rocks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a type test.

Feel free to merge this whether or not you add one though.

Copy link
Member

@CoolCat467 CoolCat467 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@jakkdl
Copy link
Member Author

jakkdl commented Jun 26, 2024

Looks good to me!

Should we consider moving over some of the trio-typing test suite, since apparently that catches some issues that the trio tests don't?

There's not much that's worth adapting, I don't think we want to adapt their method of running internal mypy functions, so it would consist of copying and adapting the test-data. But we already cover most everything:

  • We don't care for async_generator tests
  • outcome has its own type tests
  • we already have type tests for trio.Path and TaskStatus
  • trio-basic:
    • we have type tests for open_memory_channel
    • we have type tests for nursery.start_soon

The only things left were run, that trio-typing raised a typing error if you tried to instantiate Cancelled, Nursery.start, and some trivial stuff that would raise typechecking errors when we run mypy on our test suite.

@jakkdl jakkdl enabled auto-merge (squash) June 26, 2024 12:37
@jakkdl jakkdl merged commit 80eec96 into python-trio:master Jun 26, 2024
@jakkdl jakkdl deleted the trio_typing_improvements branch August 27, 2024 09:32
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.

5 participants