Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve type annotations #244

Merged
merged 20 commits into from
Mar 13, 2022
Merged

Improve type annotations #244

merged 20 commits into from
Mar 13, 2022

Conversation

rsokl
Copy link
Contributor

@rsokl rsokl commented Mar 12, 2022

This PR further improves our internal type annotations:

  • Use TypeAlias to make our various aliases explicit
  • Update Partial to reflect latest type stub in pyright
  • hydra_zen.typing._builds_overloads now exposes protocols instead of overloaded function stubs
  • Various builds overloads are corrected to eliminate overlapping overload warnings from pyright-strict
  • Various builds overloads are corrected to provide sufficiently-general annotations; tests included
  • Excessive overloads removed from get_target and instantiate
  • Eliminate overlapping overloads for instantiate
  • builds now uses the __foo convention to make hydra_target positional-only
  • Enable pyright-strict on select files that supply important types/overloads
  • move make_builds_fn definition to its own file; simplify overloads; get rid of hacky overload method; enforce pyright-strict

(despite these improvements, mypy still crashes when we run on src/: python/mypy#12322)

@rsokl rsokl added the type-checking Involves hydra_zen.typing or pyright/mypy label Mar 12, 2022
@rsokl rsokl changed the title Improve typing Improve type annotations Mar 13, 2022
@rsokl rsokl merged commit 29f1c67 into main Mar 13, 2022
@rsokl rsokl deleted the improve-typing branch March 13, 2022 17:59
@rsokl rsokl mentioned this pull request Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-checking Involves hydra_zen.typing or pyright/mypy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant