Skip to content
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

Pylance preferences pyproject tool.pyright over workspace settings #5969

Closed
jarshwah opened this issue Jun 5, 2024 · 4 comments
Closed

Pylance preferences pyproject tool.pyright over workspace settings #5969

jarshwah opened this issue Jun 5, 2024 · 4 comments
Assignees

Comments

@jarshwah
Copy link

jarshwah commented Jun 5, 2024

The issue here is that pylance prioritises the pyproject.toml settings for tool.pyright over the vscode workspace settings. This is problematic because excluding/including the bare minimum in the pyproject.toml file applies to all editors. We should be able to selectively override what this session/workspace wants to index.

Environment data

  • Language Server version: 2024.5.1 (pyright version 1.1.360, commit 4bc8428d)
  • OS and version: MacOS Sonoma
  • Python version (& distribution if applicable, e.g. Anaconda): 3.10.6 (pyenv)

Code Snippet

# pyproject.toml

[tool.pyright]
pythonVersion = "3.10"
include = ["src"]
exclude = [
    "src/project/exclude.py",
]
# workspace config
{
    "folders": [
        {
            "path": "."
        }
    ],
    "settings": {
        "python.analysis.logLevel": "Trace",
        "python.analysis.include": [
            "**/other",
        ],
        "python.analysis.exclude": [
            "**/migrations"
        ]
    }
}

Repro Steps

Open the workspace with Trace enabled. Note that pylance is indexing all files under src/ including files under /migrations/.

Expected behavior

Only the files listed under python.analysis.include are indexed, and all files under migrations are excluded.

Actual behavior

Pylance honours the settings of the pyproject.toml over the workspace settings, indexing all files under src/ except for src/project/exclude.py

Logs

2024-06-05 16:00:29.902 [info] (Client) Pylance async client (2024.5.1) started with python extension (2024.6.0)
2024-06-05 16:00:30.160 [info] [Info  - 16:00:30] (56111) Pylance language server 2024.5.1 (pyright version 1.1.360, commit 4bc8428d) starting
2024-06-05 16:00:30.160 [info] [Info  - 16:00:30] (56111) Server root directory: file:///Users/josh/.vscode/extensions/ms-python.vscode-pylance-2024.5.1/dist
2024-06-05 16:00:30.167 [info] [Info  - 16:00:30] (56111) Starting service instance "pylance-analysis"
2024-06-05 16:00:30.168 [info] [Info  - 16:00:30] (56111) Auto-Indent enabled
2024-06-05 16:00:30.314 [info] (56111) No configuration file found.
2024-06-05 16:00:30.314 [info] (56111) pyproject.toml file found at /Users/josh/dev/experiments/pylance-analysis.
2024-06-05 16:00:30.315 [info] [Info  - 16:00:30] (56111) Setting pythonPath for service "pylance-analysis": "/Users/josh/.pyenv/versions/3.10.6/envs/pytools/bin/python"
2024-06-05 16:00:30.316 [info] [Info  - 16:00:30] (56111) Setting environmentName for service "pylance-analysis": "3.10.6 (pytools venv)"
2024-06-05 16:00:30.317 [info] [Info  - 16:00:30] (56111) Loading pyproject.toml file at /Users/josh/dev/experiments/pylance-analysis/pyproject.toml
2024-06-05 16:00:30.317 [info] (56111) Assuming Python platform Darwin
2024-06-05 16:00:30.317 [info] [Info  - 16:00:30] (56111) Search paths for file:///Users/josh/dev/experiments/pylance-analysis
2024-06-05 16:00:30.318 [info] [Info  - 16:00:30] (56111)   /Users/josh/.vscode/extensions/ms-python.vscode-pylance-2024.5.1/dist/typeshed-fallback/stdlib
2024-06-05 16:00:30.318 [info] [Info  - 16:00:30] (56111)   /Users/josh/dev/experiments/pylance-analysis
2024-06-05 16:00:30.318 [info] [Info  - 16:00:30] (56111)   /Users/josh/dev/experiments/pylance-analysis/src
2024-06-05 16:00:30.318 [info] [Info  - 16:00:30] (56111)   /Users/josh/dev/experiments/pylance-analysis/typings
2024-06-05 16:00:30.318 [info] [Info  - 16:00:30] (56111)   /Users/josh/.vscode/extensions/ms-python.vscode-pylance-2024.5.1/dist/typeshed-fallback/stubs/...
2024-06-05 16:00:30.319 [info] [Info  - 16:00:30] (56111)   /Users/josh/.vscode/extensions/ms-python.vscode-pylance-2024.5.1/dist/bundled/stubs
2024-06-05 16:00:30.319 [info] [Info  - 16:00:30] (56111)   /Users/josh/.pyenv/versions/3.10.6/lib/python3.10
2024-06-05 16:00:30.319 [info] [Info  - 16:00:30] (56111)   /Users/josh/.pyenv/versions/3.10.6/lib/python3.10/lib-dynload
2024-06-05 16:00:30.319 [info] [Info  - 16:00:30] (56111)   /Users/josh/.pyenv/versions/3.10.6/envs/pytools/lib/python3.10/site-packages
2024-06-05 16:00:30.319 [info] [Info  - 16:00:30] (56111)   /Users/josh/dev/kraken-db-tools
2024-06-05 16:00:30.319 [info] [Info  - 16:00:30] (56111) Adding fs watcher for library directories:
 file:///Users/josh/.pyenv/versions/3.10.6/lib/python3.10
file:///Users/josh/.pyenv/versions/3.10.6/lib/python3.10/lib-dynload
file:///Users/josh/.pyenv/versions/3.10.6/envs/pytools/lib/python3.10/site-packages
file:///Users/josh/dev/kraken-db-tools
2024-06-05 16:00:30.319 [info] [Info  - 16:00:30] (56111) Adding fs watcher for directories:
 file:///Users/josh/dev/experiments/pylance-analysis/src
2024-06-05 16:00:30.319 [info] (56111) Searching for source files
2024-06-05 16:00:30.320 [info] (56111) Found module decorator : 5.1.1
2024-06-05 16:00:30.320 [info] (56111) Found module mccabe : 0.7.0
2024-06-05 16:00:30.321 [info] (56111) Found module mypy_extensions : 1.0.0
2024-06-05 16:00:30.321 [info] (56111) Found module nest_asyncio : 1.6.0
2024-06-05 16:00:30.321 [info] (56111) Found module pickleshare : 0.7.5
2024-06-05 16:00:30.321 [info] (56111) Found module pycodestyle : 2.10.0
2024-06-05 16:00:30.321 [info] (56111) Found module pyinvoke : 1.0.4
2024-06-05 16:00:30.321 [info] (56111) Found module six : 1.16.0
2024-06-05 16:00:30.322 [info] (56111) Found module typing_extensions : 4.7.1
2024-06-05 16:00:30.322 [info] (56111) Found module IPython : 8.13.2
2024-06-05 16:00:30.322 [info] (56111) Found module appnope : 0.1.3
2024-06-05 16:00:30.322 [info] (56111) Found module argcomplete : 3.1.6
2024-06-05 16:00:30.322 [info] (56111) Found module asgiref : 3.7.2
2024-06-05 16:00:30.322 [info] (56111) Found module asttokens : 2.2.1
2024-06-05 16:00:30.322 [info] (56111) Found module attrs : 23.1.0
2024-06-05 16:00:30.322 [info] (56111) Found module backcall : 0.2.0
2024-06-05 16:00:30.322 [info] (56111) Found module black : 23.3.0
2024-06-05 16:00:30.322 [info] (56111) Found module boto3 : 1.34.56
2024-06-05 16:00:30.322 [info] (56111) Found module botocore : 1.34.56
2024-06-05 16:00:30.323 [info] (56111) Found module build : 0.10.0
2024-06-05 16:00:30.323 [info] (56111) Found module cachecontrol : 0.12.11
2024-06-05 16:00:30.323 [info] (56111) Found module certifi : 2023.5.7
2024-06-05 16:00:30.323 [info] (56111) Found module cffi : 1.15.1
2024-06-05 16:00:30.323 [info] (56111) Found module charset_normalizer : 3.1.0
2024-06-05 16:00:30.323 [info] (56111) Found module cleo : 2.0.1
2024-06-05 16:00:30.323 [info] (56111) Found module click : 8.1.3
2024-06-05 16:00:30.323 [info] (56111) Found module comm : 0.2.2
2024-06-05 16:00:30.323 [info] (56111) Found module crashtest : 0.4.1
2024-06-05 16:00:30.323 [info] (56111) Found module debugpy : 1.8.1
2024-06-05 16:00:30.323 [info] (56111) Found module dep1 : 2.3.0
2024-06-05 16:00:30.324 [info] (56111) Found module distlib : 0.3.6
2024-06-05 16:00:30.324 [info] (56111) Found module django : 4.2.3
2024-06-05 16:00:30.324 [info] (56111) Found module docutils : 0.20.1
2024-06-05 16:00:30.324 [info] (56111) Found module dulwich : 0.21.5
2024-06-05 16:00:30.324 [info] (56111) Found module executing : 1.2.0
2024-06-05 16:00:30.324 [info] (56111) Found module filelock : 3.12.0
2024-06-05 16:00:30.324 [info] (56111) Found module flake8 : 6.0.0
2024-06-05 16:00:30.324 [info] (56111) Found module html5lib : 1.1
2024-06-05 16:00:30.324 [info] (56111) Found module idna : 3.4
2024-06-05 16:00:30.324 [info] (56111) Found module importlib_metadata : 6.6.0
2024-06-05 16:00:30.324 [info] (56111) Found module installer : 0.7.0
2024-06-05 16:00:30.324 [info] (56111) Found module invoke : 2.1.2
2024-06-05 16:00:30.324 [info] (56111) Found module ipykernel : 6.29.4
2024-06-05 16:00:30.324 [info] (56111) Found module isort : 5.12.0
2024-06-05 16:00:30.324 [info] (56111) Found module jaraco : 3.2.3
2024-06-05 16:00:30.324 [info] (56111) Found module jedi : 0.18.2
2024-06-05 16:00:30.325 [info] (56111) Found module jmespath : 1.0.1
2024-06-05 16:00:30.325 [info] (56111) Found module jsonschema : 4.17.3
2024-06-05 16:00:30.325 [info] (56111) Found module jupyter_client : 8.6.1
2024-06-05 16:00:30.325 [info] (56111) Found module jupyter_core : 5.7.2
2024-06-05 16:00:30.325 [info] (56111) Found module keyring : 23.13.1
2024-06-05 16:00:30.325 [info] (56111) Found module lockfile : 0.12.2
2024-06-05 16:00:30.325 [info] (56111) Found module markdown_it : 3.0.0
2024-06-05 16:00:30.325 [info] (56111) Found module matplotlib_inline : 0.1.6
2024-06-05 16:00:30.325 [info] (56111) Found module mdurl : 0.1.2
2024-06-05 16:00:30.325 [info] (56111) Found module more_itertools : 9.1.0
2024-06-05 16:00:30.325 [info] (56111) Found module msgpack : 1.0.5
2024-06-05 16:00:30.325 [info] (56111) Found module mypy : 1.10.0
2024-06-05 16:00:30.325 [info] (56111) Found module nh3 : 0.2.14
2024-06-05 16:00:30.325 [info] (56111) Found module numpy : 1.26.4
2024-06-05 16:00:30.325 [info] (56111) Found module packaging : 23.1
2024-06-05 16:00:30.325 [info] (56111) Found module pandas : 2.2.2
2024-06-05 16:00:30.325 [info] (56111) Found module parso : 0.8.3
2024-06-05 16:00:30.325 [info] (56111) Found module pathspec : 0.11.1
2024-06-05 16:00:30.325 [info] (56111) Found module pexpect : 4.8.0
2024-06-05 16:00:30.325 [info] (56111) Found module pip : 23.1.2
2024-06-05 16:00:30.326 [info] (56111) Found module pipx : 1.2.1
2024-06-05 16:00:30.326 [info] (56111) Found module pkginfo : 1.9.6
2024-06-05 16:00:30.326 [info] (56111) Found module platformdirs : 3.5.1
2024-06-05 16:00:30.326 [info] (56111) Found module poetry : 1.5.0
2024-06-05 16:00:30.326 [info] (56111) Found module poetry_plugin_export : 1.3.1
2024-06-05 16:00:30.326 [info] (56111) Found module prompt_toolkit : 3.0.38
2024-06-05 16:00:30.326 [info] (56111) Found module psutil : 5.9.8
2024-06-05 16:00:30.326 [info] (56111) Found module ptyprocess : 0.7.0
2024-06-05 16:00:30.326 [info] (56111) Found module pure_eval : 0.2.2
2024-06-05 16:00:30.326 [info] (56111) Found module pycparser : 2.21
2024-06-05 16:00:30.326 [info] (56111) Found module pyflakes : 3.0.1
2024-06-05 16:00:30.327 [info] (56111) Found module pygments : 2.15.1
2024-06-05 16:00:30.328 [info] (56111) Found module pyproject_hooks : 1.0.0
2024-06-05 16:00:30.328 [info] (56111) Found module pyrsistent : 0.19.3
2024-06-05 16:00:30.328 [info] (56111) Found module pytz : 2023.3.post1
2024-06-05 16:00:30.328 [info] (56111) Found module rapidfuzz : 2.15.1
2024-06-05 16:00:30.328 [info] (56111) Found module readme_renderer : 42.0
2024-06-05 16:00:30.328 [info] (56111) Found module requests : 2.31.0
2024-06-05 16:00:30.328 [info] (56111) Found module requests_toolbelt : 1.0.0
2024-06-05 16:00:30.328 [info] (56111) Found module rfc3986 : 2.0.0
2024-06-05 16:00:30.328 [info] (56111) Found module rich : 13.7.0
2024-06-05 16:00:30.328 [info] (56111) Found module s3transfer : 0.10.0
2024-06-05 16:00:30.328 [info] (56111) Found module setuptools : 63.2.0
2024-06-05 16:00:30.328 [info] (56111) Found module shellingham : 1.5.0.post1
2024-06-05 16:00:30.328 [info] (56111) Found module sqlparse : 0.4.4
2024-06-05 16:00:30.328 [info] (56111) Found module stack_data : 0.6.2
2024-06-05 16:00:30.328 [info] (56111) Found module tabulate : 0.9.0
2024-06-05 16:00:30.328 [info] (56111) Found module tomli : 2.0.1
2024-06-05 16:00:30.328 [info] (56111) Found module tomlkit : 0.11.8
2024-06-05 16:00:30.328 [info] (56111) Found module tornado : 6.4
2024-06-05 16:00:30.328 [info] (56111) Found module traitlets : 5.9.0
2024-06-05 16:00:30.329 [info] (56111) Found module trove_classifiers : 2023.5.24
2024-06-05 16:00:30.329 [info] (56111) Found module twine : 4.0.2
2024-06-05 16:00:30.329 [info] (56111) Found module tzdata : 2024.1
2024-06-05 16:00:30.329 [info] (56111) Found module urllib3 : 1.26.16
2024-06-05 16:00:30.329 [info] (56111) Found module userpath : 1.9.1
2024-06-05 16:00:30.329 [info] (56111) Found module virtualenv : 20.23.0
2024-06-05 16:00:30.329 [info] (56111) Found module wcwidth : 0.2.6
2024-06-05 16:00:30.329 [info] (56111) Found module webencodings : 0.5.1
2024-06-05 16:00:30.329 [info] (56111) Found module wheel : 0.38.4
2024-06-05 16:00:30.329 [info] (56111) Found module xattr : 0.10.1
2024-06-05 16:00:30.329 [info] (56111) Found module zipp : 3.15.0
2024-06-05 16:00:30.329 [info] [Info  - 16:00:30] (56111) Found 7 source files
2024-06-05 16:00:30.329 [info] (56111) pytest configurations: {"message":"request cancelled","classes":["Test"],"files":["test_*.py","*_test.py"],"functions":["test"]}
2024-06-05 16:00:30.329 [info] (56111) pytest configurations: {"message":"script","classes":["Test"],"files":["test_*.py","*_test.py"],"functions":["test"]}
2024-06-05 16:00:30.406 [info] [Info  - 16:00:30] (56111) Background analysis(1) root directory: file:///Users/josh/.vscode/extensions/ms-python.vscode-pylance-2024.5.1/dist
2024-06-05 16:00:30.407 [info] [Info  - 16:00:30] (56111) Background analysis(1) started
2024-06-05 16:00:30.458 [info] (56111) Found module decorator : 5.1.1
2024-06-05 16:00:30.459 [info] (56111) Found module mccabe : 0.7.0
2024-06-05 16:00:30.459 [info] (56111) Found module mypy_extensions : 1.0.0
2024-06-05 16:00:30.460 [info] (56111) Found module nest_asyncio : 1.6.0
2024-06-05 16:00:30.462 [info] (56111) Found module pickleshare : 0.7.5
2024-06-05 16:00:30.462 [info] (56111) Found module pycodestyle : 2.10.0
2024-06-05 16:00:30.463 [info] (56111) Found module pyinvoke : 1.0.4
2024-06-05 16:00:30.463 [info] (56111) Found module six : 1.16.0
2024-06-05 16:00:30.463 [info] (56111) Found module typing_extensions : 4.7.1
2024-06-05 16:00:30.464 [info] (56111) Found module IPython : 8.13.2
2024-06-05 16:00:30.465 [info] (56111) Found module appnope : 0.1.3
2024-06-05 16:00:30.465 [info] (56111) Found module argcomplete : 3.1.6
2024-06-05 16:00:30.466 [info] (56111) Found module asgiref : 3.7.2
2024-06-05 16:00:30.466 [info] (56111) Found module asttokens : 2.2.1
2024-06-05 16:00:30.467 [info] (56111) Found module attrs : 23.1.0
2024-06-05 16:00:30.467 [info] (56111) Found module backcall : 0.2.0
2024-06-05 16:00:30.468 [info] (56111) Found module black : 23.3.0
2024-06-05 16:00:30.469 [info] (56111) Found module boto3 : 1.34.56
2024-06-05 16:00:30.469 [info] (56111) Found module botocore : 1.34.56
2024-06-05 16:00:30.470 [info] (56111) Found module build : 0.10.0
2024-06-05 16:00:30.470 [info] (56111) Found module cachecontrol : 0.12.11
2024-06-05 16:00:30.471 [info] (56111) Found module certifi : 2023.5.7
2024-06-05 16:00:30.472 [info] (56111) Found module cffi : 1.15.1
2024-06-05 16:00:30.472 [info] (56111) Found module charset_normalizer : 3.1.0
2024-06-05 16:00:30.473 [info] (56111) Found module cleo : 2.0.1
2024-06-05 16:00:30.473 [info] (56111) Found module click : 8.1.3
2024-06-05 16:00:30.473 [info] (56111) Found module comm : 0.2.2
2024-06-05 16:00:30.474 [info] (56111) Found module crashtest : 0.4.1
2024-06-05 16:00:30.474 [info] (56111) Found module debugpy : 1.8.1
2024-06-05 16:00:30.475 [info] (56111) Found module dep1 : 2.3.0
2024-06-05 16:00:30.475 [info] (56111) Found module distlib : 0.3.6
2024-06-05 16:00:30.475 [info] (56111) Found module django : 4.2.3
2024-06-05 16:00:30.477 [info] (56111) Found module docutils : 0.20.1
2024-06-05 16:00:30.478 [info] (56111) Found module dulwich : 0.21.5
2024-06-05 16:00:30.478 [info] (56111) Found module executing : 1.2.0
2024-06-05 16:00:30.478 [info] (56111) Found module filelock : 3.12.0
2024-06-05 16:00:30.479 [info] (56111) Found module flake8 : 6.0.0
2024-06-05 16:00:30.479 [info] (56111) Found module html5lib : 1.1
2024-06-05 16:00:30.480 [info] (56111) Found module idna : 3.4
2024-06-05 16:00:30.480 [info] (56111) Found module importlib_metadata : 6.6.0
2024-06-05 16:00:30.480 [info] (56111) Found module installer : 0.7.0
2024-06-05 16:00:30.481 [info] (56111) Found module invoke : 2.1.2
2024-06-05 16:00:30.481 [info] (56111) Found module ipykernel : 6.29.4
2024-06-05 16:00:30.482 [info] (56111) Found module isort : 5.12.0
2024-06-05 16:00:30.482 [info] (56111) Found module jaraco : 3.2.3
2024-06-05 16:00:30.482 [info] (56111) Found module jedi : 0.18.2
2024-06-05 16:00:30.483 [info] (56111) Found module jmespath : 1.0.1
2024-06-05 16:00:30.483 [info] (56111) Found module jsonschema : 4.17.3
2024-06-05 16:00:30.484 [info] (56111) Found module jupyter_client : 8.6.1
2024-06-05 16:00:30.484 [info] (56111) Found module jupyter_core : 5.7.2
2024-06-05 16:00:30.485 [info] (56111) Found module keyring : 23.13.1
2024-06-05 16:00:30.485 [info] (56111) Found module lockfile : 0.12.2
2024-06-05 16:00:30.486 [info] (56111) Found module markdown_it : 3.0.0
2024-06-05 16:00:30.486 [info] (56111) Found module matplotlib_inline : 0.1.6
2024-06-05 16:00:30.487 [info] (56111) Found module mdurl : 0.1.2
2024-06-05 16:00:30.487 [info] (56111) Found module more_itertools : 9.1.0
2024-06-05 16:00:30.488 [info] (56111) Found module msgpack : 1.0.5
2024-06-05 16:00:30.488 [info] (56111) Found module mypy : 1.10.0
2024-06-05 16:00:30.491 [info] (56111) Found module nh3 : 0.2.14
2024-06-05 16:00:30.493 [info] (56111) Found module numpy : 1.26.4
2024-06-05 16:00:30.493 [info] (56111) Found module packaging : 23.1
2024-06-05 16:00:30.494 [info] (56111) Found module pandas : 2.2.2
2024-06-05 16:00:30.495 [info] (56111) Found module parso : 0.8.3
2024-06-05 16:00:30.496 [info] (56111) Found module pathspec : 0.11.1
2024-06-05 16:00:30.497 [info] (56111) Found module pexpect : 4.8.0
2024-06-05 16:00:30.498 [info] (56111) Found module pip : 23.1.2
2024-06-05 16:00:30.498 [info] (56111) Found module pipx : 1.2.1
2024-06-05 16:00:30.499 [info] (56111) Found module pkginfo : 1.9.6
2024-06-05 16:00:30.499 [info] (56111) Found module platformdirs : 3.5.1
2024-06-05 16:00:30.500 [info] (56111) Found module poetry : 1.5.0
2024-06-05 16:00:30.501 [info] (56111) Found module poetry_plugin_export : 1.3.1
2024-06-05 16:00:30.502 [info] (56111) Found module prompt_toolkit : 3.0.38
2024-06-05 16:00:30.503 [info] (56111) Found module psutil : 5.9.8
2024-06-05 16:00:30.503 [info] (56111) Found module ptyprocess : 0.7.0
2024-06-05 16:00:30.504 [info] (56111) Found module pure_eval : 0.2.2
2024-06-05 16:00:30.504 [info] (56111) Found module pycparser : 2.21
2024-06-05 16:00:30.504 [info] (56111) Found module pyflakes : 3.0.1
2024-06-05 16:00:30.504 [info] (56111) Found module pygments : 2.15.1
2024-06-05 16:00:30.508 [info] (56111) Found module pyproject_hooks : 1.0.0
2024-06-05 16:00:30.511 [info] (56111) Found module pyrsistent : 0.19.3
2024-06-05 16:00:30.513 [info] (56111) Found module pytz : 2023.3.post1
2024-06-05 16:00:30.514 [info] (56111) Found module rapidfuzz : 2.15.1
2024-06-05 16:00:30.515 [info] (56111) Found module readme_renderer : 42.0
2024-06-05 16:00:30.515 [info] (56111) Found module requests : 2.31.0
2024-06-05 16:00:30.516 [info] (56111) Found module requests_toolbelt : 1.0.0
2024-06-05 16:00:30.516 [info] (56111) Found module rfc3986 : 2.0.0
2024-06-05 16:00:30.516 [info] (56111) Found module rich : 13.7.0
2024-06-05 16:00:30.517 [info] (56111) Found module s3transfer : 0.10.0
2024-06-05 16:00:30.517 [info] (56111) Found module setuptools : 63.2.0
2024-06-05 16:00:30.517 [info] (56111) Found module shellingham : 1.5.0.post1
2024-06-05 16:00:30.517 [info] (56111) Found module sqlparse : 0.4.4
2024-06-05 16:00:30.517 [info] (56111) Found module stack_data : 0.6.2
2024-06-05 16:00:30.517 [info] (56111) Found module tabulate : 0.9.0
2024-06-05 16:00:30.517 [info] (56111) Found module tomli : 2.0.1
2024-06-05 16:00:30.517 [info] (56111) Found module tomlkit : 0.11.8
2024-06-05 16:00:30.517 [info] (56111) Found module tornado : 6.4
2024-06-05 16:00:30.517 [info] (56111) Found module traitlets : 5.9.0
2024-06-05 16:00:30.517 [info] (56111) Found module trove_classifiers : 2023.5.24
2024-06-05 16:00:30.517 [info] (56111) Found module twine : 4.0.2
2024-06-05 16:00:30.517 [info] (56111) Found module tzdata : 2024.1
2024-06-05 16:00:30.517 [info] (56111) Found module urllib3 : 1.26.16
2024-06-05 16:00:30.517 [info] (56111) Found module userpath : 1.9.1
2024-06-05 16:00:30.517 [info] (56111) Found module virtualenv : 20.23.0
2024-06-05 16:00:30.518 [info] (56111) Found module wcwidth : 0.2.6
2024-06-05 16:00:30.518 [info] (56111) Found module webencodings : 0.5.1
2024-06-05 16:00:30.518 [info] (56111) Found module wheel : 0.38.4
2024-06-05 16:00:30.518 [info] (56111) Found module xattr : 0.10.1
2024-06-05 16:00:30.518 [info] (56111) Found module zipp : 3.15.0
2024-06-05 16:00:30.527 [info] (56111) pytest configurations: {"message":"request cancelled","classes":["Test"],"files":["test_*.py","*_test.py"],"functions":["test"]}
2024-06-05 16:00:30.542 [info] (56111) [BG(1)] indexing: file:///Users/josh/dev/experiments/pylance-analysis/src/project/__init__.py ...
2024-06-05 16:00:30.542 [info] (56111) [BG(1)]   parsing: file:///Users/josh/dev/experiments/pylance-analysis/src/project/__init__.py [fs read 0ms] (20ms)
2024-06-05 16:00:30.599 [info] (56111) [BG(1)]   parsing: file:///Users/josh/.vscode/extensions/ms-python.vscode-pylance-2024.5.1/dist/typeshed-fallback/stdlib/builtins.pyi [fs read 2ms] (57ms)
2024-06-05 16:00:30.619 [info] (56111) [BG(1)]   binding: file:///Users/josh/.vscode/extensions/ms-python.vscode-pylance-2024.5.1/dist/typeshed-fallback/stdlib/builtins.pyi (20ms)
2024-06-05 16:00:30.620 [info] (56111) [BG(1)]   binding: file:///Users/josh/dev/experiments/pylance-analysis/src/project/__init__.py (0ms)
2024-06-05 16:00:30.620 [info] (56111) [BG(1)] indexing: file:///Users/josh/dev/experiments/pylance-analysis/src/project/__init__.py [found 0] (97ms)
2024-06-05 16:00:30.620 [info] (56111) Indexing Done: file:///Users/josh/dev/experiments/pylance-analysis/src/project/__init__.py
2024-06-05 16:00:30.620 [info] (56111) [BG(1)] indexing: file:///Users/josh/dev/experiments/pylance-analysis/src/project/app.py ...
2024-06-05 16:00:30.620 [info] (56111) [BG(1)]   parsing: file:///Users/josh/dev/experiments/pylance-analysis/src/project/app.py [fs read 0ms] (0ms)
2024-06-05 16:00:30.621 [info] (56111) [BG(1)]   binding: file:///Users/josh/dev/experiments/pylance-analysis/src/project/app.py (0ms)
2024-06-05 16:00:30.621 [info] (56111) [BG(1)] indexing: file:///Users/josh/dev/experiments/pylance-analysis/src/project/app.py [found 0] (0ms)
2024-06-05 16:00:30.621 [info] (56111) Indexing Done: file:///Users/josh/dev/experiments/pylance-analysis/src/project/app.py
2024-06-05 16:00:30.621 [info] (56111) [BG(1)] indexing: file:///Users/josh/dev/experiments/pylance-analysis/src/project/migrations/__init__.py ...
2024-06-05 16:00:30.621 [info] (56111) [BG(1)]   parsing: file:///Users/josh/dev/experiments/pylance-analysis/src/project/migrations/__init__.py [fs read 0ms] (1ms)
2024-06-05 16:00:30.621 [info] (56111) [BG(1)]   binding: file:///Users/josh/dev/experiments/pylance-analysis/src/project/migrations/__init__.py (0ms)
2024-06-05 16:00:30.621 [info] (56111) [BG(1)] indexing: file:///Users/josh/dev/experiments/pylance-analysis/src/project/migrations/__init__.py [found 0] (1ms)
2024-06-05 16:00:30.621 [info] (56111) Indexing Done: file:///Users/josh/dev/experiments/pylance-analysis/src/project/migrations/__init__.py
2024-06-05 16:00:30.621 [info] (56111) [BG(1)] indexing: file:///Users/josh/dev/experiments/pylance-analysis/src/project/migrations/migration.py ...
2024-06-05 16:00:30.621 [info] (56111) [BG(1)]   parsing: file:///Users/josh/dev/experiments/pylance-analysis/src/project/migrations/migration.py [fs read 0ms] (0ms)
2024-06-05 16:00:30.621 [info] (56111) [BG(1)]   binding: file:///Users/josh/dev/experiments/pylance-analysis/src/project/migrations/migration.py (0ms)
2024-06-05 16:00:30.621 [info] (56111) [BG(1)] indexing: file:///Users/josh/dev/experiments/pylance-analysis/src/project/migrations/migration.py [found 0] (0ms)
2024-06-05 16:00:30.621 [info] (56111) Indexing Done: file:///Users/josh/dev/experiments/pylance-analysis/src/project/migrations/migration.py
2024-06-05 16:00:30.622 [info] (56111) [BG(1)] indexing: file:///Users/josh/dev/experiments/pylance-analysis/src/project/other/__init__.py ...
2024-06-05 16:00:30.622 [info] (56111) [BG(1)]   parsing: file:///Users/josh/dev/experiments/pylance-analysis/src/project/other/__init__.py [fs read 0ms] (0ms)
2024-06-05 16:00:30.622 [info] (56111) [BG(1)]   binding: file:///Users/josh/dev/experiments/pylance-analysis/src/project/other/__init__.py (0ms)
2024-06-05 16:00:30.622 [info] (56111) [BG(1)] indexing: file:///Users/josh/dev/experiments/pylance-analysis/src/project/other/__init__.py [found 0] (1ms)
2024-06-05 16:00:30.622 [info] (56111) Indexing Done: file:///Users/josh/dev/experiments/pylance-analysis/src/project/other/__init__.py
2024-06-05 16:00:30.622 [info] (56111) [BG(1)] indexing: file:///Users/josh/dev/experiments/pylance-analysis/src/project/other/extra.py ...
2024-06-05 16:00:30.622 [info] (56111) [BG(1)]   parsing: file:///Users/josh/dev/experiments/pylance-analysis/src/project/other/extra.py [fs read 0ms] (0ms)
2024-06-05 16:00:30.622 [info] (56111) [BG(1)]   binding: file:///Users/josh/dev/experiments/pylance-analysis/src/project/other/extra.py (0ms)
2024-06-05 16:00:30.622 [info] (56111) [BG(1)] indexing: file:///Users/josh/dev/experiments/pylance-analysis/src/project/other/extra.py [found 0] (0ms)
2024-06-05 16:00:30.622 [info] (56111) Indexing Done: file:///Users/josh/dev/experiments/pylance-analysis/src/project/other/extra.py
2024-06-05 16:00:30.622 [info] (56111) [BG(1)] indexing: file:///Users/josh/dev/experiments/pylance-analysis/src/project/other/include.py ...
2024-06-05 16:00:30.622 [info] (56111) [BG(1)]   parsing: file:///Users/josh/dev/experiments/pylance-analysis/src/project/other/include.py [fs read 0ms] (0ms)
2024-06-05 16:00:30.622 [info] (56111) [BG(1)]   binding: file:///Users/josh/dev/experiments/pylance-analysis/src/project/other/include.py (0ms)
2024-06-05 16:00:30.622 [info] (56111) [BG(1)] indexing: file:///Users/josh/dev/experiments/pylance-analysis/src/project/other/include.py [found 0] (0ms)
2024-06-05 16:00:30.622 [info] (56111) Indexing Done: file:///Users/josh/dev/experiments/pylance-analysis/src/project/other/include.py
2024-06-05 16:00:30.624 [info] (56111) pytest configurations: {"message":"script","classes":["Test"],"files":["test_*.py","*_test.py"],"functions":["test"]}
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Jun 5, 2024
@jarshwah
Copy link
Author

jarshwah commented Jun 5, 2024

Here is a full project that is able to reproduce the issue attached

pylance-analysis.zip

@erictraut
Copy link
Contributor

Yes, pyright settings in the config file (pyproject.toml or pyrightconfig.json) override workspace (language server) settings. This is very much by design, and it would be problematic if we were to change this. Config files are typically committed to the repo, and these settings are common to all developers working on the project. It wouldn't make sense to allow each developer to override these settings because this would result in inconsistent type checking behaviors from one developer to the next.

It sounds like you want the ability to tell pylance that it should index only a subset of your project. Is that correct? Why don't you want it to index your full project?

@jarshwah
Copy link
Author

jarshwah commented Jun 5, 2024

override workspace (language server) settings

This doesn't seem to be documented though and was incredibly surprising.

It sounds like you want the ability to tell pylance that it should index only a subset of your project. Is that correct? Why don't you want it to index your full project?

Yes, correct. Our repo has approximately 60,000 python files. Different teams operate in vastly different areas of the code base. Having pylance index the entire repo results in large memory use and requires us to restart it several times per day. To combat this, devs (were trying to) customise their own workspace settings to only index the subset of files they interact with.

We don't use pyright for typechecking (we use mypy instead) - pylance is used for refactoring/code nav/reference finding etc.

From memory, the only reason we added a section into the pyproject.toml was because, some time ago, pylance would complain that it was attempting to index too much. I'm unclear if the workspace settings took higher precedence then or not. We may also have other developers not using vscode but still using pyright for other environment LSP servers, so we'd also prefer not to remove the pyproject.toml configuration.

@StellaHuang95
Copy link
Contributor

Thanks for your feedback. As mentioned earlier, this behavior is by design, and we currently do not have plans to change it in the near term. However, we value user input and will monitor feedback closely. If we receive more requests like this, we will certainly consider making changes. For now, we are closing this issue. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants