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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PEP 561 Compatiblity #41
Conversation
Allow typing info to be used downstream
Nice! Yeah, @Jorricks has been helping with this as I am new to Python typing.. 馃懘馃徎 Should we be running mypy with GitHub Actions to check for errors in the typing? |
Oh that's a good pointer! I never created such a file. Regarding running MyPy, that's included in the pre-commit. I'll continue working on that tomorrow. |
Thank you @ewels for merging, and thanks @Jorricks for your effort on the typing front. 馃憤 I know from experience just how much work that can be, so I really appreciate what you're doing.
Do you trust that the developer will always install the pre commit? ;) As for mypy in general, I'd say it's quite a double-edged sword. It's saved me from mistakes in the past, but it takes a lot of effort to squash out errors from
|
The GitHub Actions CI workflow runs the pre-commit checks, so they don't need to - the PR checks will fail if it doesn't validate. See #40 |
Well in my opinion, MyPy is indeed a tiny bit annoying but it prevents so many bugs. |
@@ -7,4 +7,5 @@ | |||
"rich>=10", | |||
"importlib-metadata; python_version < '3.8'", | |||
], | |||
package_data={"rich-click": ["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.
Bit late now, but maybe we could put this into setup.cfg
instead? Most stuff is in there, it's only the requirements that are in setup.py
so that they can be picked up by GitHub:
Line 39 in 6d444bf
# Dependencies are in setup.py for GitHub's dependency graph. |
I assume it would still work if in the .cfg file instead?
Hi there 馃憢
I just saw #39 and thought it might be useful to add a
py.typed
file. This allows downstream projects to use the type hints for things like PyCharm, mypy, pytype etc.Without this file, mypy currently complains in projects that use rich-click:
The
py.typed
file makes rich-click PEP-561 compatible, and allows the inline types to be used. See here for further explanation.