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

Setting Path for Shared Repos #1

Open
Californian opened this issue Dec 2, 2022 · 1 comment
Open

Setting Path for Shared Repos #1

Californian opened this issue Dec 2, 2022 · 1 comment

Comments

@Californian
Copy link

This currently uses an absolute path, with the current user's username, to set the venv path.

In the pyright docs, it says: "If you are working on a project with other developers, it is best not to specify this setting in the config file, since this path will typically differ for each developer. Instead, it can be specified on the command line or in a per-user setting.".

What have you found to be best practice for dealing with this situation?

@alefpereira
Copy link
Owner

Hi @Californian, the command-line.md from pyright docs states that you can use the option --venv-path together with a shared config file. I haven't tested it but would be something like pyright-langserver --venv-path $(pyenv prefix).

If you use pyright inside nvim you'd probably need to change your server config:

require'lspconfig'.pyright.setup{
      cmd = { "pyright-langserver", "--venv-path", "<venv-path>", "--stdio" }
}

Don't know if you can use $(pyenv prefix) directly in the cmd, but if its not the case, I'm sure there is an ease way to do it (get the venv path/run this command) in the lua config (I just can't tell you off the top of my head).

Hope it helps. BR.

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

2 participants