falconry / falcon

The no-magic web data plane API and microservices framework for Python developers, with a focus on reliability, correctness, and performance at scale.
https://falcon.readthedocs.io/en/stable/
Apache License 2.0
9.53k stars 945 forks source link

fix(typing): TestClient methods return Result, not _ResultBase #2211

Closed CaselIT closed 1 month ago

CaselIT commented 9 months ago

Follow up of https://github.com/falconry/falcon/pull/2209 cc @davetapley

Fixes https://github.com/falconry/falcon/issues/2207

CaselIT commented 9 months ago

Moved to draft for now, I'll look at the failure next week.

@vytas7 I don't remember if we settled on installing typing_extensions on v4 to better support typing

codecov[bot] commented 9 months ago

Codecov Report

Attention: Patch coverage is 96.26168% with 4 lines in your changes missing coverage. Please review.

Project coverage is 99.94%. Comparing base (4910dd7) to head (9cecfe8). Report is 73 commits behind head on master.

Files with missing lines Patch % Lines
falcon/testing/client.py 96.19% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2211 +/- ## =========================================== - Coverage 100.00% 99.94% -0.06% =========================================== Files 62 62 Lines 6880 6919 +39 Branches 1099 1099 =========================================== + Hits 6880 6915 +35 - Misses 0 4 +4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

vytas7 commented 9 months ago

No, I'd love to keep the "production" installation of Falcon free of any dependencies. Is it possible to instruct the type checker to install these extensions?

Also, it is probably OK to add these dependencies on older Python versions. We don't even ship Linux wheels for some of them.

CaselIT commented 9 months ago

Is it possible to instruct the type checker to install these extensions?

I don't think so.

I'll try doing something more sophisticated wrt import

vytas7 commented 2 months ago

@CaselIT has this PR been superseded by others in the typing work stream, or should we still consider this one separately?

CaselIT commented 2 months ago

No, it's still relevant. I plan on finishing it once the other ones are merged

CaselIT commented 1 month ago

replaced by #2338