Open rakunoi opened 1 year ago
It's probably a mypy related question, but rather bring it up here, as this whole mypy "which modules to ignore and how" is pretty confusing (seemingly to many).
I've tried to add both below to the mypy.ini
, but neither of them helped:
[mypy-troposhpere.*]
ignore_missing_imports = True
[mypy-troposhpere]
ignore_missing_imports = True
Still getting error: Skipping analyzing "troposphere": module is installed, but missing library stubs or py.typed marker [import-untyped]
when running mypy on the selected files.
Putting it to the top level makes running mypy ignore the issue, but that's not ideal as it affects other packages as well:
[mypy]
ignore_missing_imports = True
This results in Success: no issues found in 82 source files
.
(It's another issue though that with this setting I'm still getting Stub file not found for "troposphere"
from PyLance in VSCode.)
I'd really appreciate any recommendations how to get this working properly, I've spent at least an hour with this specifically because of troposphere.
@g-borgulya I was able to reproduce with your example. I believe the issue was the spelling of "troposphere" in the section names. Here's my results correcting that issue.
$ cat m.py
import troposphere
print(troposphere.__version__)
t = troposphere.Template()
print(t.to_json())
$ python m.py
4.5.3
{
"Resources": {}
}
$ cat mypy.ini
[mypy]
[mypy-troposphere.*]
ignore_missing_imports = True
[mypy-troposphere]
ignore_missing_imports = True
$ mypy m.py
Success: no issues found in 1 source file
$
Let me know if this works for you. I do need to create a tracking issue and branch to get better typing support implemented.
I so much appreciate it, @markpeek ! Thank you. Yes, mypy works with the fixed settings.
Hi,
to keep it short, when upgraded
4.3.2
->4.4.1
, mypy started throwing following errorsmypy config is
Pydantic version is
"==1.10.12"
Mypy version ismypy = "1.5.1"
Please let me know if more information is needed.