Skip to content

Update changelog and version for point release. #13610

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

Merged
merged 6 commits into from
Aug 27, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,73 @@
# Changelog

## 2020.8.2 (27 August 2020)

### Enhancements

1. Update "Tip" notification for new users to either show the existing tip, a link to a feedback survey or nothing.
([#13535](https://github.com/Microsoft/vscode-python/issues/13535))
Comment on lines +7 to +8
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luabud Do we want this here?


### Fixes

1. Fix saving during close and auto backup to actually save a notebook.
([#11711](https://github.com/Microsoft/vscode-python/issues/11711))
1. Show the server display string that the user is going to connect to after selecting a compute instance and reloading the window.
([#13551](https://github.com/Microsoft/vscode-python/issues/13551))

### Thanks

Thanks to the following projects which we fully rely on to provide some of
our features:

- [debugpy](https://pypi.org/project/debugpy/)
- [isort](https://pypi.org/project/isort/)
- [jedi](https://pypi.org/project/jedi/)
and [parso](https://pypi.org/project/parso/)
- [Microsoft Python Language Server](https://github.com/microsoft/python-language-server)
- [Pylance](https://github.com/microsoft/pylance-release)
- [exuberant ctags](http://ctags.sourceforge.net/) (user-installed)
- [rope](https://pypi.org/project/rope/) (user-installed)

Also thanks to the various projects we provide integrations with which help
make this extension useful:

- Debugging support:
[Django](https://pypi.org/project/Django/),
[Flask](https://pypi.org/project/Flask/),
[gevent](https://pypi.org/project/gevent/),
[Jinja](https://pypi.org/project/Jinja/),
[Pyramid](https://pypi.org/project/pyramid/),
[PySpark](https://pypi.org/project/pyspark/),
[Scrapy](https://pypi.org/project/Scrapy/),
[Watson](https://pypi.org/project/Watson/)
- Formatting:
[autopep8](https://pypi.org/project/autopep8/),
[black](https://pypi.org/project/black/),
[yapf](https://pypi.org/project/yapf/)
- Interpreter support:
[conda](https://conda.io/),
[direnv](https://direnv.net/),
[pipenv](https://pypi.org/project/pipenv/),
[pyenv](https://github.com/pyenv/pyenv),
[venv](https://docs.python.org/3/library/venv.html#module-venv),
[virtualenv](https://pypi.org/project/virtualenv/)
- Linting:
[bandit](https://pypi.org/project/bandit/),
[flake8](https://pypi.org/project/flake8/),
[mypy](https://pypi.org/project/mypy/),
[prospector](https://pypi.org/project/prospector/),
[pylint](https://pypi.org/project/pylint/),
[pydocstyle](https://pypi.org/project/pydocstyle/),
[pylama](https://pypi.org/project/pylama/)
- Testing:
[nose](https://pypi.org/project/nose/),
[pytest](https://pypi.org/project/pytest/),
[unittest](https://docs.python.org/3/library/unittest.html#module-unittest)

And finally thanks to the [Python](https://www.python.org/) development team and
community for creating a fantastic programming language and community to be a
part of!

## 2020.8.1 (20 August 2020)

### Fixes
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "python",
"displayName": "Python",
"description": "Linting, Debugging (multi-threaded, remote), Intellisense, Jupyter Notebooks, code formatting, refactoring, unit tests, snippets, and more.",
"version": "2020.8.1",
"version": "2020.8.2",
"featureFlags": {
"usingNewInterpreterStorage": true
},
Expand Down Expand Up @@ -3527,7 +3527,7 @@
"vscode-languageclient": "^7.0.0-next.8",
"vscode-languageserver": "^7.0.0-next.6",
"vscode-languageserver-protocol": "^3.16.0-next.6",
"vscode-tas-client": "^0.0.864",
"vscode-tas-client": "^0.1.4",
"vsls": "^0.3.1291",
"winreg": "^1.2.4",
"winston": "^3.2.1",
Expand Down
4 changes: 2 additions & 2 deletions src/client/common/application/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ export interface ICommandNameArgumentTypeMapping extends ICommandNameWithoutArgu
[DSCommands.SetJupyterKernel]: [KernelSpecInterpreter, Uri, undefined | Uri];
[DSCommands.SwitchJupyterKernel]: [ISwitchKernelOptions | undefined];
[DSCommands.SelectJupyterCommandLine]: [undefined | Uri];
[DSCommands.SaveNotebookNonCustomEditor]: [Uri];
[DSCommands.SaveAsNotebookNonCustomEditor]: [Uri, Uri];
[DSCommands.SaveNotebookNonCustomEditor]: [INotebookModel];
[DSCommands.SaveAsNotebookNonCustomEditor]: [INotebookModel, Uri];
[DSCommands.OpenNotebookNonCustomEditor]: [Uri];
[DSCommands.GatherQuality]: [string];
[DSCommands.LatestExtension]: [string];
Expand Down
7 changes: 7 additions & 0 deletions src/client/common/experiments/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,10 @@ export enum EnableTrustedNotebooks {
export enum TryPylance {
experiment = 'tryPylance'
}

// Experiment for the content of the tip being displayed on first extension launch:
// interpreter selection tip, feedback survey or nothing.
export enum SurveyAndInterpreterTipNotification {
tipExperiment = 'pythonTipPromptWording',
surveyExperiment = 'pythonMailingListPromptWording'
}
8 changes: 8 additions & 0 deletions src/client/common/experiments/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ export class ExperimentService implements IExperimentService {
return this.experimentationService.isCachedFlightEnabled(experiment);
}

public async getExperimentValue<T extends boolean | number | string>(experiment: string): Promise<T | undefined> {
if (!this.experimentationService || this._optOutFrom.includes('All') || this._optOutFrom.includes(experiment)) {
return;
}

return this.experimentationService.getTreatmentVariableAsync('vscode', experiment);
}

private logExperiments() {
const experiments = this.globalState.get<{ features: string[] }>(EXP_MEMENTO_KEY, { features: [] });

Expand Down
1 change: 1 addition & 0 deletions src/client/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,7 @@ export interface IExperimentsManager {
export const IExperimentService = Symbol('IExperimentService');
export interface IExperimentService {
inExperiment(experimentName: string): Promise<boolean>;
getExperimentValue<T extends boolean | number | string>(experimentName: string): Promise<T | undefined>;
}

export type InterpreterConfigurationScope = { uri: Resource; configTarget: ConfigurationTarget };
Expand Down
8 changes: 6 additions & 2 deletions src/client/datascience/gather/gatherLogger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { inject, injectable } from 'inversify';
import cloneDeep = require('lodash/cloneDeep');
import { extensions } from 'vscode';
import { concatMultilineStringInput } from '../../../datascience-ui/common';
import { traceError } from '../../common/logger';
import { traceError, traceInfo } from '../../common/logger';
import { IConfigurationService } from '../../common/types';
import { noop } from '../../common/utils/misc';
import { sendTelemetryEvent } from '../../telemetry';
Expand Down Expand Up @@ -69,7 +69,11 @@ export class GatherLogger implements IGatherLogger {
}
}
const api = ext.exports;
this.gather = api.getGatherProvider();
try {
this.gather = api.getGatherProvider();
} catch {
traceInfo(`Gather not installed`);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export class NativeEditorOldWebView extends NativeEditor {
}
try {
if (!this.isUntitled) {
await this.commandManager.executeCommand(Commands.SaveNotebookNonCustomEditor, this.model?.file);
await this.commandManager.executeCommand(Commands.SaveNotebookNonCustomEditor, this.model);
this.savedEvent.fire(this);
return;
}
Expand All @@ -295,7 +295,7 @@ export class NativeEditorOldWebView extends NativeEditor {
if (fileToSaveTo) {
await this.commandManager.executeCommand(
Commands.SaveAsNotebookNonCustomEditor,
this.model.file,
this.model,
fileToSaveTo
);
this.savedEvent.fire(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class NativeEditorProviderOld extends NativeEditorProvider {
@inject(IWorkspaceService) workspace: IWorkspaceService,
@inject(IConfigurationService) configuration: IConfigurationService,
@inject(ICustomEditorService) customEditorService: ICustomEditorService,
@inject(IDataScienceFileSystem) private fs: IDataScienceFileSystem,
@inject(IDataScienceFileSystem) fs: IDataScienceFileSystem,
@inject(IDocumentManager) private documentManager: IDocumentManager,
@inject(ICommandManager) private readonly cmdManager: ICommandManager,
@inject(IDataScienceErrorHandler) private dataScienceErrorHandler: IDataScienceErrorHandler,
Expand All @@ -97,7 +97,8 @@ export class NativeEditorProviderOld extends NativeEditorProvider {
configuration,
customEditorService,
storage,
notebookProvider
notebookProvider,
fs
);

// No live share sync required as open document from vscode will give us our contents.
Expand All @@ -106,21 +107,18 @@ export class NativeEditorProviderOld extends NativeEditorProvider {
this.documentManager.onDidChangeActiveTextEditor(this.onDidChangeActiveTextEditorHandler.bind(this))
);
this.disposables.push(
this.cmdManager.registerCommand(Commands.SaveNotebookNonCustomEditor, async (resource: Uri) => {
const customDocument = this.customDocuments.get(resource.fsPath);
if (customDocument) {
await this.saveCustomDocument(customDocument, new CancellationTokenSource().token);
}
this.cmdManager.registerCommand(Commands.SaveNotebookNonCustomEditor, async (model: INotebookModel) => {
await this.storage.save(model, new CancellationTokenSource().token);
})
);
this.disposables.push(
this.cmdManager.registerCommand(
Commands.SaveAsNotebookNonCustomEditor,
async (resource: Uri, targetResource: Uri) => {
const customDocument = this.customDocuments.get(resource.fsPath);
async (model: INotebookModel, targetResource: Uri) => {
await this.storage.saveAs(model, targetResource);
const customDocument = this.customDocuments.get(model.file.fsPath);
if (customDocument) {
await this.saveCustomDocumentAs(customDocument, targetResource);
this.customDocuments.delete(resource.fsPath);
this.customDocuments.delete(model.file.fsPath);
this.customDocuments.set(targetResource.fsPath, { ...customDocument, uri: targetResource });
}
}
Expand Down
19 changes: 12 additions & 7 deletions src/client/datascience/notebookStorage/nativeEditorProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ export class NativeEditorProvider implements INotebookEditorProvider, CustomEdit
@inject(IConfigurationService) protected readonly configuration: IConfigurationService,
@inject(ICustomEditorService) private customEditorService: ICustomEditorService,
@inject(INotebookStorageProvider) protected readonly storage: INotebookStorageProvider,
@inject(INotebookProvider) private readonly notebookProvider: INotebookProvider
@inject(INotebookProvider) private readonly notebookProvider: INotebookProvider,
@inject(IDataScienceFileSystem) protected readonly fs: IDataScienceFileSystem
) {
traceInfo(`id is ${this._id}`);

Expand Down Expand Up @@ -217,14 +218,18 @@ export class NativeEditorProvider implements INotebookEditorProvider, CustomEdit
public async loadModel(file: Uri, contents?: string, backupId?: string): Promise<INotebookModel>;
// tslint:disable-next-line: no-any
public async loadModel(file: Uri, contents?: string, options?: any): Promise<INotebookModel> {
// Every time we load a new untitled file, up the counter past the max value for this counter
this.untitledCounter = getNextUntitledCounter(file, this.untitledCounter);
// Get the model that may match this file
let model = [...this.models.values()].find((m) => this.fs.arePathsSame(m.file, file));
if (!model) {
// Every time we load a new untitled file, up the counter past the max value for this counter
this.untitledCounter = getNextUntitledCounter(file, this.untitledCounter);

// Load our model from our storage object.
const model = await this.storage.getOrCreateModel(file, contents, options);
// Load our model from our storage object.
model = await this.storage.getOrCreateModel(file, contents, options);

// Make sure to listen to events on the model
this.trackModel(model);
// Make sure to listen to events on the model
this.trackModel(model);
}
return model;
}

Expand Down
21 changes: 16 additions & 5 deletions src/client/datascience/notebookStorage/nativeEditorStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
import detectIndent = require('detect-indent');
import { VSCodeNotebookModel } from './vscNotebookModel';

const KeyPrefix = 'notebook-storage-';
export const KeyPrefix = 'notebook-storage-';
const NotebookTransferKey = 'notebook-transfered';

export function isUntitled(model?: INotebookModel): boolean {
Expand Down Expand Up @@ -180,21 +180,29 @@ export class NativeEditorStorage implements INotebookStorage {
// Keep track of the time when this data was saved.
// This way when we retrieve the data we can compare it against last modified date of the file.
const specialContents = contents ? JSON.stringify({ contents, lastModifiedTimeMs: Date.now() }) : undefined;
return this.writeToStorage(filePath, specialContents, cancelToken);
return this.writeToStorage(model.file, filePath, specialContents, cancelToken);
}

private async clearHotExit(file: Uri, backupId?: string): Promise<void> {
const key = backupId || this.getStaticStorageKey(file);
const filePath = this.getHashedFileName(key);
await this.writeToStorage(filePath);
await this.writeToStorage(undefined, filePath);
}

private async writeToStorage(filePath: string, contents?: string, cancelToken?: CancellationToken): Promise<void> {
private async writeToStorage(
owningFile: Uri | undefined,
filePath: string,
contents?: string,
cancelToken?: CancellationToken
): Promise<void> {
try {
if (!cancelToken?.isCancellationRequested) {
if (contents) {
await this.fs.createLocalDirectory(path.dirname(filePath));
if (!cancelToken?.isCancellationRequested) {
if (owningFile) {
this.trustService.trustNotebook(owningFile, contents).ignoreErrors();
}
await this.fs.writeLocalFile(filePath, contents);
}
} else {
Expand Down Expand Up @@ -374,6 +382,8 @@ export class NativeEditorStorage implements INotebookStorage {
if (isNotebookTrusted) {
model.trust();
}
} else {
model.trust();
}

return model;
Expand Down Expand Up @@ -407,9 +417,10 @@ export class NativeEditorStorage implements INotebookStorage {
}

private async getStoredContentsFromFile(file: Uri, key: string): Promise<string | undefined> {
const filePath = this.getHashedFileName(key);
try {
// Use this to read from the extension global location
const contents = await this.fs.readLocalFile(file.fsPath);
const contents = await this.fs.readLocalFile(filePath);
const data = JSON.parse(contents);
// Check whether the file has been modified since the last time the contents were saved.
if (data && data.lastModifiedTimeMs && file.scheme === 'file') {
Expand Down
Loading