-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 linting not working for mypy 0.990 - no issues found #20182
Comments
There should be a linter command arguments in the Output > python logs. can you run that in the terminal? it should be running |
|
Same issue here, without the /net/ thing. The paths look fine.
I use poetry and installed flake8 and mypy in a local venv using poetry. Flake works fine but mypy does not report any issues. To be clear it does report something: Here is the code i want to check: def a() -> str:
1 Clearly, mypy should complain about the missing return statement.
When we run the exact same command in the terminal window (with venv activated) or in a fresh shell without activating the venv we get the expected result:
Extension version: 2022.16.1 System Info
|
@najtin For flake8 can you try using the flake8 extension from marketplace https://marketplace.visualstudio.com/items?itemName=ms-python.flake8 |
I think this is related to the issue above (for completeness python/mypy#14042 ) |
No, flake8 works as expected. This issue does also occur when flake8 is not installed. |
The difference between mypy == 0.982
mypy == 0.990
|
Can you share the output from |
While trying to recreate a minimal working example i found that for some reason it works if you add mypy through In more detail To reproduce case (poetry add --dev mypy) run the following: poetry new example
poetry add --dev mypy
codium .
#mypy works To reproduce case (poetry install) run the following: poetry new example
poetry add --dev mypy
rm -r .venv .mypy_cache
poetry install
codium .
#mypy does not work pyproject.toml: [tool.poetry]
name = "example-manual"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
readme = "README.md"
packages = [{include = "example_manual"}]
[tool.poetry.dependencies]
python = "^3.10"
[tool.poetry.group.dev.dependencies]
mypy = "^0.990"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api" Here is the pip list you requested case (poetry add --dev mypy) (mypy works):
case (poetry install) (mypy does not work)
These results make me think that this issue should be tracked at mypy under python/mypy#14054 because it seems like the working folder has been added to the path, otherwise pip would not list the project as an installed package. Therefore the plugin here seems to work fine but mypy introduced breaking changes in 0.990, making it an issue with mypy. |
My Click to show
|
Looks like this might be a mypy issue, closing this for now. Track here: python/mypy#14054 |
Can confirm working again with Mypy 0.991 |
Type: Bug
Behaviour
Expected vs. Actual
Expected: mypy errors are found.
Actual: mypy reports no errors.
Steps to reproduce:
mypy <filepath>
on the command line to confirm that the problem is genuineMypy version:
mypy 0.990 (compiled: yes)
Edit: I have tested and linting works for mypy 0.981
Diagnostic data
python.languageServer
setting: PylanceOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)User Settings
Extension version: 2022.16.1
VS Code version: Code 1.72.2 (d045a5eda657f4d7b676dedbfa7aab8207f8a075, 2022-10-12T22:16:26.920Z)
OS version: Linux x64 3.10.0-1160.76.1.el7.x86_64
Modes:
Sandboxed: No
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
opengl: disabled_off
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
webgpu: disabled_off
The text was updated successfully, but these errors were encountered: