-
Notifications
You must be signed in to change notification settings - Fork 12
add mypy support #106
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
base: main
Are you sure you want to change the base?
add mypy support #106
Conversation
006659d
to
932f77c
Compare
Oh, thank you for this. I had this on my list because all of the mypy stuff is commented out in the "full" version of the template. I'll leave to Moritz for review I just wanted to thank you for this!! Also, get your poster done 🙃 |
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.
Good changes! Some minor comments that you can take as you like.
@@ -151,11 +151,11 @@ use_precommit: | |||
default: "{% if template_mode != 'minimal' %}yes{% else %}no{% endif %}" | |||
help: "Do you want to pre-commit hooks to format your code on save?" | |||
|
|||
use_types: | |||
use_mypy: |
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 originally went with use_types
, as folks might want to run pyright or another alternative to mypy. It's fair to commit to mypy, though, especially as this is targeted more at beginners.
""") | ||
|
||
root = generated(use_hatch_envs=use_hatch_envs, use_mypy=True) | ||
pkg_path = root / "src" / "alien_clones" |
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.
Can the name be gotten from the generated project somehow? Would be better than hard-coding it here.
fix #100
my nerves are shot and i am procrastinating making my scipy posters badly
added a basic mypy config, these are just the config settings i like, so requesting review from @Midnighter who had the previous config in there. took out pydantic-specific stuff bc i figure we don't want to assume people will be using pydantic.
i also renamed the option from
use_type
touse_mypy
and changed the prompt text accordingly - everyone should use type annotations :) and also this switch does just enable/disable mypy anyway. i still don't really like how pydoclint has no option for "ignore type annotations in function signatures" and it must be either "all functions must have type signatures" or "no functions may have type signatures" - that's enough of a problem for me that i wouldn't use pydoclint and by proxy this template, but a problem for another time.other stuff:
FBT001
rule in test code which i think is silly - it forbids the presence of any positional boolean variables. like ok maybe in some circumstances like the ones they cite in the rule explanation are a code smell but banning an entire type from signatures is overkill, especially in tests.