diff --git a/.github/actions/build-vsix/action.yml b/.github/actions/build-vsix/action.yml index 787bb999022e..ece1a773a12b 100644 --- a/.github/actions/build-vsix/action.yml +++ b/.github/actions/build-vsix/action.yml @@ -30,5 +30,8 @@ runs: - run: npm run updateBuildNumber -- --buildNumber $GITHUB_RUN_ID shell: bash + - run: npm run addExtensionDependencies + shell: bash + - run: npm run package shell: bash diff --git a/.github/workflows/insiders.yml b/.github/workflows/insiders.yml index e12277b56122..96042cf2a7ac 100644 --- a/.github/workflows/insiders.yml +++ b/.github/workflows/insiders.yml @@ -6,6 +6,7 @@ on: - main env: + NODE_VERSION: 12.15.0 PYTHON_VERSION: 3.9 MOCHA_REPORTER_JUNIT: true # Use the mocha-multi-reporters and send output to both console (spec) and JUnit (mocha-junit-reporter). Also enables a reporter which exits the process running the tests if it haven't already. # Key for the cache created at the end of the the 'Cache ./pythonFiles/lib/python' step. @@ -25,6 +26,11 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: Use Node ${{env.NODE_VERSION}} + uses: actions/setup-node@v2.1.2 + with: + node-version: ${{env.NODE_VERSION}} + - name: Use Python ${{env.PYTHON_VERSION}} uses: actions/setup-python@v2 with: @@ -55,6 +61,11 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: Use Node ${{env.NODE_VERSION}} + uses: actions/setup-node@v2.1.2 + with: + node-version: ${{env.NODE_VERSION}} + - name: Install dependencies (npm ci) run: npm ci --prefer-offline @@ -118,6 +129,11 @@ jobs: with: path: ${{env.special-working-directory-relative}} + - name: Use Node ${{env.NODE_VERSION}} + uses: actions/setup-node@v2.1.2 + with: + node-version: ${{env.NODE_VERSION}} + - name: Install dependencies (npm ci) run: npm ci @@ -319,6 +335,11 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: Use Node ${{env.NODE_VERSION}} + uses: actions/setup-node@v2.1.2 + with: + node-version: ${{env.NODE_VERSION}} + - name: Use Python ${{matrix.python}} uses: actions/setup-python@v2 with: @@ -390,6 +411,11 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: Use Node ${{env.NODE_VERSION}} + uses: actions/setup-node@v2.1.2 + with: + node-version: ${{env.NODE_VERSION}} + - name: Use Python ${{matrix.python}} uses: actions/setup-python@v2 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef610b330d21..0835cde9d789 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,6 +9,7 @@ on: env: PYTHON_VERSION: 3.8 + NODE_VERSION: 12.15.0 MOCHA_REPORTER_JUNIT: false # Use the mocha-multi-reporters and send output to both console (spec) and JUnit (mocha-junit-reporter). Also enables a reporter which exits the process running the tests if it hasn't already. # Key for the cache created at the end of the the 'Cache ./pythonFiles/lib/python' step. CACHE_PYTHONFILES: cache-pvsc-pythonFiles @@ -27,6 +28,11 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: Use Node ${{env.NODE_VERSION}} + uses: actions/setup-node@v2.1.2 + with: + node-version: ${{env.NODE_VERSION}} + - name: Use Python ${{env.PYTHON_VERSION}} uses: actions/setup-python@v2 with: @@ -59,6 +65,11 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: Use Node ${{env.NODE_VERSION}} + uses: actions/setup-node@v2.1.2 + with: + node-version: ${{env.NODE_VERSION}} + - name: Install dependencies (npm ci) run: npm ci --prefer-offline @@ -105,6 +116,11 @@ jobs: with: path: ${{env.special-working-directory-relative}} + - name: Use Node ${{env.NODE_VERSION}} + uses: actions/setup-node@v2.1.2 + with: + node-version: ${{env.NODE_VERSION}} + - name: Install dependencies (npm ci) run: npm ci @@ -296,6 +312,11 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: Use Node ${{env.NODE_VERSION}} + uses: actions/setup-node@v2.1.2 + with: + node-version: ${{env.NODE_VERSION}} + - name: Use Python ${{matrix.python}} uses: actions/setup-python@v2 with: @@ -367,6 +388,11 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: Use Node ${{env.NODE_VERSION}} + uses: actions/setup-node@v2.1.2 + with: + node-version: ${{env.NODE_VERSION}} + - name: Use Python ${{matrix.python}} uses: actions/setup-python@v2 with: diff --git a/news/1 Enhancements/14614.md b/news/1 Enhancements/14614.md new file mode 100644 index 000000000000..c17ca45c8ebb --- /dev/null +++ b/news/1 Enhancements/14614.md @@ -0,0 +1 @@ +Update shipped debugger wheels to python 3.8. diff --git a/pythonFiles/install_debugpy.py b/pythonFiles/install_debugpy.py index cb21efd91927..e9361a6aeb3e 100644 --- a/pythonFiles/install_debugpy.py +++ b/pythonFiles/install_debugpy.py @@ -9,7 +9,7 @@ EXTENSION_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) DEBUGGER_DEST = os.path.join(EXTENSION_ROOT, "pythonFiles", "lib", "python") DEBUGGER_PACKAGE = "debugpy" -DEBUGGER_PYTHON_VERSIONS = ("cp37",) +DEBUGGER_PYTHON_VERSIONS = ("cp38",) def _contains(s, parts=()): diff --git a/src/client/activation/languageClientMiddleware.ts b/src/client/activation/languageClientMiddleware.ts index 961e5191372f..48b903c5106f 100644 --- a/src/client/activation/languageClientMiddleware.ts +++ b/src/client/activation/languageClientMiddleware.ts @@ -39,8 +39,8 @@ import { IFileSystem } from '../common/platform/types'; import { IConfigurationService, IDisposableRegistry, IExperimentsManager, IExtensions } from '../common/types'; import { isThenable } from '../common/utils/async'; import { StopWatch } from '../common/utils/stopWatch'; -import { NotebookMiddlewareAddon } from '../datascience/languageserver/notebookMiddlewareAddon'; import { IServiceContainer } from '../ioc/types'; +import { NotebookMiddlewareAddon } from '../jupyter/languageserver/notebookMiddlewareAddon'; import { sendTelemetryEvent } from '../telemetry'; import { EventName } from '../telemetry/constants'; import { LanguageServerType } from './types'; diff --git a/src/client/api.ts b/src/client/api.ts index fa625c453e09..b2e059a69bf1 100644 --- a/src/client/api.ts +++ b/src/client/api.ts @@ -8,11 +8,11 @@ import { Event, Uri } from 'vscode'; import { isTestExecution } from './common/constants'; import { traceError } from './common/logger'; import { IConfigurationService, Resource } from './common/types'; -import { IDataViewerDataProvider, IJupyterUriProvider } from './datascience/types'; import { getDebugpyLauncherArgs, getDebugpyPackagePath } from './debugger/extension/adapter/remoteLaunchers'; import { IInterpreterService } from './interpreter/contracts'; import { IServiceContainer, IServiceManager } from './ioc/types'; import { JupyterExtensionIntegration } from './jupyter/jupyterIntegration'; +import { IDataViewerDataProvider, IJupyterUriProvider } from './jupyter/types'; /* * Do not introduce any breaking changes to this API. diff --git a/src/client/datascience/api/jupyterIntegration.ts b/src/client/datascience/api/jupyterIntegration.ts deleted file mode 100644 index 98c154fe1706..000000000000 --- a/src/client/datascience/api/jupyterIntegration.ts +++ /dev/null @@ -1,142 +0,0 @@ -// tslint:disable-next-line: no-single-line-block-comment -/* eslint-disable comma-dangle */ -// tslint:disable-next-line: no-single-line-block-comment -/* eslint-disable implicit-arrow-linebreak */ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -import { inject, injectable } from 'inversify'; -import { dirname } from 'path'; -import { CancellationToken, Disposable, Event, Uri } from 'vscode'; -import * as lsp from 'vscode-languageserver-protocol'; -import { ILanguageServerCache, ILanguageServerConnection } from '../../activation/types'; -import { InterpreterUri } from '../../common/installer/types'; -import { IExtensions, IInstaller, InstallerResponse, Product, Resource } from '../../common/types'; -import { isResource } from '../../common/utils/misc'; -import { getDebugpyPackagePath } from '../../debugger/extension/adapter/remoteLaunchers'; -import { IEnvironmentActivationService } from '../../interpreter/activation/types'; -import { IInterpreterQuickPickItem, IInterpreterSelector } from '../../interpreter/configuration/types'; -import { IInterpreterService } from '../../interpreter/contracts'; -import { IWindowsStoreInterpreter } from '../../interpreter/locators/types'; -import { WindowsStoreInterpreter } from '../../pythonEnvironments/discovery/locators/services/windowsStoreInterpreter'; -import { PythonEnvironment } from '../../pythonEnvironments/info'; - -export interface ILanguageServer extends Disposable { - readonly connection: ILanguageServerConnection; - readonly capabilities: lsp.ServerCapabilities; -} - -type PythonApiForJupyterExtension = { - /** - * IInterpreterService - */ - onDidChangeInterpreter: Event; - /** - * IInterpreterService - */ - getInterpreters(resource?: Uri): Promise; - /** - * IInterpreterService - */ - getActiveInterpreter(resource?: Uri): Promise; - /** - * IInterpreterService - */ - getInterpreterDetails(pythonPath: string, resource?: Uri): Promise; - - /** - * IEnvironmentActivationService - */ - getActivatedEnvironmentVariables( - resource: Resource, - interpreter?: PythonEnvironment, - allowExceptions?: boolean - ): Promise; - isWindowsStoreInterpreter(pythonPath: string): Promise; - /** - * IWindowsStoreInterpreter - */ - getSuggestions(resource: Resource): Promise; - /** - * IInstaller - */ - install(product: Product, resource?: InterpreterUri, cancel?: CancellationToken): Promise; - /** - * Returns path to where `debugpy` is. In python extension this is `/pythonFiles/lib/python`. - */ - getDebuggerPath(): Promise; - /** - * Returns a ILanguageServer that can be used for communicating with a language server process. - * @param resource file that determines which connection to return - */ - getLanguageServer(resource?: InterpreterUri): Promise; -}; - -export type JupyterExtensionApi = { - registerPythonApi(interpreterService: PythonApiForJupyterExtension): void; -}; - -@injectable() -export class JupyterExtensionIntegration { - constructor( - @inject(IExtensions) private readonly extensions: IExtensions, - @inject(IInterpreterService) private readonly interpreterService: IInterpreterService, - @inject(IInterpreterSelector) private readonly interpreterSelector: IInterpreterSelector, - @inject(WindowsStoreInterpreter) private readonly windowsStoreInterpreter: IWindowsStoreInterpreter, - @inject(IInstaller) private readonly installer: IInstaller, - @inject(IEnvironmentActivationService) private readonly envActivation: IEnvironmentActivationService, - @inject(ILanguageServerCache) private readonly languageServerCache: ILanguageServerCache - ) {} - - public registerApi(jupyterExtensionApi: JupyterExtensionApi) { - jupyterExtensionApi.registerPythonApi({ - onDidChangeInterpreter: this.interpreterService.onDidChangeInterpreter, - getActiveInterpreter: async (resource?: Uri) => this.interpreterService.getActiveInterpreter(resource), - getInterpreterDetails: async (pythonPath: string) => - this.interpreterService.getInterpreterDetails(pythonPath), - getInterpreters: async (resource: Uri | undefined) => this.interpreterService.getInterpreters(resource), - getActivatedEnvironmentVariables: async ( - resource: Resource, - interpreter?: PythonEnvironment, - allowExceptions?: boolean - ) => this.envActivation.getActivatedEnvironmentVariables(resource, interpreter, allowExceptions), - isWindowsStoreInterpreter: async (pythonPath: string): Promise => - this.windowsStoreInterpreter.isWindowsStoreInterpreter(pythonPath), - getSuggestions: async (resource: Resource): Promise => - this.interpreterSelector.getSuggestions(resource), - install: async ( - product: Product, - resource?: InterpreterUri, - cancel?: CancellationToken - ): Promise => this.installer.install(product, resource, cancel), - getDebuggerPath: async () => dirname(getDebugpyPackagePath()), - getLanguageServer: async (r) => { - const resource = isResource(r) ? r : undefined; - const interpreter = !isResource(r) ? r : undefined; - const client = await this.languageServerCache.get(resource, interpreter); - - // Some langauge servers don't support the connection yet. (like Jedi until we switch to LSP) - if (client && client.connection && client.capabilities) { - return { - connection: client.connection, - capabilities: client.capabilities, - dispose: client.dispose - }; - } - return undefined; - } - }); - } - - public async integrateWithJupyterExtension(): Promise { - const jupyterExtension = this.extensions.getExtension('ms-ai-tools.jupyter'); - if (!jupyterExtension) { - return; - } - await jupyterExtension.activate(); - if (!jupyterExtension.isActive) { - return; - } - this.registerApi(jupyterExtension.exports); - } -} diff --git a/src/client/jupyter/jupyterIntegration.ts b/src/client/jupyter/jupyterIntegration.ts index bb0764bd59cc..5281d07ff64c 100644 --- a/src/client/jupyter/jupyterIntegration.ts +++ b/src/client/jupyter/jupyterIntegration.ts @@ -22,7 +22,6 @@ import { Resource } from '../common/types'; import { isResource } from '../common/utils/misc'; -import { IDataViewerDataProvider, IJupyterUriProvider } from '../datascience/types'; import { getDebugpyPackagePath } from '../debugger/extension/adapter/remoteLaunchers'; import { IEnvironmentActivationService } from '../interpreter/activation/types'; import { IInterpreterQuickPickItem, IInterpreterSelector } from '../interpreter/configuration/types'; @@ -30,6 +29,7 @@ import { IInterpreterService } from '../interpreter/contracts'; import { IWindowsStoreInterpreter } from '../interpreter/locators/types'; import { WindowsStoreInterpreter } from '../pythonEnvironments/discovery/locators/services/windowsStoreInterpreter'; import { PythonEnvironment } from '../pythonEnvironments/info'; +import { IDataViewerDataProvider, IJupyterUriProvider } from './types'; export interface ILanguageServer extends Disposable { readonly connection: ILanguageServerConnection; diff --git a/src/client/datascience/languageserver/notebookConcatDocument.ts b/src/client/jupyter/languageserver/notebookConcatDocument.ts similarity index 100% rename from src/client/datascience/languageserver/notebookConcatDocument.ts rename to src/client/jupyter/languageserver/notebookConcatDocument.ts diff --git a/src/client/datascience/languageserver/notebookConverter.ts b/src/client/jupyter/languageserver/notebookConverter.ts similarity index 100% rename from src/client/datascience/languageserver/notebookConverter.ts rename to src/client/jupyter/languageserver/notebookConverter.ts diff --git a/src/client/datascience/languageserver/notebookMiddlewareAddon.ts b/src/client/jupyter/languageserver/notebookMiddlewareAddon.ts similarity index 100% rename from src/client/datascience/languageserver/notebookMiddlewareAddon.ts rename to src/client/jupyter/languageserver/notebookMiddlewareAddon.ts diff --git a/src/client/datascience/types.ts b/src/client/jupyter/types.ts similarity index 100% rename from src/client/datascience/types.ts rename to src/client/jupyter/types.ts diff --git a/src/test/datascience/mockJupyterExtensionIntegration.ts b/src/test/datascience/mockJupyterExtensionIntegration.ts deleted file mode 100644 index 047bba26c0d0..000000000000 --- a/src/test/datascience/mockJupyterExtensionIntegration.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { ILanguageServerCache } from '../../client/activation/types'; -import { IExtensions, IInstaller } from '../../client/common/types'; -import { JupyterExtensionIntegration } from '../../client/datascience/api/jupyterIntegration'; -import { IEnvironmentActivationService } from '../../client/interpreter/activation/types'; -import { IInterpreterSelector } from '../../client/interpreter/configuration/types'; -import { IInterpreterService } from '../../client/interpreter/contracts'; -import { IWindowsStoreInterpreter } from '../../client/interpreter/locators/types'; - -export class MockJupyterExtensionIntegration extends JupyterExtensionIntegration { - constructor( - extensions: IExtensions, - interpreterService: IInterpreterService, - interpreterSelector: IInterpreterSelector, - windowsStoreInterpreter: IWindowsStoreInterpreter, - installer: IInstaller, - envActivation: IEnvironmentActivationService, - languageServerCache: ILanguageServerCache - ) { - super( - extensions, - interpreterService, - interpreterSelector, - windowsStoreInterpreter, - installer, - envActivation, - languageServerCache - ); - } -}