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

pre-commit usage in VS Code devcontainer #196

Open
olivercoleman-switchdin opened this issue Jul 26, 2023 · 1 comment
Open

pre-commit usage in VS Code devcontainer #196

olivercoleman-switchdin opened this issue Jul 26, 2023 · 1 comment

Comments

@olivercoleman-switchdin

Love this, thank you! I have what must be a common use case, but I can't figure out how to make it work!

I want to use pyright in a pre-commit setup. I'm using a docker container (in a vs code devcontainer) instead of a venv. I tried following the instructions at https://github.com/RobertCraigie/pyright-python#pre-commit but this only describes how to handle dependencies installed in a venv. Because I'm using a docker container the dependencies are installed directly. I tried a few things with the extraPaths option for pyright but nothing seemed to work.

I don't know how to tell the pyright pre-commit hook how to find/include these dependencies.

@olivercoleman-switchdin
Copy link
Author

Figured out a solution. I had to set extraPaths=["<home dir>/.local/lib/python3.11/site-packages"] (replacing with actual home dir).
Feels a bit hacky with absolute path containing home dir path and python version in there though.

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

No branches or pull requests

1 participant