Skip to content

Commit 872e77a

Browse files
committed
Fixed issue where env variables aren't inherited in debugger #77 and #109
1 parent ab6aabd commit 872e77a

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Once installed, do remember to [configure the path](https://github.com/DonJayama
77
If you're working in a [virtualenv](https://virtualenv.readthedocs.org/), you can reference the `python` interpreter from your virtualenv (ie `~/.virtualenvs/XXX/bin/python`).
88

99
##Features
10-
* Linting (PyLint, Pep8, Flake8, pydocstyle with config files and plugins)
10+
* Linting (Prospector, PyLint, Pep8, Flake8, pydocstyle with config files and plugins)
1111
* Intellisense and autocompletion
1212
* Auto indenting
1313
* Code formatting (autopep8, yapf, with config files)
@@ -54,6 +54,7 @@ If you're working in a [virtualenv](https://virtualenv.readthedocs.org/), you ca
5454
+ pep8 can be turned on/off (default is off), supports standard configuaration files
5555
+ flake8 can be turned on/off (default is on), supports standard configuaration files
5656
+ pydocstyle can be turned on/off (default is on), supports standard configuaration files
57+
+ prospector can be turned on/off (default is on)
5758
+ Different categories of errors reported by pylint can be configured as warnings, errors, information or hits
5859
+ Path to pylint, pep8 and flake8 and pep8 can be configured
5960
+ Custom plugins such as pylint plugin for Django can be easily used by modifying the settings as follows:
@@ -101,6 +102,8 @@ If you're working in a [virtualenv](https://virtualenv.readthedocs.org/), you ca
101102
+ pip install flake8
102103
* pydocstyle is installed for linting (optional)
103104
+ pip install pydocstyle
105+
* prospector is installed for linting (optional)
106+
+ pip install prospector
104107
* Autopep8 is installed for code formatting (optional)
105108
+ pip install pep8
106109
+ pip install --upgrade autopep8
@@ -111,6 +114,10 @@ If you're working in a [virtualenv](https://virtualenv.readthedocs.org/), you ca
111114

112115
## Change Log
113116

117+
### Version 0.3.8
118+
* Added support for linting using prospector [#130](https://github.com/DonJayamanne/pythonVSCode/pull/130)
119+
* Fixed issue where environment variables weren't being inherited by the debugger [#109](https://github.com/DonJayamanne/pythonVSCode/issues/109) and [#77](https://github.com/DonJayamanne/pythonVSCode/issues/77)
120+
114121
### Version 0.3.7
115122
* Added support for auto indenting of some keywords [#83](https://github.com/DonJayamanne/pythonVSCode/issues/83)
116123
* Added support for launching console apps for Mac [#128](https://github.com/DonJayamanne/pythonVSCode/issues/128)

src/client/debugger/DebugClients/LocalDebugClient.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,15 @@ export class LocalDebugClient extends DebugClient {
140140
if (typeof this.args.pythonPath === "string" && this.args.pythonPath.trim().length > 0) {
141141
pythonPath = this.args.pythonPath;
142142
}
143-
var environmentVariables = this.args.env ? this.args.env : {};
144-
//GUID is hardcoded for now, will have to be fixed
143+
var environmentVariables = this.args.env ? this.args.env : null;
144+
if (environmentVariables) {
145+
for (let setting in process.env) {
146+
if (!environmentVariables[setting]) {
147+
environmentVariables[setting] = process.env[setting];
148+
}
149+
}
150+
}
151+
145152
var currentFileName = module.filename;
146153
//var ptVSToolsFilePath = path.join(path.dirname(currentFileName), "..", "..", "..", "..", "pythonFiles", "PythonTools", "visualstudio_py_launcher.py");
147154

0 commit comments

Comments
 (0)