Skip to content

Commit 81d4f08

Browse files
authored
Merge branch 'main' into dependabot/github_actions/dot-github/actions/build-vsix/actions/upload-artifact-5
2 parents d7fdb0c + 0f5e167 commit 81d4f08

File tree

15 files changed

+134
-114
lines changed

15 files changed

+134
-114
lines changed

.github/workflows/pr-file-check.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,3 @@ jobs:
4242
.github/test_plan.md
4343
skip-label: 'skip tests'
4444
failure-message: 'TypeScript code was edited without also editing a ${file-pattern} file; see the Testing page in our wiki on testing guidelines (the ${skip-label} label can be used to pass this check)'
45-
46-
- name: 'Ensure PR has an associated issue'
47-
uses: actions/github-script@v8
48-
with:
49-
script: |
50-
const labels = context.payload.pull_request.labels.map(label => label.name);
51-
if (!labels.includes('skip-issue-check')) {
52-
const prBody = context.payload.pull_request.body || '';
53-
const issueLink = prBody.match(/https:\/\/github\.com\/\S+\/issues\/\d+/);
54-
const issueReference = prBody.match(/#\d+/);
55-
if (!issueLink && !issueReference) {
56-
core.setFailed('No associated issue found in the PR description.');
57-
}
58-
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: PR issue check
2+
3+
on:
4+
pull_request:
5+
types:
6+
- 'opened'
7+
- 'reopened'
8+
- 'synchronize'
9+
- 'labeled'
10+
- 'unlabeled'
11+
12+
permissions: {}
13+
14+
jobs:
15+
check-for-attached-issue:
16+
name: 'Check for attached issue'
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: 'Ensure PR has an associated issue'
20+
uses: actions/github-script@v8
21+
with:
22+
script: |
23+
const labels = context.payload.pull_request.labels.map(label => label.name);
24+
if (!labels.includes('skip-issue-check')) {
25+
const prBody = context.payload.pull_request.body || '';
26+
const issueLink = prBody.match(/https:\/\/github\.com\/\S+\/issues\/\d+/);
27+
const issueReference = prBody.match(/#\d+/);
28+
if (!issueLink && !issueReference) {
29+
core.setFailed('No associated issue found in the PR description.');
30+
}
31+
}

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ To see all available Python commands, open the Command Palette and type `Python`
9090

9191
Learn more about the rich features of the Python extension:
9292

93-
- [IntelliSense](https://code.visualstudio.com/docs/python/editing#_autocomplete-and-intellisense): Edit your code with auto-completion, code navigation, syntax checking and more
94-
- [Linting](https://code.visualstudio.com/docs/python/linting): Get additional code analysis with Pylint, Flake8 and more
95-
- [Code formatting](https://code.visualstudio.com/docs/python/formatting): Format your code with black, autopep or yapf
96-
- [Debugging](https://code.visualstudio.com/docs/python/debugging): Debug your Python scripts, web apps, remote or multi-threaded processes
93+
- [IntelliSense](https://code.visualstudio.com/docs/python/editing#_autocomplete-and-intellisense): Edit your code with auto-completion, code navigation, syntax checking and more.
94+
- [Linting](https://code.visualstudio.com/docs/python/linting): Get additional code analysis with Pylint, Flake8 and more.
95+
- [Code formatting](https://code.visualstudio.com/docs/python/formatting): Format your code with black, autopep or yapf.
96+
- [Debugging](https://code.visualstudio.com/docs/python/debugging): Debug your Python scripts, web apps, remote or multi-threaded processes.
9797
- [Testing](https://code.visualstudio.com/docs/python/unit-testing): Run and debug tests through the Test Explorer with unittest or pytest.
98-
- [Jupyter Notebooks](https://code.visualstudio.com/docs/python/jupyter-support): Create and edit Jupyter Notebooks, add and run code cells, render plots, visualize variables through the variable explorer, visualize dataframes with the data viewer, and more
99-
- [Environments](https://code.visualstudio.com/docs/python/environments): Automatically activate and switch between virtualenv, venv, pipenv, conda and pyenv environments
98+
- [Jupyter Notebooks](https://code.visualstudio.com/docs/python/jupyter-support): Create and edit Jupyter Notebooks, add and run code cells, render plots, visualize variables through the variable explorer, visualize dataframes with the data viewer, and more.
99+
- [Environments](https://code.visualstudio.com/docs/python/environments): Automatically activate and switch between virtualenv, venv, pipenv, conda and pyenv environments.
100100
- [Refactoring](https://code.visualstudio.com/docs/python/editing#_refactoring): Restructure your Python code with variable extraction and method extraction. Additionally, there is componentized support to enable additional refactoring, such as import sorting, through extensions including [isort](https://marketplace.visualstudio.com/items?itemName=ms-python.isort) and [Ruff](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff).
101101

102102

python_files/pythonrc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ def __str__(self):
5252
result = ""
5353
# For non-windows allow recent_command history.
5454
if sys.platform != "win32":
55-
result = "{command_executed}{command_line}{command_finished}{prompt_started}{prompt}{command_start}".format(
55+
result = "{soh}{command_executed}{command_line}{command_finished}{prompt_started}{stx}{prompt}{soh}{command_start}{stx}".format(
56+
soh="\001",
57+
stx="\002",
5658
command_executed="\x1b]633;C\x07",
5759
command_line="\x1b]633;E;" + str(get_last_command()) + "\x07",
5860
command_finished="\x1b]633;D;" + str(exit_code) + "\x07",

python_files/tests/test_shell_integration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_decoration_success():
1717
if sys.platform != "win32" and (not is_wsl):
1818
assert (
1919
result
20-
== "\x1b]633;C\x07\x1b]633;E;None\x07\x1b]633;D;0\x07\x1b]633;A\x07>>> \x1b]633;B\x07"
20+
== "\x01\x1b]633;C\x07\x1b]633;E;None\x07\x1b]633;D;0\x07\x1b]633;A\x07\x02>>> \x01\x1b]633;B\x07\x02"
2121
)
2222
else:
2323
pass
@@ -32,7 +32,7 @@ def test_decoration_failure():
3232
if sys.platform != "win32" and (not is_wsl):
3333
assert (
3434
result
35-
== "\x1b]633;C\x07\x1b]633;E;None\x07\x1b]633;D;1\x07\x1b]633;A\x07>>> \x1b]633;B\x07"
35+
== "\x01\x1b]633;C\x07\x1b]633;E;None\x07\x1b]633;D;1\x07\x1b]633;A\x07\x02>>> \x01\x1b]633;B\x07\x02"
3636
)
3737
else:
3838
pass

python_files/vscode_pytest/run_pytest_script.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,22 @@ def run_pytest(args):
5151

5252
run_test_ids_pipe = os.environ.get("RUN_TEST_IDS_PIPE")
5353
if run_test_ids_pipe:
54+
ids_path = pathlib.Path(run_test_ids_pipe)
5455
try:
55-
# Read the test ids from the file, delete file, and run pytest.
56-
ids_path = pathlib.Path(run_test_ids_pipe)
56+
# Read the test ids from the file and run pytest.
5757
ids = ids_path.read_text(encoding="utf-8").splitlines()
58-
try:
59-
ids_path.unlink()
60-
except Exception as e:
61-
print("Error[vscode-pytest]: unable to delete temp file" + str(e))
6258
arg_array = ["-p", "vscode_pytest", *args, *ids]
6359
print("Running pytest with args: " + str(arg_array))
6460
pytest.main(arg_array)
6561
except Exception as e:
6662
print("Error[vscode-pytest]: unable to read testIds from temp file" + str(e))
6763
run_pytest(args)
64+
finally:
65+
# Delete the test ids temp file.
66+
try:
67+
ids_path.unlink()
68+
except Exception as e:
69+
print("Error[vscode-pytest]: unable to delete temp file" + str(e))
6870
else:
6971
print("Error[vscode-pytest]: RUN_TEST_IDS_PIPE env var is not set.")
7072
run_pytest(args)

src/client/pythonEnvironments/base/locators/common/nativePythonUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export enum NativePythonEnvironmentKind {
2323
VirtualEnvWrapper = 'VirtualEnvWrapper',
2424
WindowsStore = 'WindowsStore',
2525
WindowsRegistry = 'WindowsRegistry',
26-
VenvUv = 'VenvUv',
26+
VenvUv = 'Uv',
2727
}
2828

2929
const mapping = new Map<NativePythonEnvironmentKind, PythonEnvKind>([

src/client/testing/testController/common/types.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,26 +155,22 @@ export interface ITestResultResolver {
155155
_resolveCoverage(payload: CoveragePayload, runInstance: TestRun): void;
156156
}
157157
export interface ITestDiscoveryAdapter {
158-
// ** first line old method signature, second line new method signature
159-
discoverTests(uri: Uri): Promise<void>;
160158
discoverTests(
161159
uri: Uri,
162-
executionFactory?: IPythonExecutionFactory,
160+
executionFactory: IPythonExecutionFactory,
163161
token?: CancellationToken,
164162
interpreter?: PythonEnvironment,
165163
): Promise<void>;
166164
}
167165

168166
// interface for execution/runner adapter
169167
export interface ITestExecutionAdapter {
170-
// ** first line old method signature, second line new method signature
171-
runTests(uri: Uri, testIds: string[], profileKind?: boolean | TestRunProfileKind): Promise<void>;
172168
runTests(
173169
uri: Uri,
174170
testIds: string[],
175-
profileKind?: boolean | TestRunProfileKind,
176-
runInstance?: TestRun,
177-
executionFactory?: IPythonExecutionFactory,
171+
profileKind: boolean | TestRunProfileKind | undefined,
172+
runInstance: TestRun,
173+
executionFactory: IPythonExecutionFactory,
178174
debugLauncher?: ITestDebugLauncher,
179175
interpreter?: PythonEnvironment,
180176
): Promise<void>;

src/client/testing/testController/controller.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ export class PythonTestController implements ITestController, IExtensionSingleAc
276276
}
277277
await testAdapter.discoverTests(
278278
this.testController,
279-
this.refreshCancellation.token,
280279
this.pythonExecFactory,
280+
this.refreshCancellation.token,
281281
await this.interpreterService.getActiveInterpreter(workspace.uri),
282282
);
283283
} else {
@@ -302,8 +302,8 @@ export class PythonTestController implements ITestController, IExtensionSingleAc
302302
}
303303
await testAdapter.discoverTests(
304304
this.testController,
305-
this.refreshCancellation.token,
306305
this.pythonExecFactory,
306+
this.refreshCancellation.token,
307307
await this.interpreterService.getActiveInterpreter(workspace.uri),
308308
);
309309
} else {
@@ -453,9 +453,9 @@ export class PythonTestController implements ITestController, IExtensionSingleAc
453453
this.testController,
454454
runInstance,
455455
testItems,
456+
this.pythonExecFactory,
456457
token,
457458
request.profile?.kind,
458-
this.pythonExecFactory,
459459
this.debugLauncher,
460460
await this.interpreterService.getActiveInterpreter(workspace.uri),
461461
);
@@ -470,9 +470,9 @@ export class PythonTestController implements ITestController, IExtensionSingleAc
470470
this.testController,
471471
runInstance,
472472
testItems,
473+
this.pythonExecFactory,
473474
token,
474475
request.profile?.kind,
475-
this.pythonExecFactory,
476476
this.debugLauncher,
477477
await this.interpreterService.getActiveInterpreter(workspace.uri),
478478
);

src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class PytestTestDiscoveryAdapter implements ITestDiscoveryAdapter {
3838

3939
async discoverTests(
4040
uri: Uri,
41-
executionFactory?: IPythonExecutionFactory,
41+
executionFactory: IPythonExecutionFactory,
4242
token?: CancellationToken,
4343
interpreter?: PythonEnvironment,
4444
): Promise<void> {
@@ -69,7 +69,7 @@ export class PytestTestDiscoveryAdapter implements ITestDiscoveryAdapter {
6969
uri: Uri,
7070
discoveryPipeName: string,
7171
cSource: CancellationTokenSource,
72-
executionFactory?: IPythonExecutionFactory,
72+
executionFactory: IPythonExecutionFactory,
7373
interpreter?: PythonEnvironment,
7474
token?: CancellationToken,
7575
): Promise<void> {
@@ -170,7 +170,7 @@ export class PytestTestDiscoveryAdapter implements ITestDiscoveryAdapter {
170170
resource: uri,
171171
interpreter,
172172
};
173-
const execService = await executionFactory?.createActivatedEnvironment(creationOptions);
173+
const execService = await executionFactory.createActivatedEnvironment(creationOptions);
174174

175175
const execInfo = await execService?.getExecutablePath();
176176
traceVerbose(`Executable path for pytest discovery: ${execInfo}.`);

0 commit comments

Comments
 (0)