PYTHONPATH in .env file ignored with pyright extraPaths config #2916
propertone
started this conversation in
Enhancement
Replies: 3 comments
-
Thanks for the report. Will look at how this should work |
Beta Was this translation helpful? Give feedback.
0 replies
-
we need to do expanding env:PYTHONPATH in other configurations as well. see https://github.com/microsoft/pyrx/pull/852 and microsoft/vscode-python#15107 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Moving this issue to discussion as an enhancement request for comments and upvotes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Environment data
Issue
This is a follow-up to #2195 - we want to merge the project's and user's
extraPath
setting. To do that, we have theextraPath
variable specified inside apyproject.toml
file using:I also have a per-user PYTHONPATH specified inside a
.env
file like:I expect that the paths in
pyproject.toml
and.env
file will get merged, but the PYTHONPATH from the.env
file is completely ignored instead. Usingpyrightconfig.json
has the same behavior. Merging the paths works if the extraPaths is specified ONLY in the vscode setting'spython.analysis.extraPaths
property (and NOT in the pyproject.toml/pyrightconfig.json file). However we prefer to not use this approach because: 1) Other pyright configurations likeinclude
are only supported in the pyright configuration file and keeping all pyright configurations in one place is more convenient, and 2) we prefer not to commit the vscode setting file to Git as some user actions unknowingly end up modifying the project's .vscode/settings.json file which causes conflicts.Beta Was this translation helpful? Give feedback.
All reactions