-
-
Notifications
You must be signed in to change notification settings - Fork 945
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(typing): add type hints to hooks (#2183)
* feat: Type app helpers module * feat: Add typing to errors module * feat: Add typings to forwarded module * feat: Add typing to hooks * feat: Add typing to falcon hooks * feat: Add typing to http_error module * feat: Extract RawHeaders and NormalizedHeaders to typing module * feat: Extract status to typing module * feat: Add typing to http_status module * feat: Add typing to inspect module * feat: Add typing to middleware module * feat: Replace protocol with interface * feat: Add typing to redirects * feat: Type vendor mimeparse * Changed RawHeaders to not include None * Reformated imports * Test that interface raises not implemented * Type algorithm int values as float * Changed allowed methods to Iterable * Imported annotations in hooks * Change argnames type to list of strings * Changed Dict to mutable mapping * Fixed formatting * Remove unused imports * Fix typing * Replaced assert with cast * Fix blue * Type resource as object * Fix style * Revert "Type algorithm int values as float" This reverts commit ca1df71. * Revert "feat: Type vendor mimeparse" This reverts commit 11ca7ca. * Ignore vendore package * Use async package instead of importing AsyncRequest and AsyncResponse and aliasing them * Solve circular imports while typing * Fix style * Changed inspect obj type to Any * Import annotations where missing * Replace Union with | where future annotations imported * Revert "Replace Union with | where future annotations imported" This reverts commit fd8b3be. * Improve imports to avoid them inside functions * Fix typo * Rename Kwargs to HTTPErrorKeywordArgs * Import whole package insted of specific types * Fix style * Replace Serializer and MediaHandler with protocol * Add assertion reason message * Fix import issue * Fix import order * Fix coverage issues * Add ResponderOrResource and Action types * Improve responders typing * style: run ruff * typing: improve hooks * typing: more improvement to hooks, install typing-extensions on <3.8 * style: run formatters * fix: correct typo and add todo note regarding improvements * docs: improve docs * fix: use string to refer to type_checking symbols * test: fix import * chore: make python 3.7 happy * chore: make coverage happy * refactor: remove support for python 3.7 * chore: apply review suggestions * chore: additional ignore for coverage to better support typing * chore: coverage again.. --------- Co-authored-by: Federico Caselli <[email protected]>
- Loading branch information
Showing
6 changed files
with
278 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.