-
-
Notifications
You must be signed in to change notification settings - Fork 246
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
mypy suite is not run with strict mode and many typing errors still remain #1377
Comments
hi - I'm not able to get pyright to report an error on the script above (nor mypy). I am trying to put pyright into fully strict mode as well: pyrightconfig.json
no errors:
I agree that type checkers often complain about imports not being exported but that is not happening here for either tool, and we most certainly do have a full strict mypy run for alembic in CI which passes. |
wow did not intend to close this, sorry!! |
cc @CaselIT , you might be more familiar with the rules for how exported symbols work w typing |
Isn't it the fact that they insist on having stuff exported with I'm not too sure if all things in |
sure, just want to understand what the rules are because we definitely had to add these exports in sqlalchemy |
I'm surprised you can't reproduce it. These are the step to reproduce from scratch:
In strict mode:
The same result on two separate machines. |
I concur - reproduced on |
do the rules for typing change when I am running pyright from within the source tree of alembic itself? I've looked all around to see if I have any pyright configs (or mypy configs) that would cancel it out. Here's a run from an editable install, I added newlines between my commands and you can see the output
it does reproduce with a non-editable install and plain venv though |
it looks like for mypy we have not yet turned on strict mode in our pyproject.toml, so that's really what has to be fixed here |
additionally there is redundant mypy config in setup.cfg vs pyproject.toml, remove the setup.cfg part |
Mike Bayer has proposed a fix for this issue in the main branch: finish strict typing for most modules https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5016 |
Describe the bug
In a basic checking mode, pyright reports an error when importing a symbol from a module that is not re-exported using
import ... as ...
convention. Inalembic.util
package__init__.py
imports symbols from other modules within the package.I assume the intention was to re-export the imported symbols.
Expected behavior
No error reported by pyright.
To Reproduce
Error
Versions.
Have a nice day!
The text was updated successfully, but these errors were encountered: