Skip to content

Commit 4c04379

Browse files
committed
Merge remote-tracking branch 'origin/main' into aus/command
2 parents d8c46fe + 2640cb9 commit 4c04379

43 files changed

Lines changed: 1656 additions & 238 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/positron-python-ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,11 @@ jobs:
167167
run: uv pip install -r build/test-requirements.txt
168168

169169
- name: Run Python unit tests
170-
run: uv run python_files/tests/run_all.py
170+
# `--active` targets the setup-uv activated environment. As of uv 0.12.0,
171+
# `uv run <script>` discovers the project relative to the script path, so
172+
# this would otherwise pick python_files/.venv (which lacks pytest) instead
173+
# of the active venv where dependencies were installed. See astral-sh/uv#20225.
174+
run: uv run --active python_files/tests/run_all.py
171175

172176
positron-ipykernel-tests:
173177
name: Test Positron IPyKernel

.github/workflows/positron-python-nightly.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ jobs:
7373
run: uv pip install -r build/test-requirements.txt
7474

7575
- name: Run Python unit tests
76-
run: uv run python_files/tests/run_all.py --junit-xml=python-unit-test-results.xml
76+
# `--active` targets the setup-uv activated environment. As of uv 0.12.0,
77+
# `uv run <script>` discovers the project relative to the script path, so
78+
# this would otherwise pick python_files/.venv (which lacks pytest) instead
79+
# of the active venv where dependencies were installed. See astral-sh/uv#20225.
80+
run: uv run --active python_files/tests/run_all.py --junit-xml=python-unit-test-results.xml
7781

7882
- name: Upload test artifacts
7983
uses: actions/upload-artifact@v7

.github/workflows/test-tag-paths-map.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,19 @@
121121
"src/vs/editor/contrib/positronEditorActions/": ["@:editor-action-bar"],
122122
"src/vs/editor/contrib/positronHelp/": ["@:help"],
123123
"src/vs/editor/contrib/positronStatementRange/": [],
124+
"src/vs/platform/extensionManagement/": [],
125+
"src/vs/platform/extensionManagement/common/positronGalleryTelemetry.ts": ["@:extensions"],
126+
"src/vs/platform/extensionManagement/node/positronBootstrapExtensionsInitializer.ts": ["@:extensions"],
127+
"src/vs/platform/extensions/": [],
128+
"src/vs/platform/extensions/common/positronExtensionValidator.ts": ["@:extensions"],
124129
"src/vs/platform/positronActionBar/": [],
125130
"src/vs/platform/positronAiProvider/": ["@:assistant"],
126131
"src/vs/platform/positronHeadlessLanguageModel/": ["@:positron-notebooks"],
127132
"src/vs/platform/positronIdleTracking/": [],
128133
"src/vs/platform/positronMemoryUsage/": ["@:variables"],
129134
"src/vs/platform/update/": [],
135+
"src/vs/workbench/browser/actions/": [],
136+
"src/vs/workbench/browser/actions/positronActions.ts": ["@:new-folder-flow"],
130137
"src/vs/workbench/browser/parts/editor/editorActionBar": ["@:editor-action-bar"],
131138
"src/vs/workbench/browser/parts/positronTopActionBar/": ["@:top-action-bar"],
132139
"src/vs/workbench/browser/positronAnsiRenderer/": ["@:console"],
@@ -138,5 +145,19 @@
138145
"src/vs/workbench/browser/positronList/": ["@:packages-pane"],
139146
"src/vs/workbench/browser/positronTree/": ["@:connections"],
140147
"src/vs/workbench/browser/positronViewPane/": [],
141-
"src/vs/workbench/common/positron/": []
148+
"src/vs/workbench/common/positron/": [],
149+
"src/vs/workbench/contrib/extensions/": [],
150+
"src/vs/workbench/contrib/extensions/browser/positronCompatibleVersion.ts": ["@:extensions"],
151+
"src/vs/workbench/contrib/extensions/common/positronCustomGalleryProbe.ts": ["@:extensions"],
152+
"src/vs/workbench/contrib/extensions/electron-browser/positronCustomGalleryValidation.ts": ["@:extensions"],
153+
"src/vs/workbench/contrib/inlineChat/": [],
154+
"src/vs/workbench/contrib/inlineChat/browser/positronNotebookUtils.ts": ["@:positron-notebooks", "@:assistant"],
155+
"src/vs/workbench/contrib/preferences/": [],
156+
"src/vs/workbench/contrib/preferences/common/positronSettingBadges.ts": ["@:vscode-settings"],
157+
"src/vs/workbench/contrib/welcomeGettingStarted/": [],
158+
"src/vs/workbench/contrib/welcomeGettingStarted/browser/media/positronGettingStarted.css": ["@:welcome"],
159+
"src/vs/workbench/contrib/welcomeGettingStarted/browser/positronWelcome": ["@:welcome"],
160+
"src/vs/workbench/contrib/welcomeGettingStarted/common/gettingStartedPositronNotebookContent.ts": ["@:welcome"],
161+
"src/vs/workbench/services/themes/": [],
162+
"src/vs/workbench/services/themes/browser/positronColorThemeFilter.ts": []
142163
}

extensions/positron-python/python_files/posit/positron/tests/conftest.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# Licensed under the Elastic License 2.0. See LICENSE.txt for license information.
44
#
55

6-
from http.server import HTTPServer
76
from typing import Iterable
87
from unittest.mock import MagicMock, Mock
98

@@ -165,27 +164,6 @@ def mock_help_service(shell: PositronShell, monkeypatch: pytest.MonkeyPatch) ->
165164
return mock
166165

167166

168-
@pytest.fixture
169-
def mock_displayhook(shell: PositronShell, monkeypatch: pytest.MonkeyPatch) -> Mock:
170-
mock = Mock()
171-
monkeypatch.setattr(shell, "displayhook", mock)
172-
return mock
173-
174-
175-
@pytest.fixture
176-
def mock_display_pub(shell: PositronShell, monkeypatch: pytest.MonkeyPatch) -> Mock:
177-
mock = Mock()
178-
monkeypatch.setattr(shell, "display_pub", mock)
179-
return mock
180-
181-
182-
@pytest.fixture
183-
def mock_handle_request(monkeypatch: pytest.MonkeyPatch) -> Mock:
184-
mock = Mock()
185-
monkeypatch.setattr(HTTPServer, "handle_request", mock)
186-
return mock
187-
188-
189167
@pytest.fixture
190168
def variables_service(kernel: PositronIPyKernel) -> VariablesService:
191169
"""The Positron variables service."""

extensions/positron-python/python_files/posit/positron/tests/test_patch/test_bokeh.py

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
# Licensed under the Elastic License 2.0. See LICENSE.txt for license information.
44
#
55

6-
from unittest.mock import Mock
7-
86
import pytest
7+
from IPython.utils.capture import capture_output
98

109
from positron.positron_ipkernel import PositronShell
1110

@@ -15,31 +14,29 @@
1514

1615

1716
@pytest.mark.usefixtures("enable_bokeh_output_notebook")
18-
def test_bokeh_mime_tagging(shell: PositronShell, mock_display_pub: Mock):
17+
def test_bokeh_mime_tagging(shell: PositronShell):
1918
"""
2019
Test mime tagging.
2120
2221
Test to make sure that the send message function in bokeh is patched to append a mime-type
2322
on messages that the front-end will use to know that the data coming over should be replayed in
2423
multiple steps.
2524
"""
26-
shell.run_cell(
27-
"""\
28-
from bokeh.plotting import figure, show
29-
p = figure(title="Simple line example", x_axis_label='x', y_axis_label='y')
30-
p.line([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], legend_label="Temp.", line_width=2)
31-
show(p)
32-
"""
33-
)
34-
35-
calls = mock_display_pub.publish.call_args_list
25+
with capture_output() as captured:
26+
shell.run_cell(
27+
"""\
28+
from bokeh.plotting import figure, show
29+
p = figure(title="Simple line example", x_axis_label='x', y_axis_label='y')
30+
p.line([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], legend_label="Temp.", line_width=2)
31+
show(p)
32+
"""
33+
)
3634

3735
# Assert that one of the calls has the MIME_TYPE_POSITRON_WEBVIEW_FLAG key in it along with a
3836
# text/html key
3937
assert any(
40-
MIME_TYPE_POSITRON_WEBVIEW_FLAG in call.kwargs["data"]
41-
and "text/html" in call.kwargs["data"]
42-
for call in calls
38+
MIME_TYPE_POSITRON_WEBVIEW_FLAG in output.data and "text/html" in output.data
39+
for output in captured.outputs
4340
)
4441

4542

0 commit comments

Comments
 (0)