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

Adding "exclude" to pyproject.toml makes Pyright check the entire .venv folder? #21061

Open
1 task done
ArturGalstyan1 opened this issue Nov 22, 2024 · 1 comment
Open
1 task done
Labels
admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue

Comments

@ArturGalstyan1
Copy link

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

First off, I'm not 100% sure if this is a bug, but it seems to be at least unexpected behaviour to me.

I've captured the problem in this video:

output.mp4

Basically, adding the exclude field in the pyproject.toml file makes pyright analyse the entire .venv folder, which takes a LOT of time and it keeps redoing it when you install new dependencies or restart the language server.

Steps to reproduce:
0. Install uv

  1. uv init && uv venv && source .venv/bin/activate && uv add torch equinox
  2. go to the pyproject.toml file and add:
[tool.pyright]
venvPath = "."
venv = ".venv"
exclude = ["scripts"]

Environment

Zed: v0.164.0 (Zed Dev 114c462)
OS: macOS 15.0.1
Memory: 18 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log

@ArturGalstyan1 ArturGalstyan1 added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Nov 22, 2024
@osiewicz
Copy link
Contributor

Thanks for a thorough report! It seems like an explicit decision on PyRight's end:
microsoft/pyright#9057 (comment)

If you provide an explicit exclude setting, there are no auto-excludes and you are responsible for specifying which directories. I suspect what's happening is that you have a virtual environment in your project folder, so pyright is treating all of the files within this virtual environment as project source files and attempting to type check them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue
Projects
None yet
Development

No branches or pull requests

2 participants