GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Run python code using env variables from activated envs (#3930) · dogyingying/pythonVSCode@e1964fd

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • CHANGELOG.md
  • gulpfile.js
  • news
    • 1 Enhancements
      • 2855.md
    • 2 Fixes
      • 3330.md
      • 3953.md
    • 3 Code Health
      • 3746.md
  • pythonFiles
    • printEnvVariables.py
  • src
    • client
      • common
        • logger.ts
        • platform
          • fileSystem.ts
          • platformService.ts
        • process
          • proc.ts
          • pythonExecutionFactory.ts
          • types.ts
        • serviceRegistry.ts
        • terminal
          • environmentActivationProviders
            • condaActivationProvider.ts
            • pipEnvActivationProvider.ts
          • helper.ts
          • types.ts
        • utils
          • cacheUtils.ts
          • decorators.ts
        • variables
          • environmentVariablesProvider.ts
      • interpreter
        • activation
          • service.ts
          • types.ts
        • autoSelection/rules
          • system.ts
        • contracts.ts
        • helpers.ts
        • interpreterService.ts
        • locators
          • progressService.ts
          • services
            • cacheableLocatorService.ts
            • pipEnvService.ts
            • windowsRegistryService.ts
        • serviceRegistry.ts
        • virtualEnvs
          • index.ts
      • telemetry
        • constants.ts
        • index.ts
        • types.ts
      • unittests/common
        • runner.ts
    • test
      • common
        • installer.test.ts
        • moduleInstaller.test.ts
        • process
          • execFactory.test.ts
          • pythonExecutionFactory.unit.test.ts
          • pythonProc.simple.multiroot.test.ts
        • terminals
          • activation.conda.unit.test.ts
          • environmentActivationProviders
            • pipEnvActivationProvider.unit.test.ts
          • helper.activation.unit.test.ts
          • helper.unit.test.ts
        • utils
          • cacheUtils.unit.test.ts
          • decorators.unit.test.ts
        • variables
          • envVarsProvider.multiroot.test.ts
      • debugger
        • portAndHost.test.ts
      • format
        • extension.format.test.ts
        • extension.formatOnSave.test.ts
        • extension.sort.test.ts
      • interpreters
        • activation
          • service.unit.test.ts
        • interpreterService.unit.test.ts
        • locators
          • helpers.unit.test.ts
      • refactor
        • extension.refactor.extract.method.test.ts
        • rename.test.ts
      • serviceRegistry.ts
      • unittests
        • debugger.test.ts
        • nosetest
          • nosetest.disovery.test.ts
          • nosetest.run.test.ts
          • nosetest.test.ts
        • pytest
          • pytest.discovery.test.ts
          • pytest.run.test.ts
          • pytest.test.ts
          • pytest.testMessageService.test.ts
        • rediscover.test.ts
        • unittest
          • unittest.discovery.test.ts
          • unittest.run.test.ts
          • unittest.test.ts
      • vscode-mock.ts

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎CHANGELOG.md‎

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 numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Fixes
66

7+
78
1. Lowering threshold for Language Server support on a platform.
89
([#3693](https://github.com/Microsoft/vscode-python/issues/3693))
910
1. Fix bug affecting multiple linters used in a workspace.
Collapse file

‎gulpfile.js‎

Copy file name to clipboardExpand all lines: gulpfile.js
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,6 @@ gulp.task("compile", () => {
154154

155155

156156
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-
});
161157

162158
gulp.task('webpack', async () => {
163159
await spawnAsync('npx', ['webpack', '--mode', 'production']);
@@ -708,6 +704,7 @@ function getFilesToProcess(fileList) {
708704
* @param {hygieneOptions} options
709705
*/
710706
function getFileListToProcess(options) {
707+
return [];
711708
const mode = options ? options.mode : 'all';
712709
const gulpSrcOptions = { base: '.' };
713710

Collapse file

‎news/1 Enhancements/2855.md‎

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Activate `pipenv` environments in the shell using the command `pipenv shell`.
Collapse file

‎news/2 Fixes/3330.md‎

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Activate any selected Python Environment when running unit tests.
Collapse file

‎news/2 Fixes/3953.md‎

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove duplicates from interpreters listed in the interpreter selection list.
Collapse file

‎news/3 Code Health/3746.md‎

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Detect usage of `xonsh` shells (this does **not** add support for `xonsh` itself)
Collapse file

‎pythonFiles/printEnvVariables.py‎

Copy file name to clipboard
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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

‎src/client/common/logger.ts‎

Copy file name to clipboardExpand all lines: src/client/common/logger.ts
+18-12Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class Logger implements ILogger {
4646
}
4747
}
4848

49-
enum LogOptions {
49+
export enum LogOptions {
5050
None = 0,
5151
Arguments = 1,
5252
ReturnValue = 2
@@ -57,6 +57,9 @@ function argsToLogString(args: any[]): string {
5757
try {
5858
return (args || []).map((item, index) => {
5959
try {
60+
if (item.fsPath) {
61+
return `Arg ${index + 1}: <Uri:${item.fsPath}>`;
62+
}
6063
return `Arg ${index + 1}: ${JSON.stringify(item)}`;
6164
} catch {
6265
return `Arg ${index + 1}: UNABLE TO DETERMINE VALUE`;
@@ -69,15 +72,18 @@ function argsToLogString(args: any[]): string {
6972

7073
// tslint:disable-next-line:no-any
7174
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>`;
7986
}
80-
return returnValueMessage;
8187
}
8288

8389
export function traceVerbose(message: string) {
@@ -91,10 +97,10 @@ export function traceInfo(message: string) {
9197
}
9298

9399
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);
96102
}
97-
export function error(message: string, ex?: Error) {
103+
export function error(message: string) {
98104
return trace(message, LogOptions.Arguments | LogOptions.ReturnValue, LogLevel.Error);
99105
}
100106
export function info(message: string) {
Collapse file

‎src/client/common/platform/fileSystem.ts‎

Copy file name to clipboardExpand all lines: src/client/common/platform/fileSystem.ts
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import * as glob from 'glob';
99
import { inject, injectable } from 'inversify';
1010
import * as path from 'path';
1111
import * as tmp from 'tmp';
12-
import { traceDecorators } from '../logger';
1312
import { createDeferred } from '../utils/async';
1413
import { IFileSystem, IPlatformService, TemporaryFile } from './types';
1514

@@ -144,7 +143,6 @@ export class FileSystem implements IFileSystem {
144143
return deferred.promise;
145144
}
146145

147-
@traceDecorators.error('Failed to get FileHash')
148146
public getFileHash(filePath: string): Promise<string | undefined> {
149147
return new Promise<string | undefined>(resolve => {
150148
fs.lstat(filePath, (err, stats) => {
Collapse file

‎src/client/common/platform/platformService.ts‎

Copy file name to clipboardExpand all lines: src/client/common/platform/platformService.ts
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import * as os from 'os';
77
import { coerce, SemVer } from 'semver';
88
import { sendTelemetryEvent } from '../../telemetry';
99
import { PLATFORM_INFO, PlatformErrors } from '../../telemetry/constants';
10-
import { traceDecorators, traceError } from '../logger';
1110
import { OSType } from '../utils/platform';
1211
import { parseVersion } from '../utils/version';
1312
import { NON_WINDOWS_PATH_VARIABLE_NAME, WINDOWS_PATH_VARIABLE_NAME } from './constants';
@@ -23,7 +22,6 @@ export class PlatformService implements IPlatformService {
2322
public get virtualEnvBinName() {
2423
return this.isWindows ? 'Scripts' : 'bin';
2524
}
26-
@traceDecorators.verbose('Get Platform Version')
2725
public async getVersion(): Promise<SemVer> {
2826
if (this.version) {
2927
return this.version;
@@ -43,7 +41,6 @@ export class PlatformService implements IPlatformService {
4341
throw new Error('Unable to parse version');
4442
} catch (ex) {
4543
sendTelemetryEvent(PLATFORM_INFO, undefined, { failureType: PlatformErrors.FailedToParseVersion });
46-
traceError(`Failed to parse Version ${os.release()}`, ex);
4744
return parseVersion(os.release());
4845
}
4946
default:

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.