Skip to content

Commit 92a1928

Browse files
karthiknadigkimadelinerchiodogreazerKartik Raj
committed
Merge stuff from may release back into master (microsoft#12233)
* Revert vscode-extension-telemetry changes for the release (microsoft#11602) (microsoft#11656) * Revert "Fix slashes in telemetry unit tests (microsoft#11572)" This reverts commit 7431c9c. * Revert "Use vscode-extension-telemetry for our exceptions & error telemetry (microsoft#11524)" This reverts commit d5065e6. * Remove from changelog * Port storage fix to release branch (microsoft#11673) * Fix storage not being used (microsoft#11649) * Fix storage not being used * Add disposable to storage so it won't write after shutdown * Fix dirty title * Hack to get tests to pass * Another way to get run all to not interfere * Update changelog * Port scrolling fix to release (microsoft#11688) * Fix scrolling (microsoft#11681) * Fix scrolling * Review feedback - fix scrolling on expand/collapse * Update changelog * Update package.json Co-authored-by: Jim Griesmer <[email protected]> * Cherry-pick pipenv changes and pythonpath prompt changes to release (microsoft#11700) * Show the prompt again if user clicks on more info (microsoft#11664) * Show the prompt again if user clicks on more info * Review feedback * Use Learn more as text for the link. * Leave pipenv in a corner until the user decides to select an interpreter (microsoft#11654) * add onSuggestion option * Swap onActivation with onSuggestion * Update unit tests * Remove registration of IPipenvService * Move didTriggerInterpreterSuggestions logic inside pipenv locator * Fix existing unit tests * Add new unit tests * Replace typemoq any param with object * Shorten the tests * Fix warning * Duplicate teardown Co-authored-by: Kim-Adeline Miguel <[email protected]> * Update extension version (microsoft#11730) * Update extension version * Update date in changelog. * Update change log with additional notes. (microsoft#11764) * Cherry picks and version updates for bug fix release (microsoft#11878) * Do not execute shebang as an interpreter until user has clicked on the codelens enclosing the shebang (microsoft#11816) * Do not execute shebang as an interpreter until user has clicked on the codelens enclosing the shebang * Rename * Oops * Update src/test/providers/shebangCodeLenseProvider.unit.test.ts Co-authored-by: Karthik Nadig <[email protected]> Co-authored-by: Karthik Nadig <[email protected]> * Update version and change log for bugfix release Co-authored-by: Kartik Raj <[email protected]> * Cherry-pick ExP platform work from master (microsoft#12160) * User cannot belong to all experiments in an experiment group (microsoft#11945) * 10790 prep - Create an experiments/ folder (microsoft#11980) * experiments.ts -> experiments/manager.ts * eexperimentGroups -> experiments/experimentGroups * test/experiments.u.t -> test/experiments/manager.u.t * experimentGroups -> groups * Whoops committed one file too many * Add support for VS Code's experiment service (microsoft#11979) * Add npm package * News entry * experiments.ts -> experiments/manager.ts * Wrong issue number * eexperimentGroups -> experiments/experimentGroups * Move experiments.unit.tests.ts -> experiments/ * Commit new files * Merge gone sideways * Add types * Add opt in/out handling * Activation (service registry) * Don't pin tas-client to one version * Unit tests + fixes * Lol forgot to remove a comment + add headers * Forgot 'use strict' in service.ts * Use IApplicationEnvironment instead of IExtensions * Apply suggestions from code review Co-authored-by: Don Jayamanne <[email protected]> * Remove unnecessary formatted props * n e v e r m i n d * Aight fixed it * flight -> experiment * Check stub calls instead of ctor impl * removed getExperimentService stub check * Set shared properties for all telemetry events * Add test for shared properties Co-authored-by: Don Jayamanne <[email protected]> * Fix merge issues * Fix index unit tests * Revert "Fix index unit tests" This reverts commit 2fb61fc. * Make MPLS and vscode-extension-telemetry work together 🤝 (microsoft#11823) * Revert "Revert vscode-extension-telemetry changes for the release (microsoft#11602)" This reverts commit 71d1793. * Remove entry from changelog + add new news entry * Update LS code to use periods instead of slashes * Revert "Update LS code to use periods instead of slashes" This reverts commit 1356651. * Replace slashes before sending telemetry instead * Too fast too furious * Fix more merge issues Co-authored-by: Don Jayamanne <[email protected]> Co-authored-by: Kim-Adeline Miguel <[email protected]> * Update version and changelog for point release (microsoft#12171) * Ensure extension features are started when in Deprecate PythonPath experiment and opening a file without any folder opened (microsoft#12182) * Ensure extension features are started when in Deprecate PythonPath experiment and opening a file without any folder opened. * Added comments * Update change log (microsoft#12190) * Cherry pick fix for hasInterpreters and update change log (microsoft#12198) * Double-check for interpreters when running diagnostics (microsoft#12158) * Get interpreters if hasInterpreters returns false * Undo ignoreErrors() * Add unit tests * Fixed tests * Newline * Fix merge issues. * Update change log Co-authored-by: Kim-Adeline Miguel <[email protected]> * Update version for point release (microsoft#12259) Co-authored-by: Kim-Adeline Miguel <[email protected]> Co-authored-by: Rich Chiodo <[email protected]> Co-authored-by: Jim Griesmer <[email protected]> Co-authored-by: Kartik Raj <[email protected]> Co-authored-by: Don Jayamanne <[email protected]>
1 parent 62bc5d0 commit 92a1928

File tree

4 files changed

+164
-29
lines changed

4 files changed

+164
-29
lines changed

CHANGELOG.md

Lines changed: 131 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
1. Removed `python.jediEnabled` setting in favor of `python.languageServer`. Instead of `"python.jediEnabled": true` please use `"python.languageServer": "Jedi"`.
88
([#7010](https://github.com/Microsoft/vscode-python/issues/7010))
9-
1. Integrate VS Code experiment framework in the extension.
10-
([#10790](https://github.com/Microsoft/vscode-python/issues/10790))
119
1. Added a start page for the extension. It opens to new users or when there is a new release. It can be disabled with the setting 'Python: Show Start Page'.
1210
([#11057](https://github.com/Microsoft/vscode-python/issues/11057))
1311
1. Preliminary support using other languages for the kernel.
@@ -63,7 +61,7 @@
6361
([#11751](https://github.com/Microsoft/vscode-python/issues/11751))
6462
1. When switching to an invalid kernel (one that is registered but cannot start) in raw mode respect the launch timeout that is passed in.
6563
([#11752](https://github.com/Microsoft/vscode-python/issues/11752))
66-
1. Make ```python.dataScience.textOutputLimit``` apply on subsequent rerun. We were letting the 'outputPrepend' metadata persist from run to run.
64+
1. Make `python.dataScience.textOutputLimit` apply on subsequent rerun. We were letting the 'outputPrepend' metadata persist from run to run.
6765
(thanks [Barry Nolte](https://github.com/BarryNolte))
6866
([#11777](https://github.com/Microsoft/vscode-python/issues/11777))
6967
1. Use `${command:python.interpreterPath}` to get selected interpreter path in `launch.json` and `tasks.json`.
@@ -76,12 +74,8 @@
7674
([#11800](https://github.com/Microsoft/vscode-python/issues/11800))
7775
1. Make sure to use webView.cspSource for all csp sources.
7876
([#11855](https://github.com/Microsoft/vscode-python/issues/11855))
79-
1. Double-check for interpreters when running diagnostics before displaying the "Python is not installed" message.
80-
([#11870](https://github.com/Microsoft/vscode-python/issues/11870))
8177
1. Use command line arguments to launch our raw kernels as opposed to a connection file. The connection file seems to be causing issues in particular on windows CI machines with permissions.
8278
([#11883](https://github.com/Microsoft/vscode-python/issues/11883))
83-
1. Ensure user cannot belong to all experiments in an experiment group.
84-
([#11943](https://github.com/Microsoft/vscode-python/issues/11943))
8579
1. Improve our status reporting when launching and connecting to a raw kernel.
8680
([#11951](https://github.com/Microsoft/vscode-python/issues/11951))
8781
1. Prewarm raw kernels based on raw kernel support and don't prewarm if jupyter autostart is disabled.
@@ -108,8 +102,6 @@
108102
([#11058](https://github.com/Microsoft/vscode-python/issues/11058))
109103
1. Reenable CDN unit tests.
110104
([#11442](https://github.com/Microsoft/vscode-python/issues/11442))
111-
1. Update telemetry on errors and exceptions to use [vscode-extension-telemetry](https://www.npmjs.com/package/vscode-extension-telemetry).
112-
([#11597](https://github.com/Microsoft/vscode-python/issues/11597))
113105
1. Run by line for notebook cells minimal implementation.
114106
([#11607](https://github.com/Microsoft/vscode-python/issues/11607))
115107
1. Get shape and count when showing debugger variables.
@@ -190,6 +182,136 @@ And finally thanks to the [Python](https://www.python.org/) development team and
190182
community for creating a fantastic programming language and community to be a
191183
part of!
192184

185+
## 2020.5.3 (10 June 2020)
186+
187+
1. Update `debugpy` to use `1.0.0b11` or greater.
188+
189+
### Thanks
190+
191+
Thanks to the following projects which we fully rely on to provide some of
192+
our features:
193+
194+
- [debugpy](https://pypi.org/project/debugpy/)
195+
- [isort](https://pypi.org/project/isort/)
196+
- [jedi](https://pypi.org/project/jedi/)
197+
and [parso](https://pypi.org/project/parso/)
198+
- [Microsoft Python Language Server](https://github.com/microsoft/python-language-server)
199+
- [ptvsd](https://pypi.org/project/ptvsd/)
200+
- [exuberant ctags](http://ctags.sourceforge.net/) (user-installed)
201+
- [rope](https://pypi.org/project/rope/) (user-installed)
202+
203+
Also thanks to the various projects we provide integrations with which help
204+
make this extension useful:
205+
206+
- Debugging support:
207+
[Django](https://pypi.org/project/Django/),
208+
[Flask](https://pypi.org/project/Flask/),
209+
[gevent](https://pypi.org/project/gevent/),
210+
[Jinja](https://pypi.org/project/Jinja/),
211+
[Pyramid](https://pypi.org/project/pyramid/),
212+
[PySpark](https://pypi.org/project/pyspark/),
213+
[Scrapy](https://pypi.org/project/Scrapy/),
214+
[Watson](https://pypi.org/project/Watson/)
215+
- Formatting:
216+
[autopep8](https://pypi.org/project/autopep8/),
217+
[black](https://pypi.org/project/black/),
218+
[yapf](https://pypi.org/project/yapf/)
219+
- Interpreter support:
220+
[conda](https://conda.io/),
221+
[direnv](https://direnv.net/),
222+
[pipenv](https://pypi.org/project/pipenv/),
223+
[pyenv](https://github.com/pyenv/pyenv),
224+
[venv](https://docs.python.org/3/library/venv.html#module-venv),
225+
[virtualenv](https://pypi.org/project/virtualenv/)
226+
- Linting:
227+
[bandit](https://pypi.org/project/bandit/),
228+
[flake8](https://pypi.org/project/flake8/),
229+
[mypy](https://pypi.org/project/mypy/),
230+
[prospector](https://pypi.org/project/prospector/),
231+
[pylint](https://pypi.org/project/pylint/),
232+
[pydocstyle](https://pypi.org/project/pydocstyle/),
233+
[pylama](https://pypi.org/project/pylama/)
234+
- Testing:
235+
[nose](https://pypi.org/project/nose/),
236+
[pytest](https://pypi.org/project/pytest/),
237+
[unittest](https://docs.python.org/3/library/unittest.html#module-unittest)
238+
239+
And finally thanks to the [Python](https://www.python.org/) development team and
240+
community for creating a fantastic programming language and community to be a
241+
part of!
242+
243+
## 2020.5.2 (8 June 2020)
244+
245+
### Fixes
246+
247+
1. Double-check for interpreters when running diagnostics before displaying the "Python is not installed" message.
248+
([#11870](https://github.com/Microsoft/vscode-python/issues/11870))
249+
1. Ensure user cannot belong to all experiments in an experiment group.
250+
([#11943](https://github.com/Microsoft/vscode-python/issues/11943))
251+
1. Ensure extension features are started when in `Deprecate PythonPath` experiment and opening a file without any folder opened.
252+
([#12177](https://github.com/Microsoft/vscode-python/issues/12177))
253+
254+
### Code Health
255+
256+
1. Integrate VS Code experiment framework in the extension.
257+
([#10790](https://github.com/Microsoft/vscode-python/issues/10790))
258+
1. Update telemetry on errors and exceptions to use [vscode-extension-telemetry](https://www.npmjs.com/package/vscode-extension-telemetry).
259+
([#11597](https://github.com/Microsoft/vscode-python/issues/11597))
260+
261+
### Thanks
262+
263+
Thanks to the following projects which we fully rely on to provide some of
264+
our features:
265+
266+
- [debugpy](https://pypi.org/project/debugpy/)
267+
- [isort](https://pypi.org/project/isort/)
268+
- [jedi](https://pypi.org/project/jedi/)
269+
and [parso](https://pypi.org/project/parso/)
270+
- [Microsoft Python Language Server](https://github.com/microsoft/python-language-server)
271+
- [ptvsd](https://pypi.org/project/ptvsd/)
272+
- [exuberant ctags](http://ctags.sourceforge.net/) (user-installed)
273+
- [rope](https://pypi.org/project/rope/) (user-installed)
274+
275+
Also thanks to the various projects we provide integrations with which help
276+
make this extension useful:
277+
278+
- Debugging support:
279+
[Django](https://pypi.org/project/Django/),
280+
[Flask](https://pypi.org/project/Flask/),
281+
[gevent](https://pypi.org/project/gevent/),
282+
[Jinja](https://pypi.org/project/Jinja/),
283+
[Pyramid](https://pypi.org/project/pyramid/),
284+
[PySpark](https://pypi.org/project/pyspark/),
285+
[Scrapy](https://pypi.org/project/Scrapy/),
286+
[Watson](https://pypi.org/project/Watson/)
287+
- Formatting:
288+
[autopep8](https://pypi.org/project/autopep8/),
289+
[black](https://pypi.org/project/black/),
290+
[yapf](https://pypi.org/project/yapf/)
291+
- Interpreter support:
292+
[conda](https://conda.io/),
293+
[direnv](https://direnv.net/),
294+
[pipenv](https://pypi.org/project/pipenv/),
295+
[pyenv](https://github.com/pyenv/pyenv),
296+
[venv](https://docs.python.org/3/library/venv.html#module-venv),
297+
[virtualenv](https://pypi.org/project/virtualenv/)
298+
- Linting:
299+
[bandit](https://pypi.org/project/bandit/),
300+
[flake8](https://pypi.org/project/flake8/),
301+
[mypy](https://pypi.org/project/mypy/),
302+
[prospector](https://pypi.org/project/prospector/),
303+
[pylint](https://pypi.org/project/pylint/),
304+
[pydocstyle](https://pypi.org/project/pydocstyle/),
305+
[pylama](https://pypi.org/project/pylama/)
306+
- Testing:
307+
[nose](https://pypi.org/project/nose/),
308+
[pytest](https://pypi.org/project/pytest/),
309+
[unittest](https://docs.python.org/3/library/unittest.html#module-unittest)
310+
311+
And finally thanks to the [Python](https://www.python.org/) development team and
312+
community for creating a fantastic programming language and community to be a
313+
part of!
314+
193315
## 2020.5.1 (19 May 2020)
194316

195317
### Fixes

src/client/common/interpreterPathService.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { ConfigurationChangeEvent, ConfigurationTarget, Event, EventEmitter, Uri
99
import { IWorkspaceService } from './application/types';
1010
import { PythonSettings } from './configSettings';
1111
import { isTestExecution } from './constants';
12+
import { traceError } from './logger';
1213
import { FileSystemPaths } from './platform/fs-paths';
1314
import {
1415
IDisposable,
@@ -105,7 +106,8 @@ export class InterpreterPathService implements IInterpreterPathService {
105106
return;
106107
}
107108
if (!resource) {
108-
throw new Error('Cannot update workspace settings as no workspace is opened');
109+
traceError('Cannot update workspace settings as no workspace is opened');
110+
return;
109111
}
110112
const settingKey = this.getSettingKey(resource, configTarget);
111113
const persistentSetting = this.persistentStateFactory.createGlobalPersistentState<string | undefined>(
@@ -149,7 +151,11 @@ export class InterpreterPathService implements IInterpreterPathService {
149151

150152
public async _copyWorkspaceFolderValueToNewStorage(resource: Resource, value: string | undefined): Promise<void> {
151153
// Copy workspace folder setting into the new storage if it hasn't been copied already
152-
const workspaceFolderKey = this.workspaceService.getWorkspaceFolderIdentifier(resource);
154+
const workspaceFolderKey = this.workspaceService.getWorkspaceFolderIdentifier(resource, '');
155+
if (workspaceFolderKey === '') {
156+
// No workspace folder is opened, simply return.
157+
return;
158+
}
153159
const flaggedWorkspaceFolderKeysStorage = this.persistentStateFactory.createGlobalPersistentState<string[]>(
154160
workspaceFolderKeysForWhichTheCopyIsDone_Key,
155161
[]

src/client/telemetry/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,8 @@ function serializeStackTrace(ex: Error): string {
282282
trace += '\n\tat <anonymous>';
283283
}
284284
}
285-
// Ensure we always use `/` as path seperators.
286-
// This way stack traces (with relative paths) comming from different OS will always look the same.
285+
// Ensure we always use `/` as path separators.
286+
// This way stack traces (with relative paths) coming from different OS will always look the same.
287287
return trace.trim().replace(/\\/g, '/');
288288
}
289289

src/test/common/interpreterPathService.unit.test.ts

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ suite('Interpreter Path Service', async () => {
9292
test('If the one-off transfer to new storage has not happened yet for the workspace folder, do it and record the transfer', async () => {
9393
const update = sinon.stub(InterpreterPathService.prototype, 'update');
9494
const persistentState = TypeMoq.Mock.ofType<IPersistentState<string[]>>();
95-
workspaceService.setup((w) => w.getWorkspaceFolderIdentifier(resource)).returns(() => resource.fsPath);
95+
workspaceService.setup((w) => w.getWorkspaceFolderIdentifier(resource, '')).returns(() => resource.fsPath);
9696
persistentStateFactory
9797
.setup((p) => p.createGlobalPersistentState<string[]>(workspaceFolderKeysForWhichTheCopyIsDone_Key, []))
9898
.returns(() => persistentState.object);
@@ -112,7 +112,7 @@ suite('Interpreter Path Service', async () => {
112112
test('If the one-off transfer to new storage has already happened for the workspace folder, do not update and simply return', async () => {
113113
const update = sinon.stub(InterpreterPathService.prototype, 'update');
114114
const persistentState = TypeMoq.Mock.ofType<IPersistentState<string[]>>();
115-
workspaceService.setup((w) => w.getWorkspaceFolderIdentifier(resource)).returns(() => resource.fsPath);
115+
workspaceService.setup((w) => w.getWorkspaceFolderIdentifier(resource, '')).returns(() => resource.fsPath);
116116
persistentStateFactory
117117
.setup((p) => p.createGlobalPersistentState<string[]>(workspaceFolderKeysForWhichTheCopyIsDone_Key, []))
118118
.returns(() => persistentState.object);
@@ -126,6 +126,23 @@ suite('Interpreter Path Service', async () => {
126126
persistentState.verifyAll();
127127
});
128128

129+
test('If no folder is opened, do not do the one-off transfer to new storage for the workspace folder', async () => {
130+
const update = sinon.stub(InterpreterPathService.prototype, 'update');
131+
const persistentState = TypeMoq.Mock.ofType<IPersistentState<string[]>>();
132+
workspaceService.setup((w) => w.getWorkspaceFolderIdentifier(resource, '')).returns(() => '');
133+
persistentStateFactory
134+
.setup((p) => p.createGlobalPersistentState<string[]>(workspaceFolderKeysForWhichTheCopyIsDone_Key, []))
135+
.returns(() => persistentState.object);
136+
persistentState.setup((p) => p.value).returns(() => ['...storedWorkspaceKeys']);
137+
persistentState.setup((p) => p.updateValue(TypeMoq.It.isAny())).verifiable(TypeMoq.Times.never());
138+
139+
interpreterPathService = new InterpreterPathService(persistentStateFactory.object, workspaceService.object, []);
140+
await interpreterPathService._copyWorkspaceFolderValueToNewStorage(resource, 'workspaceFolderPythonPath');
141+
142+
assert(update.notCalled);
143+
persistentState.verifyAll();
144+
});
145+
129146
test('If the one-off transfer to new storage has not happened yet for the workspace, do it and record the transfer', async () => {
130147
const workspaceFileUri = Uri.parse('path/to/workspaceFile');
131148
const expectedWorkspaceKey = fs.normCase(workspaceFileUri.fsPath);
@@ -395,7 +412,7 @@ suite('Interpreter Path Service', async () => {
395412
_didChangeInterpreterEmitter.verifyAll();
396413
});
397414

398-
test('Updating workspace settings throws error if no workspace is opened', async () => {
415+
test('Updating workspace settings simply returns if no workspace is opened', async () => {
399416
const expectedSettingKey = `WORKSPACE_FOLDER_INTERPRETER_PATH_${resource.fsPath}`;
400417
const persistentState = TypeMoq.Mock.ofType<IPersistentState<string | undefined>>();
401418
workspaceService.setup((w) => w.workspaceFolders).returns(() => undefined);
@@ -408,18 +425,13 @@ suite('Interpreter Path Service', async () => {
408425
.returns(() => Promise.resolve())
409426
.verifiable(TypeMoq.Times.never());
410427

411-
const promise = interpreterPathService.update(
412-
resourceOutsideOfWorkspace,
413-
ConfigurationTarget.Workspace,
414-
interpreterPath
415-
);
416-
await expect(promise).to.eventually.be.rejectedWith(Error);
428+
await interpreterPathService.update(resourceOutsideOfWorkspace, ConfigurationTarget.Workspace, interpreterPath);
417429

418430
persistentState.verifyAll();
419431
persistentStateFactory.verifyAll();
420432
});
421433

422-
test('Updating workspace folder settings throws error if no workspace is opened', async () => {
434+
test('Updating workspace folder settings simply returns if no workspace is opened', async () => {
423435
const expectedSettingKey = `WORKSPACE_FOLDER_INTERPRETER_PATH_${resource.fsPath}`;
424436
const persistentState = TypeMoq.Mock.ofType<IPersistentState<string | undefined>>();
425437
workspaceService.setup((w) => w.workspaceFolders).returns(() => undefined);
@@ -432,12 +444,7 @@ suite('Interpreter Path Service', async () => {
432444
.returns(() => Promise.resolve())
433445
.verifiable(TypeMoq.Times.never());
434446

435-
const promise = interpreterPathService.update(
436-
resourceOutsideOfWorkspace,
437-
ConfigurationTarget.Workspace,
438-
interpreterPath
439-
);
440-
await expect(promise).to.eventually.be.rejectedWith(Error);
447+
await interpreterPathService.update(resourceOutsideOfWorkspace, ConfigurationTarget.Workspace, interpreterPath);
441448

442449
persistentState.verifyAll();
443450
persistentStateFactory.verifyAll();

0 commit comments

Comments
 (0)