Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into merge/1.93.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcphers committed Sep 18, 2024
2 parents 6dd17a6 + 6af852f commit f6437f1
Show file tree
Hide file tree
Showing 25 changed files with 710 additions and 97 deletions.
27 changes: 17 additions & 10 deletions .github/workflows/positron-full-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permissions:
jobs:
linux:
name: Tests on Linux
runs-on: ubuntu-latest
runs-on: ubuntu-latest-4x
timeout-minutes: 60
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -111,8 +111,8 @@ jobs:
# Perform the main yarn command; this installs all Node packages and
# dependencies
yarn --immutable --network-timeout 120000
yarn --cwd test/automation add install --frozen-lockfile
yarn --cwd test/smoke add install --frozen-lockfile
yarn --cwd test/automation install --frozen-lockfile
yarn --cwd test/smoke install --frozen-lockfile
# Note cache-hit will be set to true only when cache hit occurs for the exact key match.
# For a partial key match it will be set to false
Expand Down Expand Up @@ -231,10 +231,17 @@ jobs:
name: run-artifacts
path: .build/logs/smoke-tests-electron/

- name: slack-smoke-test-report
if: failure()
uses: testlabauto/[email protected]
env:
SLACK_CHANNEL: C07FR1JNZNJ #positron-test-results channel
SLACK_TOKEN: ${{ secrets.SMOKE_TESTS_SLACK_TOKEN }}
XUNIT_PATH: .build/logs/smoke-tests-electron/test-results/results.xml
slack-notification:
name: 'Send Slack notification'
runs-on: ubuntu-latest
needs: linux
if: ${{ failure() }}
steps:
- name: 'Send Slack notification'
uses: automattic/[email protected]
with:
github_token: ${{ secrets.POSITRON_GITHUB_PAT }}
slack_token: ${{ secrets.SMOKE_TESTS_SLACK_TOKEN }}
slack_channel: C07FR1JNZNJ #positron-test-results channel
suite_name: Positron Full Test Suite

30 changes: 20 additions & 10 deletions .github/workflows/positron-merge-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ permissions:
jobs:
linux:
name: Tests on Linux
runs-on: ubuntu-latest
runs-on: ubuntu-latest-4x
timeout-minutes: 45
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -103,8 +103,8 @@ jobs:
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
POSITRON_GITHUB_PAT: ${{ github.token }}
run: |
# Install Yarn
npm install -g yarn
# Enable corepack (for yarn)
corepack enable
# Install node-gyp; this is required by some packages, and yarn
# sometimes fails to automatically install it.
Expand All @@ -116,6 +116,7 @@ jobs:
yarn --cwd test/automation install --frozen-lockfile
yarn --cwd test/smoke install --frozen-lockfile
# Note cache-hit will be set to true only when cache hit occurs for the exact key match.
# For a partial key match it will be set to false
- name: Cache root node_modules
Expand Down Expand Up @@ -207,11 +208,20 @@ jobs:
with:
name: run-artifacts
path: .build/logs/smoke-tests-electron/
outputs:
target: ${{ env.SMOKETEST_TARGET }}

slack-notification:
name: 'Send Slack notification'
runs-on: ubuntu-latest
needs: linux
if: ${{ failure() && needs.linux.outputs.target == 'smoketest-merge-to-main' }}
steps:
- name: 'Send Slack notification'
uses: automattic/[email protected]
with:
github_token: ${{ secrets.POSITRON_GITHUB_PAT }}
slack_token: ${{ secrets.SMOKE_TESTS_SLACK_TOKEN }}
slack_channel: C07FR1JNZNJ #positron-test-results channel
suite_name: Positron Merge to Main Test Suite

- name: slack-smoke-test-report
if: ${{ failure() && env.SMOKETEST_TARGET == 'smoketest-merge-to-main' }}
uses: testlabauto/[email protected]
env:
SLACK_CHANNEL: C07FR1JNZNJ #positron-test-results channel
SLACK_TOKEN: ${{ secrets.SMOKE_TESTS_SLACK_TOKEN }}
XUNIT_PATH: .build/logs/smoke-tests-electron/test-results/results.xml
96 changes: 90 additions & 6 deletions extensions/positron-python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,48 @@
"icon": "$(play)",
"title": "%python.command.python.execInTerminalIcon.title%"
},
{
"category": "Python",
"command": "python.execDashInTerminal",
"icon": "$(play)",
"title": "%python.command.python.execDashInTerminal.title%",
"enablement": "pythonAppFramework == dash && config.python.enableWebAppSupport"
},
{
"category": "Python",
"command": "python.execFastAPIInTerminal",
"icon": "$(play)",
"title": "%python.command.python.execFastAPIInTerminal.title%",
"enablement": "pythonAppFramework == fastapi && config.python.enableWebAppSupport"
},
{
"category": "Python",
"command": "python.execFlaskInTerminal",
"icon": "$(play)",
"title": "%python.command.python.execFlaskInTerminal.title%",
"enablement": "pythonAppFramework == flask && config.python.enableWebAppSupport"
},
{
"category": "Python",
"command": "python.execGradioInTerminal",
"icon": "$(play)",
"title": "%python.command.python.execGradioInTerminal.title%",
"enablement": "pythonAppFramework == gradio && config.python.enableWebAppSupport"
},
{
"category": "Python",
"command": "python.execShinyInTerminal",
"icon": "$(play)",
"title": "%python.command.python.execShinyInTerminal.title%",
"enablement": "pythonAppFramework == shiny && config.python.enableWebAppSupport"
},
{
"category": "Python",
"command": "python.execStreamlitInTerminal",
"icon": "$(play)",
"title": "%python.command.python.execStreamlitInTerminal.title%",
"enablement": "pythonAppFramework == streamlit && config.python.enableWebAppSupport"
},
{
"category": "Python",
"command": "python.execInConsole",
Expand Down Expand Up @@ -440,6 +482,12 @@
"scope": "application",
"type": "boolean"
},
"python.enableWebAppSupport": {
"defaut": false,
"description": "%python.enableWebAppSupport.description%",
"scope": "application",
"type": "boolean"
},
"python.envFile": {
"default": "${workspaceFolder}/.env",
"description": "%python.envFile.description%",
Expand Down Expand Up @@ -1474,23 +1522,59 @@
],
"editor/title/run": [
{
"command": "python.execSelectionInConsole",
"command": "python.execInConsole",
"group": "navigation@0",
"title": "%python.command.python.execSelectionInConsole.title%",
"title": "%python.command.python.execInConsole.title%",
"when": "resourceLangId == python && !isInDiffEditor && !virtualWorkspace && shellExecutionSupported"
},
{
"command": "python.execInConsole",
"command": "python.execDashInTerminal",
"group": "navigation@1",
"title": "%python.command.python.execInConsole.title%",
"when": "resourceLangId == python && !isInDiffEditor && !virtualWorkspace && shellExecutionSupported"
"title": "%python.command.python.execDashInTerminal.title%",
"when": "pythonAppFramework == dash && config.python.enableWebAppSupport"
},
{
"command": "python.execGradioInTerminal",
"group": "navigation@1",
"title": "%python.command.python.execGradioInTerminal.title%",
"when": "pythonAppFramework == gradio && config.python.enableWebAppSupport"
},
{
"command": "python.execFastAPIInTerminal",
"group": "navigation@1",
"title": "%python.command.python.execFastAPIInTerminal.title%",
"when": "pythonAppFramework == fastapi && config.python.enableWebAppSupport"
},
{
"command": "python.execFlaskInTerminal",
"group": "navigation@1",
"title": "%python.command.python.execFlaskInTerminal.title%",
"when": "pythonAppFramework == flask && config.python.enableWebAppSupport"
},
{
"command": "python.execShinyInTerminal",
"group": "navigation@1",
"title": "%python.command.python.execShinyInTerminal.title%",
"when": "pythonAppFramework == shiny && config.python.enableWebAppSupport"
},
{
"command": "python.execStreamlitInTerminal",
"group": "navigation@1",
"title": "%python.command.python.execStreamlitInTerminal.title%",
"when": "pythonAppFramework == streamlit && config.python.enableWebAppSupport"
},
{
"command": "python.execInTerminal-icon",
"group": "navigation@2",
"group": "navigation@1",
"title": "%python.command.python.execInTerminalIcon.title%",
"when": "resourceLangId == python && !isInDiffEditor && !virtualWorkspace && shellExecutionSupported"
},
{
"command": "python.execSelectionInConsole",
"group": "navigation@2",
"title": "%python.command.python.execSelectionInConsole.title%",
"when": "resourceLangId == python && !isInDiffEditor && !virtualWorkspace && shellExecutionSupported"
},
{
"command": "python.debugInTerminal",
"group": "navigation@3",
Expand Down
7 changes: 7 additions & 0 deletions extensions/positron-python/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"python.command.python.createNewFile.title": "New Python File",
"python.command.python.createTerminal.title": "Create Terminal",
"python.command.python.execInTerminal.title": "Run Python File in Terminal",
"python.command.python.execDashInTerminal.title": "Run Dash App in Terminal",
"python.command.python.execFastAPIInTerminal.title": "Run FastAPI in Terminal",
"python.command.python.execFlaskInTerminal.title": "Run Flask App in Terminal",
"python.command.python.execGradioInTerminal.title": "Run Gradio App in Terminal",
"python.command.python.execShinyInTerminal.title": "Run Shiny App in Terminal",
"python.command.python.execStreamlitInTerminal.title": "Run Streamlit App in Terminal",
"python.command.python.execInConsole.title": "Run Python File in Console",
"python.command.python.debugInTerminal.title": "Debug Python File in Terminal",
"python.command.python.execInTerminalIcon.title": "Run Python File in Terminal",
Expand Down Expand Up @@ -38,6 +44,7 @@
"python.debugger.deprecatedMessage": "This configuration will be deprecated soon. Please replace `python` with `debugpy` to use the new Python Debugger extension.",
"python.defaultInterpreterPath.description": "Path to default Python to use when extension loads up for the first time, no longer used once an interpreter is selected for the workspace. See [here](https://aka.ms/AAfekmf) to understand when this is used",
"python.diagnostics.sourceMapsEnabled.description": "Enable source map support for meaningful stack traces in error logs.",
"python.enableWebAppSupport.description": "Enable experimental support for Python applications",
"python.envFile.description": "Absolute path to a file containing environment variable definitions.",
"python.experiments.enabled.description": "Enables A/B tests experiments in the Python extension. If enabled, you may get included in proposed enhancements and/or features.",
"python.experiments.optInto.description": "List of experiment to opt into. If empty, user is assigned the default experiment groups. See [here](https://github.com/microsoft/vscode-python/wiki/AB-Experiments) for more details.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ export interface ICommandNameArgumentTypeMapping extends ICommandNameWithoutArgu
[Commands.Exec_In_Terminal_Icon]: [undefined, Uri];
[Commands.Debug_In_Terminal]: [Uri];
// --- Start Positron ---
[Commands.Exec_Dash_In_Terminal]: [undefined, Uri];
[Commands.Exec_FastAPI_In_Terminal]: [undefined, Uri];
[Commands.Exec_Flask_In_Terminal]: [undefined, Uri];
[Commands.Exec_Gradio_In_Terminal]: [undefined, Uri];
[Commands.Exec_Shiny_In_Terminal]: [undefined, Uri];
[Commands.Exec_Streamlit_In_Terminal]: [undefined, Uri];
[Commands.Exec_In_Console]: [];
[Commands.Focus_Positron_Console]: [];
// --- End Positron ---
Expand Down
6 changes: 6 additions & 0 deletions extensions/positron-python/src/client/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ export namespace Commands {
export const Exec_In_Terminal_Icon = 'python.execInTerminal-icon';
export const Exec_In_Separate_Terminal = 'python.execInDedicatedTerminal';
// --- Start Positron ---
export const Exec_Dash_In_Terminal = 'python.execDashInTerminal';
export const Exec_FastAPI_In_Terminal = 'python.execFastAPIInTerminal';
export const Exec_Flask_In_Terminal = 'python.execFlaskInTerminal';
export const Exec_Gradio_In_Terminal = 'python.execGradioInTerminal';
export const Exec_Shiny_In_Terminal = 'python.execShinyInTerminal';
export const Exec_Streamlit_In_Terminal = 'python.execStreamlitInTerminal';
export const Exec_In_Console = 'python.execInConsole';
export const Exec_Selection_In_Console = 'python.execSelectionInConsole';
// --- End Positron ---
Expand Down
2 changes: 1 addition & 1 deletion extensions/positron-python/src/client/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export async function activate(context: IExtensionContext): Promise<PythonExtens

// --- Start Positron ---

activatePositron(serviceContainer)
activatePositron(serviceContainer, context)
// Run in the background.
.ignoreErrors();

Expand Down
10 changes: 9 additions & 1 deletion extensions/positron-python/src/client/positron/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ import { EnvironmentType } from '../pythonEnvironments/info';
import { isProblematicCondaEnvironment } from '../interpreter/configuration/environmentTypeComparer';
import { Interpreters } from '../common/utils/localize';
import { IApplicationShell } from '../common/application/types';
import { activateAppDetection } from './webAppContexts';

export async function activatePositron(serviceContainer: IServiceContainer): Promise<void> {
export async function activatePositron(
serviceContainer: IServiceContainer,
context: vscode.ExtensionContext,
): Promise<void> {
try {
const disposables = serviceContainer.get<IDisposableRegistry>(IDisposableRegistry);
// Register a command to check if ipykernel is installed for a given interpreter.
Expand Down Expand Up @@ -71,6 +75,10 @@ export async function activatePositron(serviceContainer: IServiceContainer): Pro
disposables.push(
vscode.commands.registerCommand('python.getMinimumPythonVersion', (): string => MINIMUM_PYTHON_VERSION.raw),
);

// Activate detection for web applications
activateAppDetection(context.subscriptions);

traceInfo('activatePositron: done!');
} catch (ex) {
traceError('activatePositron() failed.', ex);
Expand Down
Loading

0 comments on commit f6437f1

Please sign in to comment.