Skip to content

Commit 4b02c62

Browse files
authored
bump node version and python api (#781)
* bump node version and python api * update to remove deps greater than in python ext * update deps * add install for envs ext * activate envs ext * add logging * . * .. * fix dir * cleanup logging
1 parent b748cb8 commit 4b02c62

File tree

9 files changed

+229
-158
lines changed

9 files changed

+229
-158
lines changed

.github/workflows/pr-check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ on:
66
permissions: {}
77

88
env:
9-
NODE_VERSION: 18.17.1
9+
NODE_VERSION: 22.17.0
1010
TEST_RESULTS_DIRECTORY: .
1111
# Force a path with spaces and unicode chars to test extension works in these scenarios
12-
special-working-directory: './🐍 🐛'
13-
special-working-directory-relative: '🐍 🐛'
12+
special-working-directory: './testDir'
13+
special-working-directory-relative: 'testDir'
1414

1515
jobs:
1616
build-vsix:

.github/workflows/push-check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ on:
1111
permissions: {}
1212

1313
env:
14-
NODE_VERSION: 18.17.1
14+
NODE_VERSION: 22.17.0
1515
TEST_RESULTS_DIRECTORY: .
1616
# Force a path with spaces and unicode chars to test extension works in these scenarios
17-
special-working-directory: './🐍 🐛'
18-
special-working-directory-relative: '🐍 🐛'
17+
special-working-directory: './testDir'
18+
special-working-directory-relative: 'testDir'
1919

2020
jobs:
2121
build-vsix:

build/azure-pipeline.pre-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ extends:
5858
buildSteps:
5959
- task: NodeTool@0
6060
inputs:
61-
versionSpec: '18.17.1'
61+
versionSpec: '22.17.0'
6262
displayName: Select Node version
6363

6464
- task: UsePythonVersion@0

build/azure-pipeline.stable.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ extends:
5353
buildSteps:
5454
- task: NodeTool@0
5555
inputs:
56-
versionSpec: '18.17.1'
56+
versionSpec: '22.17.0'
5757
displayName: Select Node version
5858

5959
- task: UsePythonVersion@0

package-lock.json

Lines changed: 166 additions & 125 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -612,14 +612,14 @@
612612
"vsce-package": "npx @vscode/vsce package -o python-debugger.vsix"
613613
},
614614
"devDependencies": {
615-
"@types/chai": "^4.3.4",
616-
"@types/chai-as-promised": "^7.1.8",
615+
"@types/chai": "^4.1.2",
616+
"@types/chai-as-promised": "^7.1.0",
617617
"@types/fs-extra": "^11.0.4",
618618
"@types/glob": "^7.2.0",
619-
"@types/lodash": "^4.14.191",
620-
"@types/mocha": "^10.0.7",
621-
"@types/node": "18.x",
622-
"@types/semver": "^7.3.13",
619+
"@types/lodash": "^4.14.104",
620+
"@types/mocha": "^9.1.0",
621+
"@types/node": "^22.5.0",
622+
"@types/semver": "^5.5.0",
623623
"@types/sinon": "^10.0.13",
624624
"@types/vscode": "^1.87.0",
625625
"@typescript-eslint/eslint-plugin": "^5.62.0",
@@ -638,17 +638,17 @@
638638
"ts-mockito": "^2.6.1",
639639
"typemoq": "^2.1.0",
640640
"typescript": "^5.5.4",
641-
"webpack": "^5.87.0",
642-
"webpack-cli": "^5.1.4"
641+
"webpack": "^5.76.0",
642+
"webpack-cli": "^4.9.2"
643643
},
644644
"dependencies": {
645645
"@vscode/debugadapter": "^1.65.0",
646646
"@vscode/debugprotocol": "^1.65.0",
647-
"@vscode/extension-telemetry": "^0.8.5",
648-
"@vscode/python-extension": "^1.0.5",
647+
"@vscode/extension-telemetry": "^0.8.4",
648+
"@vscode/python-extension": "^1.0.6",
649649
"fs-extra": "^11.2.0",
650650
"iconv-lite": "^0.6.3",
651-
"jsonc-parser": "^3.2.0",
651+
"jsonc-parser": "^3.0.0",
652652
"lodash": "^4.17.21",
653653
"vscode-languageclient": "^8.0.2"
654654
}

src/extension/common/python.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ async function activateExtension() {
3939
console.log('Python extension activated.');
4040
return extension;
4141
}
42-
4342
async function activateEnvsExtension() {
4443
const extension = extensions.getExtension('ms-python.vscode-python-envs');
4544
if (extension) {

src/test/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ function isMultiRootTest() {
3333
export const EXTENSION_ROOT_DIR_FOR_TESTS = path.join(__dirname, '..', '..');
3434
export const PVSC_EXTENSION_ID_FOR_TESTS = 'ms-python.python';
3535

36+
export const PVSC_ENVS_EXTENSION_ID_FOR_TESTS = 'ms-python.vscode-python-envs';
37+
3638
export const SMOKE_TEST_EXTENSIONS_DIR = path.join(
3739
EXTENSION_ROOT_DIR_FOR_TESTS,
3840
'tmp',

src/test/runTest.ts

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import * as cp from 'child_process';
22
import * as path from 'path';
33

44
import { downloadAndUnzipVSCode, resolveCliArgsFromVSCodeExecutablePath, runTests } from '@vscode/test-electron';
5-
import { PVSC_EXTENSION_ID_FOR_TESTS } from './constants';
6-
import { OSType, getOSType } from '../extension/common/platform';
5+
import { PVSC_ENVS_EXTENSION_ID_FOR_TESTS, PVSC_EXTENSION_ID_FOR_TESTS } from './constants';
76

87
async function main() {
98
try {
@@ -18,19 +17,49 @@ async function main() {
1817
const [cliPath, ...args] = resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath);
1918

2019
// Use cp.spawn / cp.exec for custom setup
21-
if (getOSType() === OSType.Windows) {
22-
const exec = path.basename(cliPath);
23-
cp.spawnSync(exec, [...args, '--install-extension', PVSC_EXTENSION_ID_FOR_TESTS], {
24-
cwd: path.dirname(cliPath),
25-
encoding: 'utf-8',
26-
stdio: 'inherit',
27-
});
20+
const isWin = process.platform === 'win32';
21+
if (isWin) {
22+
try {
23+
const installResult = cp.spawnSync(
24+
cliPath,
25+
[...args, '--install-extension', PVSC_EXTENSION_ID_FOR_TESTS, PVSC_ENVS_EXTENSION_ID_FOR_TESTS],
26+
{
27+
cwd: path.dirname(cliPath),
28+
encoding: 'utf8',
29+
stdio: 'inherit',
30+
shell: true,
31+
},
32+
);
33+
if (installResult.error) {
34+
console.error('Extension installation error:', installResult.error);
35+
}
36+
if (installResult.status !== 0) {
37+
console.error(`Extension installation failed with exit code: ${installResult.status}`);
38+
} else {
39+
console.log('Extension installation succeeded.');
40+
}
41+
} catch (ex) {
42+
console.error('Exception during extension installation:', ex);
43+
}
2844
} else {
29-
cp.spawnSync(cliPath, [...args, '--install-extension', PVSC_EXTENSION_ID_FOR_TESTS], {
30-
encoding: 'utf-8',
31-
stdio: 'inherit',
32-
});
45+
const installResult = cp.spawnSync(
46+
cliPath,
47+
[...args, '--install-extension', PVSC_EXTENSION_ID_FOR_TESTS, PVSC_ENVS_EXTENSION_ID_FOR_TESTS],
48+
{
49+
encoding: 'utf8',
50+
stdio: 'inherit',
51+
},
52+
);
53+
if (installResult.error) {
54+
console.error('Extension installation error:', installResult.error);
55+
}
56+
if (installResult.status !== 0) {
57+
console.error(`Extension installation failed with exit code: ${installResult.status}`);
58+
} else {
59+
console.log('Extension installation succeeded.');
60+
}
3361
}
62+
console.log('Extensions installed, ready to run tests.');
3463

3564
// Run the extension test
3665
await runTests({

0 commit comments

Comments
 (0)