Skip to content

Mypy during linting behaves different than in terminal #20194

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

Closed
najtin opened this issue Nov 9, 2022 · 1 comment
Closed

Mypy during linting behaves different than in terminal #20194

najtin opened this issue Nov 9, 2022 · 1 comment
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@najtin
Copy link

najtin commented Nov 9, 2022

Type: Bug

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: Success: no issues found in 1 source file But it should instead report an issue with the code.

Here is the code i want to check:

def a() -> str:
    1

Clearly, mypy should complain about the missing return statement.
Here is the output of the Output tab:

LSP Notebooks experiment is disabled -- not using Pylance
LSP Notebooks interactive window support is disabled -- not in LSP Notebooks experiment
> conda info --json
Python interpreter path: ./.venv/bin/python
> ~/.conda/bin/conda info --json
> . ./.venv/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode-oss/extensions/ms-python.python-2022.16.1-universal/pythonFiles/printEnvVariables.py
> ~/.julia/conda/3/bin/conda info --json
> ./.venv/bin/python ~/.vscode-oss/extensions/ms-python.python-2022.16.1-universal/pythonFiles/get_output_via_markers.py ~/.vscode-oss/extensions/ms-python.python-2022.16.1-universal/pythonFiles/interpreterInfo.py
> /bin/python ~/.vscode-oss/extensions/ms-python.python-2022.16.1-universal/pythonFiles/get_output_via_markers.py ~/.vscode-oss/extensions/ms-python.python-2022.16.1-universal/pythonFiles/interpreterInfo.py
> /usr/bin/python ~/.vscode-oss/extensions/ms-python.python-2022.16.1-universal/pythonFiles/get_output_via_markers.py ~/.vscode-oss/extensions/ms-python.python-2022.16.1-universal/pythonFiles/interpreterInfo.py
> ~/.julia/conda/3/bin/python ~/.vscode-oss/extensions/ms-python.python-2022.16.1-universal/pythonFiles/get_output_via_markers.py ~/.vscode-oss/extensions/ms-python.python-2022.16.1-universal/pythonFiles/interpreterInfo.py
Starting Jedi language server for rootsnakes.
> ./.venv/bin/python ~/.vscode-oss/extensions/ms-python.python-2022.16.1-universal/pythonFiles/linter.py -m mypy --follow-imports=silent --ignore-missing-imports --show-column-numbers --no-pretty ./rootsnakes/app.py
cwd: .
> ./.venv/bin/python ~/.vscode-oss/extensions/ms-python.python-2022.16.1-universal/pythonFiles/linter.py -m flake8 ./rootsnakes/app.py
cwd: .
##########Linting Output - mypy##########

Success: no issues found in 1 source file

##########Linting Output - flake8##########

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:

./.venv/bin/python ~/.vscode-oss/extensions/ms-python.python-2022.16.1-universal/pythonFiles/linter.py -m mypy --follow-imports=silent --ignore-missing-imports --show-column-numbers --no-pretty ./lol.py
lol.py:1:1: error: Missing return statement  [return]
Found 1 error in 1 file (checked 1 source file)

Extension version: 2022.16.1
VSCodium version: VSCodium 1.72.2 (378660f7dd07287aa34acf90e8fec157425c1ac8, 2022-10-16T23:03:19.989Z)
OS version: Linux x64 5.15.0-52-generic snap
Modes:
Sandboxed: No

System Info
Item Value
CPUs -
GPU Status -
Load (avg) 1, 0, 0
Memory (System) 15.19GB (3.28GB free)
Process Argv --ms-enable-electron-run-as-node --no-sandbox --unity-launch
Screen Reader no
VM 0%
DESKTOP_SESSION mate
XDG_CURRENT_DESKTOP MATE
XDG_SESSION_DESKTOP mate
XDG_SESSION_TYPE x11
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Nov 9, 2022
@najtin
Copy link
Author

najtin commented Nov 9, 2022

duplicate of #20182

@najtin najtin closed this as completed Nov 9, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

1 participant