-
-
Notifications
You must be signed in to change notification settings - Fork 185
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
Implement typings in conda-smithy #1957
base: main
Are you sure you want to change the base?
Conversation
82d1fb1
to
b2a66d4
Compare
b2a66d4
to
ed404e5
Compare
pre-commit.ci autofix |
00b9c49
to
a4e89f7
Compare
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'm ok to merge this but I'd rather the type checks be optional and simply reported to people on PRs so they can fix them if they like.
Add mypy to GitHub workflow and to the environment yml
Add mypy type ignore for some tests and conda smithy files, which couldn't be resolved.
47bcea6
to
bafe408
Compare
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.
Thank you!
Any comments from any one else on @conda-forge/core?
I feel that if you add types, you should also make use of them and have them checked. Otherwise, it might be even better to not have them as otherwise you will be making false assumptions. |
OK @xhochy, then I'd be in favor of removing the types all together. |
Introduction
This work is done according to "Milestone 2: Implement typings in conda-smithy" as stated in the Scope of Work with Sovereign Tech Fund (STF) (https://www.sovereigntechfund.de/).
This PR addresses the typing request from this issue
Setup
Setup details are here: https://github.com/neighbourhoodie/conda-smithy/wiki
Steps followed to add type
As suggested in the ticket in the conda-smithy repo, MonkeyType is used to generate type hints for the python code.
Generate type hints
monkeytype.sqlite3
in the current working directory.stubs
to save the type hint filesThe above command will create stub files in the
stubs
folder. Here's an example of what the content of a stub file will look like. It gives suggestions for types.Checklist
news
entryNote:
Please note that there are some errors thrown by mypy that couldn't resolved at the moment and there is more room for further type improvements there.