-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Apply PEP561 #520
Apply PEP561 #520
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #520 +/- ##
==========================================
+ Coverage 96.19% 96.31% +0.12%
==========================================
Files 10 11 +1
Lines 867 869 +2
==========================================
+ Hits 834 837 +3
+ Misses 33 32 -1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we check the effect of this change?
pyproject.toml
Outdated
packages = [{include = "bayes_opt"}] | ||
packages = [ | ||
{include = "bayes_opt"}, | ||
{include = "bayes_opt/py.typed"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this explicit include might not actually be necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In local, I ran the poetry build
command to verify that py.typed
was included.
But I prefer to be explicit rather than implicit.
Of course, this is just my personal preference, but if you prefer simplicity, it seems better to remove it.
I'll fix it as soon as you point it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed it
This reverts commit 59785c5.
closes: #493
PEP561: https://peps.python.org/pep-0561/
Based on the previous discussion, type hinting using
TypeVar
was ruled out as it would be a barrier to entry for casual users. Instead, #507 was merged in.In my opinion, this library fully meets the needs of the existing contributors and users,
so it makes sense to add
py.typed
to let users know that this library provides sufficient type hints.