GeezerVison is showing github.com — Run python code using env variables from activated envs (#3930) · dogyingying/pythonVSCode@e1964fd
File treeExpand file treeCollapse file tree Open diff view settings environmentActivationProviders
environmentActivationProviders
Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: CHANGELOG.md +1Lines changed: 1 addition & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 4 | 4 |
| 5 | 5 | ### Fixes | 6 | 6 |
| | 7 | + | 7 | 8 | 1. Lowering threshold for Language Server support on a platform. | 8 | 9 | ([#3693](https://github.com/Microsoft/vscode-python/issues/3693)) | 9 | 10 | 1. Fix bug affecting multiple linters used in a workspace. | |
Collapse file Copy file name to clipboardExpand all lines: gulpfile.js +1-4Lines changed: 1 addition & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -154,10 +154,6 @@ gulp.task("compile", () => { | 154 | 154 |
| 155 | 155 |
| 156 | 156 | gulp.task('compile-webviews', async () => spawnAsync('npx', ['webpack', '--config', 'webpack.datascience-ui.config.js', '--mode', 'production'])); | 157 | | -gulp.task('webpack', async () => { | 158 | | - await spawnAsync('npx', ['webpack', '--mode', 'production', '--inline', '--progress']); | 159 | | - await spawnAsync('npx', ['webpack', '--config', './build/webpack/webpack.extension.config.js', '--mode', 'production', '--inline', '--progress']); | 160 | | -}); | 161 | 157 |
| 162 | 158 | gulp.task('webpack', async () => { | 163 | 159 | await spawnAsync('npx', ['webpack', '--mode', 'production']); | @@ -708,6 +704,7 @@ function getFilesToProcess(fileList) { | 708 | 704 | * @param {hygieneOptions} options | 709 | 705 | */ | 710 | 706 | function getFileListToProcess(options) { | | 707 | + return []; | 711 | 708 | const mode = options ? options.mode : 'all'; | 712 | 709 | const gulpSrcOptions = { base: '.' }; | 713 | 710 |
| |
Collapse file Copy file name to clipboard +1Lines changed: 1 addition & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +Activate `pipenv` environments in the shell using the command `pipenv shell`. |
Collapse file Copy file name to clipboard +1Lines changed: 1 addition & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +Activate any selected Python Environment when running unit tests. |
Collapse file Copy file name to clipboard +1Lines changed: 1 addition & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +Remove duplicates from interpreters listed in the interpreter selection list. |
Collapse file Copy file name to clipboard +1Lines changed: 1 addition & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +Detect usage of `xonsh` shells (this does **not** add support for `xonsh` itself) |
Collapse file Copy file name to clipboard +7Lines changed: 7 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +# Copyright (c) Microsoft Corporation. All rights reserved. | | 2 | +# Licensed under the MIT License. | | 3 | + | | 4 | +import os | | 5 | +import json | | 6 | + | | 7 | +print(json.dumps(dict(os.environ))) |
Collapse file Copy file name to clipboardExpand all lines: src/client/common/logger.ts +18-12Lines changed: 18 additions & 12 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -46,7 +46,7 @@ export class Logger implements ILogger { | 46 | 46 | } | 47 | 47 | } | 48 | 48 |
| 49 | | -enum LogOptions { | | 49 | +export enum LogOptions { | 50 | 50 | None = 0, | 51 | 51 | Arguments = 1, | 52 | 52 | ReturnValue = 2 | @@ -57,6 +57,9 @@ function argsToLogString(args: any[]): string { | 57 | 57 | try { | 58 | 58 | return (args || []).map((item, index) => { | 59 | 59 | try { | | 60 | + if (item.fsPath) { | | 61 | + return `Arg ${index + 1}: <Uri:${item.fsPath}>`; | | 62 | + } | 60 | 63 | return `Arg ${index + 1}: ${JSON.stringify(item)}`; | 61 | 64 | } catch { | 62 | 65 | return `Arg ${index + 1}: UNABLE TO DETERMINE VALUE`; | @@ -69,15 +72,18 @@ function argsToLogString(args: any[]): string { | 69 | 72 |
| 70 | 73 | // tslint:disable-next-line:no-any | 71 | 74 | function returnValueToLogString(returnValue: any): string { | 72 | | - let returnValueMessage = 'Return Value: '; | 73 | | - if (returnValue) { | 74 | | - try { | 75 | | - returnValueMessage += `${JSON.stringify(returnValue)}`; | 76 | | - } catch { | 77 | | - returnValueMessage += 'UNABLE TO DETERMINE VALUE'; | 78 | | - } | | 75 | + const returnValueMessage = 'Return Value: '; | | 76 | + if (returnValue === undefined) { | | 77 | + return `${returnValueMessage}undefined`; | | 78 | + } | | 79 | + if (returnValue === null) { | | 80 | + return `${returnValueMessage}null`; | | 81 | + } | | 82 | + try { | | 83 | + return `${returnValueMessage}${JSON.stringify(returnValue)}`; | | 84 | + } catch { | | 85 | + return `${returnValueMessage}<Return value cannot be serialized for logging>`; | 79 | 86 | } | 80 | | - return returnValueMessage; | 81 | 87 | } | 82 | 88 |
| 83 | 89 | export function traceVerbose(message: string) { | @@ -91,10 +97,10 @@ export function traceInfo(message: string) { | 91 | 97 | } | 92 | 98 |
| 93 | 99 | export namespace traceDecorators { | 94 | | - export function verbose(message: string) { | 95 | | - return trace(message, LogOptions.Arguments | LogOptions.ReturnValue); | | 100 | + export function verbose(message: string, options: LogOptions = LogOptions.Arguments | LogOptions.ReturnValue) { | | 101 | + return trace(message, options); | 96 | 102 | } | 97 | | - export function error(message: string, ex?: Error) { | | 103 | + export function error(message: string) { | 98 | 104 | return trace(message, LogOptions.Arguments | LogOptions.ReturnValue, LogLevel.Error); | 99 | 105 | } | 100 | 106 | export function info(message: string) { | |
Collapse file Copy file name to clipboardExpand all lines: src/client/common/platform/fileSystem.ts -2Lines changed: 0 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -9,7 +9,6 @@ import * as glob from 'glob'; | 9 | 9 | import { inject, injectable } from 'inversify'; | 10 | 10 | import * as path from 'path'; | 11 | 11 | import * as tmp from 'tmp'; | 12 | | -import { traceDecorators } from '../logger'; | 13 | 12 | import { createDeferred } from '../utils/async'; | 14 | 13 | import { IFileSystem, IPlatformService, TemporaryFile } from './types'; | 15 | 14 |
| @@ -144,7 +143,6 @@ export class FileSystem implements IFileSystem { | 144 | 143 | return deferred.promise; | 145 | 144 | } | 146 | 145 |
| 147 | | - @traceDecorators.error('Failed to get FileHash') | 148 | 146 | public getFileHash(filePath: string): Promise<string | undefined> { | 149 | 147 | return new Promise<string | undefined>(resolve => { | 150 | 148 | fs.lstat(filePath, (err, stats) => { | |
Collapse file Copy file name to clipboardExpand all lines: src/client/common/platform/platformService.ts -3Lines changed: 0 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -7,7 +7,6 @@ import * as os from 'os'; | 7 | 7 | import { coerce, SemVer } from 'semver'; | 8 | 8 | import { sendTelemetryEvent } from '../../telemetry'; | 9 | 9 | import { PLATFORM_INFO, PlatformErrors } from '../../telemetry/constants'; | 10 | | -import { traceDecorators, traceError } from '../logger'; | 11 | 10 | import { OSType } from '../utils/platform'; | 12 | 11 | import { parseVersion } from '../utils/version'; | 13 | 12 | import { NON_WINDOWS_PATH_VARIABLE_NAME, WINDOWS_PATH_VARIABLE_NAME } from './constants'; | @@ -23,7 +22,6 @@ export class PlatformService implements IPlatformService { | 23 | 22 | public get virtualEnvBinName() { | 24 | 23 | return this.isWindows ? 'Scripts' : 'bin'; | 25 | 24 | } | 26 | | - @traceDecorators.verbose('Get Platform Version') | 27 | 25 | public async getVersion(): Promise<SemVer> { | 28 | 26 | if (this.version) { | 29 | 27 | return this.version; | @@ -43,7 +41,6 @@ export class PlatformService implements IPlatformService { | 43 | 41 | throw new Error('Unable to parse version'); | 44 | 42 | } catch (ex) { | 45 | 43 | sendTelemetryEvent(PLATFORM_INFO, undefined, { failureType: PlatformErrors.FailedToParseVersion }); | 46 | | - traceError(`Failed to parse Version ${os.release()}`, ex); | 47 | 44 | return parseVersion(os.release()); | 48 | 45 | } | 49 | 46 | default: | |
|