-
Notifications
You must be signed in to change notification settings - Fork 34
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
add py.typed marker #141
base: master
Are you sure you want to change the base?
add py.typed marker #141
Conversation
Build failures are unrelated, see #142 for a PR that fixes them. Tested locally by installing it, the py.typed marker was installed as well. |
There isn't much value in declaring the package has having typing annotations without verifying that they are complete and correct. It would be counterproductive, actually. Given that the recent work on adding typing to Beancount has created more issue than what it solved, I really don't want to replicate the experience for beangulp users. |
@dnicolodi Why didn't we modernize all the projects to more recent requirements? 3.10 and above. Gotta let go of the past at some point |
I disagree. I find it very helpful to have working types for base classes like Importer already even if not all functions and modules are fully typed. I think the incremental approach suggested by mypy (https://mypy.readthedocs.io/en/stable/existing_code.html) works on an ecosystem level as well. Currently, to get type-checking for the bits that are used in Fava I maintain type stubs - those could be removed and all beangulp users could profit from the type annotations. |
I can also create a PR to run mypy in CI so that the types are checked. There's only a handful of errors |
I think you misunderstood my reply. Typing annotations are useful. Wrong typing annotations are not. A If you want to use the existing typing annotations, you can instruct mypy to do it: [[tool.mypy.overrides]]
module = ["beangulp.*"]
follow_untyped_imports = true |
Without this, mypy will complain when importing Importer from beangulp.
37fcac2
to
386859c
Compare
See #143 which adds a CI run of mypy to ensure beangulp has a consistent set of type annotations |
Thanks, TIL - didn't know of this brand-new 1.14 mypy feature yet, that's very useful. |
No description provided.