microsoft / vscode-python

Python extension for Visual Studio Code
https://aka.ms/pvsc-marketplace
MIT License
4.32k stars 1.18k forks source link

mypy always runs in Folder for which it is disabled #19084

Closed bphunter1972 closed 2 years ago

bphunter1972 commented 2 years ago

Issue Type: Bug

Behaviour

python.linting.mypyEnabled is disabled for User, Remote, and Workspace in a project which contains 2 folders. In Folder A, it is enabled and in Folder B it is disabled. Folder A has a directory, alpha, which is configured to be the python.linting.cwd in Folder A. In Folder B's configuration, this setting is empty.

When the project loads, dmypy tries to run in Folder B's alpha directory, which naturally does not exist.

Expected vs. Actual

Obviously, dmypy should not try to run in Folder B because it should be disabled in that folder.

Steps to reproduce:

See above

Diagnostic data

User Settings

``` defaultLS: {"defaultLSType":"Pylance"} envFile: "" venvPath: "" venvFolders: "" condaPath: "" pipenvPath: "" poetryPath: "" languageServer: "Pylance" linting • enabled: true • cwd: "" • Flake8Args: "" • flake8Enabled: false • flake8Path: "" • lintOnSave: true • banditArgs: "" • banditEnabled: false • banditPath: "" • mypyArgs: "" • mypyEnabled: true • mypyPath: "" • pycodestyleArgs: "" • pycodestyleEnabled: false • pycodestylePath: "" • prospectorArgs: "" • prospectorEnabled: false • prospectorPath: "" • pydocstyleArgs: "" • pydocstyleEnabled: false • pydocstylePath: "" • pylamaArgs: "" • pylamaEnabled: false • pylamaPath: "" • pylintArgs: "" • pylintPath: "" sortImports • args: "" • path: "" formatting • autopep8Args: "" • autopep8Path: "" • provider: "black" • blackArgs: "" • blackPath: "" • yapfArgs: "" • yapfPath: "" testing • cwd: "" • debugPort: 3000 • nosetestArgs: "" • nosetestsEnabled: false • nosetestPath: "" • promptToConfigure: false • pytestArgs: "" • pytestEnabled: true • pytestPath: "" • unittestArgs: "" • unittestEnabled: false • autoTestDiscoverOnSaveEnabled: true terminal • activateEnvironment: true • executeInFileDir: "" • launchArgs: "" experiments • enabled: true • optInto: [] • optOutFrom: [] tensorBoard • logDirectory: "" ```

Extension version: 2022.6.0 VS Code version: Code 1.67.0 (Universal) (57fd6d0195bb9b9d1b49f6da5db789060795de47, 2022-05-04T12:14:47.100Z) OS version: Darwin x64 21.4.0 Restricted Mode: No Remote OS version: Linux x64 3.10.0-1062.1.2.el7.x86_64 Connection to 'SSH: msc-bphunter01.csg.apple.com' could not be established Canceled

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 x 2600)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled| |Load (avg)|2, 4, 5| |Memory (System)|16.00GB (0.02GB free)| |Process Argv|--crash-reporter-id ed8eb4ec-682d-46cd-9f6c-960816ecada1| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|SSH: scv-bphunter01.csg.apple.com| |OS|Linux x64 3.10.0-1062.1.2.el7.x86_64| |CPUs|Intel(R) Xeon(R) Gold 6246 CPU @ 3.30GHz (2 x 3292)| |Memory (System)|7.64GB (0.90GB free)| |VM|100%| Connection to 'SSH: msc-bphunter01.csg.apple.com' could not be established Canceled
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 pythonvspyl392:30443607 pythontb:30283811 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 pythondataviewer:30285071 vscod805:30301674 pythonvspyt200:30340761 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 vsc1dst:30438360 pythonvs932:30410667 wslgetstarted:30449410 pythonvsnew555:30457759 vscscmwlcmt:30465135 cppdebug:30475216 ```
bphunter1972 commented 2 years ago

I am putting this on the python extension because the setting is python.linting.enabled. Apologize if it's a bug in the MyPy extension.

Reported to Mypy output log:

[2] Received python path from Python extension: FolderA/bin/python3.8
[2] Running dmypy in folder FolderB/alpha
FolderA/bin/python3.8 -m mypy.dmypy --status-file /home/bphunter/.vscode-server/data/User/workspaceStorage/0501f9c2c3d7dd4a76828a31d5e7f1aa/matangover.mypy/dmypy-1533f564145f03b898a8696f84830b2f77f0334c-14211.json run --log-file /home/bphunter/.vscode-server/data/User/workspaceStorage/0501f9c2c3d7dd4a76828a31d5e7f1aa/matangover.mypy/dmypy-1533f564145f03b898a8696f84830b2f77f0334c.log -- ./alpha --show-column-numbers --no-error-summary --no-pretty --no-color-output --python-executable FolderA/bin/python3.8 --python-executable FolderA/bin/python3.8
[2] stdout:
Daemon started

[2] stderr:
mypy: can't read file 'qrun': No such file or directory

[2] Error running mypy in FolderB/alpha: the mypy daemon is stuck. An attempt to kill it and retry failed. This is probably a bug in mypy itself, see Output panel for details.
[1] Mypy output:
Daemon started
karthiknadig commented 2 years ago

@bphunter1972 This looks like it is from a different extension. The python extension's mypy support does not use the daemon.