Skip to content

Commit 002ecbd

Browse files
Update branch for python 3.7 (#236)
* Update debugpy version (#220) * update version of debugpy * update extension version * update version * Adding note to use pre-releases for older versions (#218) * Adding note for pre-releases for older versions * Updating note * Do not create config when esc is hit (#228) * dont continue if esc is hit * fix lint * fix tests * Add auto start browser as default value (#229) * Add autoStartBrowser * fix tests * fix lint * fix tests * Update README.md (#234) * Keep tag version and debugpy version * dont update value --------- Co-authored-by: Courtney Webster <[email protected]>
1 parent 37cae2b commit 002ecbd

13 files changed

+29
-46
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,13 @@ Older versions of the Python Debugger extension are available for debugging Pyth
3939

4040
You can reference the table below to find the most recent Python Debugger extension version that offers debugging support for projects using deprecated Python versions, as well as the debugpy version that is shipped in each extension version.
4141

42+
> **Note**: If you do not see older extension versions to install (<=`2024.0.0`), try opting-in to pre-releases. You can do so on the extension page by clicking `Switch to Pre-Release Version`.
43+
4244
| Python version | Latest supported Python Debugger extension version | debugpy version |
4345
| -------------- | -------------------------------------------------- | ---------------- |
44-
| 2.7, >= 3.5 | 2023.1.XXX | 1.5.1 |
45-
| >= 3.7 | 2023.3.XXX | 1.7.0 |
46+
| 2.7, >= 3.5 | 2023.1.XXX | 1.5.1 |
47+
| >= 3.7 | 2024.0.XXX | 1.7.0 |
48+
| >= 3.8 | 2024.2.XXX | 1.8.1 |
4649

4750

4851
> **Note**: Once you install an older version of the Python Debugger extension in VS Code, you may want to disable auto update by changing the value of the `"extensions.autoUpdate"` setting in your `settings.json` file.

src/extension/debugger/configuration/providers/djangoLaunch.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export async function buildDjangoLaunchDebugConfiguration(
3131
program: program || defaultProgram,
3232
args: ['runserver'],
3333
django: true,
34+
autoStartBrowser: false,
3435
};
3536
if (!program) {
3637
const selectedProgram = await input.showInputBox({
@@ -42,6 +43,8 @@ export async function buildDjangoLaunchDebugConfiguration(
4243
if (selectedProgram) {
4344
manuallyEnteredAValue = true;
4445
config.program = selectedProgram;
46+
} else {
47+
return;
4548
}
4649
}
4750

src/extension/debugger/configuration/providers/fastapiLaunch.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ export async function buildFastAPILaunchDebugConfiguration(
4444
if (selectedPath) {
4545
manuallyEnteredAValue = true;
4646
config.args = [`${path.basename(selectedPath, '.py').replace('/', '.')}:app`, '--reload'];
47+
} else {
48+
return;
4749
}
4850
}
4951

src/extension/debugger/configuration/providers/flaskLaunch.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export async function buildFlaskLaunchDebugConfiguration(
3232
},
3333
args: ['run', '--no-debugger', '--no-reload'],
3434
jinja: true,
35+
autoStartBrowser: false,
3536
};
3637

3738
if (!application) {
@@ -49,6 +50,8 @@ export async function buildFlaskLaunchDebugConfiguration(
4950
if (selectedApp) {
5051
manuallyEnteredAValue = true;
5152
config.env!.FLASK_APP = selectedApp;
53+
} else {
54+
return;
5255
}
5356
}
5457

src/extension/debugger/configuration/providers/moduleLaunch.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ export async function buildModuleLaunchConfiguration(
3434
if (selectedModule) {
3535
manuallyEnteredAValue = true;
3636
config.module = selectedModule;
37+
} else {
38+
return;
3739
}
3840

3941
sendTelemetryEvent(EventName.DEBUGGER_CONFIGURATION_PROMPTS, undefined, {

src/extension/debugger/configuration/providers/pyramidLaunch.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ export async function buildPyramidLaunchConfiguration(
4848
if (selectedIniPath) {
4949
manuallyEnteredAValue = true;
5050
config.args = [selectedIniPath];
51+
} else {
52+
return;
5153
}
5254
}
5355

src/extension/debugger/configuration/providers/remoteAttach.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ export async function buildRemoteAttachConfiguration(
4747
value && value.trim().length > 0 ? undefined : DebugConfigStrings.attach.enterRemoteHost.invalid,
4848
),
4949
});
50+
5051
if (!connect.host) {
51-
connect.host = defaultHost;
52+
return;
5253
}
5354

5455
sendTelemetryEvent(EventName.DEBUGGER_CONFIGURATION_PROMPTS, undefined, {

src/test/unittest/configuration/providers/djangoLaunch.unit.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ suite('Debugging - Configuration Provider Django', () => {
109109
program: 'hello',
110110
args: ['runserver'],
111111
django: true,
112+
autoStartBrowser: false,
112113
};
113114

114115
expect(state.config).to.be.deep.equal(config);
@@ -119,7 +120,7 @@ suite('Debugging - Configuration Provider Django', () => {
119120
const workspaceFolderToken = '${workspaceFolder}';
120121
const defaultProgram = `${workspaceFolderToken}-manage.py`;
121122
pathSeparatorStub.value('-');
122-
when(input.showInputBox(anything())).thenResolve();
123+
when(input.showInputBox(anything())).thenResolve(defaultProgram);
123124
await djangoLaunch.buildDjangoLaunchDebugConfiguration(instance(input), state);
124125

125126
const config = {
@@ -129,6 +130,7 @@ suite('Debugging - Configuration Provider Django', () => {
129130
program: defaultProgram,
130131
args: ['runserver'],
131132
django: true,
133+
autoStartBrowser: false,
132134
};
133135

134136
expect(state.config).to.be.deep.equal(config);

src/test/unittest/configuration/providers/fastapiLaunch.unit.test.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,6 @@ suite('Debugging - Configuration Provider FastAPI', () => {
4242

4343
expect(file).to.be.equal('main.py');
4444
});
45-
test('Launch JSON with valid python path', async () => {
46-
const folder = { uri: Uri.parse(path.join('one', 'two')), name: '1', index: 0 };
47-
const state = { config: {}, folder };
48-
49-
await fastApiLaunch.buildFastAPILaunchDebugConfiguration(instance(input), state);
50-
51-
const config = {
52-
name: DebugConfigStrings.fastapi.snippet.name,
53-
type: DebuggerTypeName,
54-
request: 'launch',
55-
module: 'uvicorn',
56-
args: ['main:app', '--reload'],
57-
jinja: true,
58-
};
59-
60-
expect(state.config).to.be.deep.equal(config);
61-
});
6245
test('Launch JSON with selected app path', async () => {
6346
const folder = { uri: Uri.parse(path.join('one', 'two')), name: '1', index: 0 };
6447
const state = { config: {}, folder };

src/test/unittest/configuration/providers/flaskLaunch.unit.test.ts

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -41,27 +41,6 @@ suite('Debugging - Configuration Provider Flask', () => {
4141

4242
expect(file).to.be.equal('app.py');
4343
});
44-
test('Launch JSON with valid python path', async () => {
45-
const folder = { uri: Uri.parse(path.join('one', 'two')), name: '1', index: 0 };
46-
const state = { config: {}, folder };
47-
48-
await flaskLaunch.buildFlaskLaunchDebugConfiguration(instance(input), state);
49-
50-
const config = {
51-
name: DebugConfigStrings.flask.snippet.name,
52-
type: DebuggerTypeName,
53-
request: 'launch',
54-
module: 'flask',
55-
env: {
56-
FLASK_APP: 'app.py',
57-
FLASK_DEBUG: '1',
58-
},
59-
args: ['run', '--no-debugger', '--no-reload'],
60-
jinja: true,
61-
};
62-
63-
expect(state.config).to.be.deep.equal(config);
64-
});
6544
test('Launch JSON with selected app path', async () => {
6645
const folder = { uri: Uri.parse(path.join('one', 'two')), name: '1', index: 0 };
6746
const state = { config: {}, folder };
@@ -81,14 +60,15 @@ suite('Debugging - Configuration Provider Flask', () => {
8160
},
8261
args: ['run', '--no-debugger', '--no-reload'],
8362
jinja: true,
63+
autoStartBrowser: false,
8464
};
8565

8666
expect(state.config).to.be.deep.equal(config);
8767
});
8868
test('Launch JSON with default managepy path', async () => {
8969
const folder = { uri: Uri.parse(path.join('one', 'two')), name: '1', index: 0 };
9070
const state = { config: {}, folder };
91-
when(input.showInputBox(anything())).thenResolve();
71+
when(input.showInputBox(anything())).thenResolve('app.py');
9272

9373
await flaskLaunch.buildFlaskLaunchDebugConfiguration(instance(input), state);
9474

@@ -103,6 +83,7 @@ suite('Debugging - Configuration Provider Flask', () => {
10383
},
10484
args: ['run', '--no-debugger', '--no-reload'],
10585
jinja: true,
86+
autoStartBrowser: false,
10687
};
10788

10889
expect(state.config).to.be.deep.equal(config);

src/test/unittest/configuration/providers/moduleLaunch.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ suite('Debugging - Configuration Provider Module', () => {
1919
const state = { config: {}, folder };
2020
const input = mock<MultiStepInput<DebugConfigurationState>>(MultiStepInput);
2121

22-
when(input.showInputBox(anything())).thenResolve();
22+
when(input.showInputBox(anything())).thenResolve('enter-your-module-name');
2323

2424
await buildModuleLaunchConfiguration(instance(input), state);
2525

src/test/unittest/configuration/providers/pyramidLaunch.unit.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ suite('Debugging - Configuration Provider Pyramid', () => {
9999
const folder = { uri: Uri.parse(path.join('one', 'two')), name: '1', index: 0 };
100100
const state = { config: {}, folder };
101101
pathSeparatorStub.value('-');
102+
when(input.showInputBox(anything())).thenResolve('${workspaceFolder}-development.ini');
102103

103104
await pyramidLaunch.buildPyramidLaunchConfiguration(instance(input), state);
104105

@@ -141,7 +142,7 @@ suite('Debugging - Configuration Provider Pyramid', () => {
141142
const defaultIni = `${workspaceFolderToken}-development.ini`;
142143

143144
pathSeparatorStub.value('-');
144-
when(input.showInputBox(anything())).thenResolve();
145+
when(input.showInputBox(anything())).thenResolve(defaultIni);
145146

146147
await pyramidLaunch.buildPyramidLaunchConfiguration(instance(input), state);
147148

src/test/unittest/configuration/providers/remoteAttach.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ suite('Debugging - Configuration Provider Remote Attach', () => {
6262
const folder = { uri: Uri.parse(path.join('one', 'two')), name: '1', index: 0 };
6363
const state = { config: {}, folder };
6464
let portConfigured = false;
65-
when(input.showInputBox(anything())).thenResolve();
65+
when(input.showInputBox(anything())).thenResolve('localhost');
6666

6767
sinon.stub(configuration, 'configurePort').callsFake(async () => {
6868
portConfigured = true;

0 commit comments

Comments
 (0)