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

[typing] clean up prefect __init__.py #16451

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

mjpieters
Copy link
Contributor

  • Provide more typing details for version info and the local module spec.
  • A module __getattr__ is never called for globals, so the _slots structure was redundant.
  • Minimise what code is run in the try: ... except: block.
  • For Python 3.10 and up, include more context in the AttributeError.

References #16292

@github-actions github-actions bot added the development Tech debt, refactors, CI, tests, and other related work. label Dec 19, 2024
Copy link

codspeed-hq bot commented Dec 19, 2024

CodSpeed Performance Report

Merging #16451 will not alter performance

Comparing mjpieters:typing_prefect_init (b8b5a32) with main (cc2d678)

Summary

✅ 3 untouched benchmarks

@mjpieters
Copy link
Contributor Author

This PR moves the type completeness needle by an astounding 0.053%! 🎉 🤯💥

src/prefect/__init__.py Outdated Show resolved Hide resolved
@mjpieters mjpieters force-pushed the typing_prefect_init branch 3 times, most recently from 23e89cd to c32fa63 Compare December 19, 2024 17:47
@mjpieters mjpieters requested a review from desertaxle December 19, 2024 17:49
@mjpieters mjpieters force-pushed the typing_prefect_init branch 7 times, most recently from 7f6e1a1 to 407c66a Compare December 20, 2024 17:51
- Provide more typing details for version info and the local module spec.
- A module `__getattr__` is never called for globals, so the `_slots`
  structure was redundant.
- For Python 3.10 and up, include more context in the AttributeError.
Copy link
Collaborator

@zzstoatzz zzstoatzz left a comment

Choose a reason for hiding this comment

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

🧹 🧼 ✨

@zzstoatzz zzstoatzz merged commit 3cd21c6 into PrefectHQ:main Dec 20, 2024
42 checks passed
@mjpieters mjpieters deleted the typing_prefect_init branch December 20, 2024 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Tech debt, refactors, CI, tests, and other related work.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants