[WIP] Add support for detecting venvs from pipenv and poetry projects #40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for detecting if a project is managed using either poetry or pipenv and configuring pyright to use the venv and python interpreter created by those tools.
I have been using this code for a while without problems and I think it's extremely useful. However, there are a couple of problems with the code, thus the WIP tag:
pipenv
project ifPipfile
exists in the project root andpipenv
is found inPATH
. Likewise, poetry is assumed ifpyproject.toml
is found in the project root andpoetry
is found inPATH
. This naive approach misses several obvious cases, but I wonder if there is a method or even need to make the detection mechanism more accurate or if it's better to add a customization variable that overrides the detection?I'm looking forward to your feedback!