Skip to content

Commit

Permalink
Merge branch 'main' into fix-uuid-and-disposing
Browse files Browse the repository at this point in the history
  • Loading branch information
eleanorjboyd authored Jul 31, 2023
2 parents f4db306 + ceecdb0 commit 6c9abd7
Show file tree
Hide file tree
Showing 35 changed files with 1,082 additions and 445 deletions.
32 changes: 12 additions & 20 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
# This image will serve as a starting point for devcontainer.json.
# Get latest image of Fedora as the base image.
FROM docker.io/library/fedora:latest
FROM mcr.microsoft.com/devcontainers/typescript-node:16-bookworm

# Install supported python versions and nodejs.
RUN dnf -y --nodocs install /usr/bin/{python3.7,python3.8,python3.9,python3.10,python3.11,git,conda,clang} && \
dnf clean all
RUN apt-get install -y wget bzip2

ENV NVM_VERSION=0.39.3
ENV NODE_VERSION=16.17.1
ENV NPM_VERSION=8.19.3

# Installation instructions from https://github.com/nvm-sh/nvm .
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v$NVM_VERSION/install.sh | bash
RUN export NVM_DIR="$HOME/.nvm" && \
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" && \
nvm install $NODE_VERSION && \
npm install -g npm@$NPM_VERSION

# For clean open source builds.
ENV DISABLE_TRANSLATIONS=true
# Run in silent mode and save downloaded script as anaconda.sh.
# Run with /bin/bash and run in silent mode to /opt/conda.
# Also get rid of installation script after finishing.
RUN wget --quiet https://repo.anaconda.com/archive/Anaconda3-2023.07-1-Linux-x86_64.sh -O ~/anaconda.sh && \
/bin/bash ~/anaconda.sh -b -p /opt/conda && \
rm ~/anaconda.sh

ENV PATH="/opt/conda/bin:$PATH"

# Sudo apt update needs to run in order for installation of fish to work .
RUN sudo apt update && \
sudo apt install fish -y


3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
},
// Commands to execute on container creation,start.
"postCreateCommand": "bash scripts/postCreateCommand.sh",
// Environment variable placed inside containerEnv following: https://containers.dev/implementors/json_reference/#general-properties
"onCreateCommand": "bash scripts/onCreateCommand.sh",

"containerEnv": {
"CI_PYTHON_PATH": "/workspaces/vscode-python/.venv/bin/python"
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
env:
# To update the list of labels, see `getLabels.js`.
REPO_LABELS: '["area-api","area-data science","area-debugging","area-diagnostics","area-editor-*","area-environments","area-formatting","area-intellisense","area-internal","area-linting","area-terminal","area-testing","author-verification-requested","bug","community ask","debt","dependencies","documentation","experimenting","feature-request","good first issue","help wanted","important","info-needed","invalid-testplan-item","investigating","iteration-candidate","iteration-plan","iteration-plan-draft","javascript","linux","macos","meta","needs community feedback","needs PR","needs proposal","needs spike","no-changelog","on-testplan","partner ask","regression","release-plan","reports-wanted","skip package*.json","skip tests","tensorboard","testplan-item","triage-needed","verification-found","verification-needed","verification-steps-needed","verified","windows"]'
TRIAGERS: '["karrtikr","karthiknadig","paulacamargo25","eleanorjboyd"]'
TRIAGERS: '["karrtikr","karthiknadig","paulacamargo25","eleanorjboyd","anthonykim1"]'

permissions:
issues: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/triage-info-needed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [created]

env:
TRIAGERS: '["karrtikr","karthiknadig","paulacamargo25","eleanorjboyd", "brettcannon"]'
TRIAGERS: '["karrtikr","karthiknadig","paulacamargo25","eleanorjboyd", "brettcannon","anthonykim1"]'

jobs:
add_label:
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "python",
"displayName": "Python",
"description": "IntelliSense (Pylance), Linting, Debugging (multi-threaded, remote), Jupyter Notebooks, code formatting, refactoring, unit tests, and more.",
"description": "IntelliSense (Pylance), Linting, Debugging (multi-threaded, remote), code formatting, refactoring, unit tests, and more.",
"version": "2023.13.0-dev",
"featureFlags": {
"usingNewInterpreterStorage": true
Expand Down Expand Up @@ -62,8 +62,7 @@
"Formatters",
"Other",
"Data Science",
"Machine Learning",
"Notebooks"
"Machine Learning"
],
"activationEvents": [
"onDebugInitialConfigurations",
Expand Down
17 changes: 10 additions & 7 deletions pythonExtensionApi/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions pythonExtensionApi/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@vscode/python-extension",
"description": "An API facade for the Python extension in VS Code",
"version": "1.0.1",
"version": "1.0.2",
"author": {
"name": "Microsoft Corporation"
},
Expand All @@ -17,19 +17,20 @@
"vscode": "^1.78.0"
},
"license": "MIT",
"homepage": "https://github.com/Microsoft/vscode-python",
"homepage": "https://github.com/microsoft/vscode-python/tree/main/pythonExtensionApi",
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/vscode-python"
},
"bugs": {
"url": "https://github.com/Microsoft/vscode-python/issues"
},
"dependencies": {
"peerDependencies": {
"@types/vscode": "^1.78.0"
},
"devDependencies": {
"typescript": "5.0.4"
"typescript": "5.0.4",
"@types/vscode": "^1.78.0"
},
"scripts": {
"prepublishOnly": "echo \"⛔ Can only publish from a secure pipeline ⛔\" && node ../build/fail",
Expand Down
70 changes: 4 additions & 66 deletions pythonExtensionApi/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import { CancellationToken, Event, Uri, WorkspaceFolder, QuickPickItem, extensions } from 'vscode';
import { CancellationToken, Event, Uri, WorkspaceFolder, extensions } from 'vscode';

/*
* Do not introduce any breaking changes to this API.
Expand All @@ -10,21 +10,16 @@ import { CancellationToken, Event, Uri, WorkspaceFolder, QuickPickItem, extensio
export interface PythonExtension {
/**
* Promise indicating whether all parts of the extension have completed loading or not.
* @type {Promise<void>}
*/
ready: Promise<void>;
jupyter: {
registerHooks(): void;
};
debug: {
/**
* Generate an array of strings for commands to pass to the Python executable to launch the debugger for remote debugging.
* Users can append another array of strings of what they want to execute along with relevant arguments to Python.
* E.g `['/Users/..../pythonVSCode/pythonFiles/lib/python/debugpy', '--listen', 'localhost:57039', '--wait-for-client']`
* @param {string} host
* @param {number} port
* @param {boolean} [waitUntilDebuggerAttaches=true]
* @returns {Promise<string[]>}
* @param host
* @param port
* @param waitUntilDebuggerAttaches Defaults to `true`.
*/
getRemoteLauncherCommand(host: string, port: number, waitUntilDebuggerAttaches: boolean): Promise<string[]>;

Expand All @@ -35,20 +30,6 @@ export interface PythonExtension {
getDebuggerPackagePath(): Promise<string | undefined>;
};

datascience: {
/**
* Launches Data Viewer component.
* @param {IDataViewerDataProvider} dataProvider Instance that will be used by the Data Viewer component to fetch data.
* @param {string} title Data Viewer title
*/
showDataViewer(dataProvider: IDataViewerDataProvider, title: string): Promise<void>;
/**
* Registers a remote server provider component that's used to pick remote jupyter server URIs
* @param serverProvider object called back when picking jupyter server URI
*/
registerRemoteServerProvider(serverProvider: IJupyterUriProvider): void;
};

/**
* These APIs provide a way for extensions to work with by python environments available in the user's machine
* as found by the Python extension. See
Expand Down Expand Up @@ -125,47 +106,6 @@ export interface PythonExtension {
};
}

interface IJupyterServerUri {
baseUrl: string;
token: string;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
authorizationHeader: any; // JSON object for authorization header.
expiration?: Date; // Date/time when header expires and should be refreshed.
displayName: string;
}

type JupyterServerUriHandle = string;

export interface IJupyterUriProvider {
readonly id: string; // Should be a unique string (like a guid)
getQuickPickEntryItems(): QuickPickItem[];
handleQuickPick(item: QuickPickItem, backEnabled: boolean): Promise<JupyterServerUriHandle | 'back' | undefined>;
getServerUri(handle: JupyterServerUriHandle): Promise<IJupyterServerUri>;
}

interface IDataFrameInfo {
columns?: { key: string; type: ColumnType }[];
indexColumn?: string;
rowCount?: number;
}

export interface IDataViewerDataProvider {
dispose(): void;
getDataFrameInfo(): Promise<IDataFrameInfo>;
getAllRows(): Promise<IRowsResponse>;
getRows(start: number, end: number): Promise<IRowsResponse>;
}

enum ColumnType {
String = 'string',
Number = 'number',
Bool = 'bool',
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
type IRowsResponse = any[];

export type RefreshOptions = {
/**
* When `true`, force trigger a refresh regardless of whether a refresh was already triggered. Note this can be expensive so
Expand Down Expand Up @@ -316,7 +256,6 @@ export type EnvironmentPath = {
* was contributed.
*/
export type EnvironmentTools = KnownEnvironmentTools | string;

/**
* Tools or plugins the Python extension currently has built-in support for. Note this list is expected to shrink
* once tools have their own separate extensions.
Expand All @@ -335,7 +274,6 @@ export type KnownEnvironmentTools =
* Type of the environment. It can be {@link KnownEnvironmentTypes} or custom string which was contributed.
*/
export type EnvironmentType = KnownEnvironmentTypes | string;

/**
* Environment types the Python extension is aware of. Note this list is expected to shrink once tools have their
* own separate extensions, in which case they're expected to provide the type themselves.
Expand Down
Empty file.
6 changes: 6 additions & 0 deletions pythonFiles/tests/pytestadapter/.data/root/tests/test_a.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.


def test_a_function(): # test_marker--test_a_function
assert True
6 changes: 6 additions & 0 deletions pythonFiles/tests/pytestadapter/.data/root/tests/test_b.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.


def test_b_function(): # test_marker--test_b_function
assert True
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

import unittest
from unittest import SkipTest

# Due to the skip at the file level, no tests will be discovered.
raise SkipTest("Skip all tests in this file, they should not be recognized by pytest.")


class SimpleTest(unittest.TestCase):
def testadd1(self):
assert True
Loading

0 comments on commit 6c9abd7

Please sign in to comment.