-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add PYTHONPATH to environment variables if the Python extension makes it available #4045
Conversation
7581ca0
to
00b12d4
Compare
@@ -77,25 +77,24 @@ export class DvcViewer extends Disposable implements ICli { | |||
} | |||
|
|||
private viewProcess(name: string, cwd: string, args: Args) { | |||
const options = getOptions({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identical blocks of code found in 2 locations. Consider refactoring.
const options = getOptions( | ||
this.config.getPythonBinPath(), | ||
this.config.getCliPath(), | ||
const options = getOptions({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identical blocks of code found in 2 locations. Consider refactoring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add PYTHONPATH to environment variables if the Python extension makes it available
Is PYTHONPATH moved to stable or is it still deprecated?
I'm still lost on why PYTHONPATH is required. #1791 seems to be broader - it's about other envs, other variables, etc. Unless I'm missing something. |
It has been moved to stable: |
#1815 is the ticket that spawned #1791. Under #1791 two separate users detailed the same issue (here and here). They want to use relative imports for the modules within their project. By using this API we will respect whatever they've set for |
We can leave the ticket open but this is still useful IMO. |
00b12d4
to
f401d36
Compare
Code Climate has analyzed commit f401d36 and detected 2 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 96.7% (85% is the threshold). This pull request will bring the total coverage in the repository to 95.2% (0.0% change). View more on Code Climate. |
Closes #1791
This PR uses the
ms-python.python
extension's new API to grab theirPYTHONPATH
variable and add it to the environment variables used to create DVC processes. In order for users to set this up they need to add a file containingPYTHONPATH=
. This can be a.env
file at the root of the workspace (default for the extension) or they need to set thepython.envFile
configuration option.Demo (fixes issue in magnetic-tiles-defect)
Screen.Recording.2023-06-06.at.4.53.48.pm.mov