Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
Merging upstream vscode-python from 2023-02-03 commit fe4c5f1e4ae069160514495a717ff46f4cd11a61

--------------------
Commit message for microsoft/vscode-python@fe4c5f1:

Add a button in prompt to check logs in case the selected interpreter is invalid (microsoft/vscode-python#20642)


--------------------
Commit message for microsoft/vscode-python@1538833:

Allow to select a Python2.7 interpreter (microsoft/vscode-python#20639)


--------------------
Commit message for microsoft/vscode-python@9271136:

Move `replaceAll` and `splitLines` out of string extensions. (microsoft/vscode-python#20626)

For microsoft/vscode-python#18871
--------------------
Commit message for microsoft/vscode-python@e743037:

Ensure editable install only when [build-system] is present `pyproject.toml` (microsoft/vscode-python#20625)

Fixes microsoft/vscode-python#20620
--------------------
Commit message for microsoft/vscode-python@b43bc25:

Do not recommend Python2 as an interpreter (microsoft/vscode-python#20628)


--------------------
Commit message for microsoft/vscode-python@ddc765e:

Fix wording in conda inherit env prompt (microsoft/vscode-python#20627)

Closes microsoft/vscode-python#19001
--------------------
Commit message for microsoft/vscode-python@401418a:

Ensure IDs of Conda environments without python does not change after python is installed (microsoft/vscode-python#20609)

Fixes microsoft/vscode-python#20176

As we're changing IDs we've to ensure the same environment in cache with
older ID is migrated to use the new one, this is already ensured here:
https://github.com/microsoft/vscode-python/blob/32f55109c976e66bf39e8da6aae0c9b6f5115df2/src/client/pythonEnvironments/base/locators/composite/envsCollectionCache.ts#L109
--------------------
Commit message for microsoft/vscode-python@92d2d85:

Fix test failures due to linting (microsoft/vscode-python#20617)

Fixes microsoft/vscode-python#20612
--------------------
Commit message for microsoft/vscode-python@d245a90:

Update to latest `jedi-language-server` (microsoft/vscode-python#20611)

Fixes microsoft/vscode-python#20606
--------------------
Commit message for microsoft/vscode-python@3fe7057:

new inactive discovery logic (microsoft/vscode-python#20566)

New pytest code in a currently inactive state. 
--------------------
Commit message for microsoft/vscode-python@bf4091e:

Skip windows store interpreters found via windows registry when discovering (microsoft/vscode-python#20613)

Closes microsoft/vscode-python#20603
--------------------
Commit message for microsoft/vscode-python@ec2af99:

Use `markdownDescription` for settings with markdown in description (microsoft/vscode-python#20600)

Fixes microsoft/vscode-python#20582
--------------------
Commit message for microsoft/vscode-python@7ca872e:

Add option to skip showing recommended interpreter in quick pick API (microsoft/vscode-python#20604)

Closes microsoft/vscode-python#20260
--------------------
Commit message for microsoft/vscode-python@184617e:

Check to ensure major version matches current year. (microsoft/vscode-python#20601)

Fixes microsoft/vscode-python#20466
--------------------
Commit message for microsoft/vscode-python@328e511:

Ensure dependency quick pick is not shown when user exits env creation. (microsoft/vscode-python#20605)

Fixes microsoft/vscode-python#20602
--------------------
Commit message for microsoft/vscode-python@7fb72b7:

Update main to next pre-release (microsoft/vscode-python#20598)


--------------------
Commit message for microsoft/vscode-python@2dd9287:

Set release candidate version. (microsoft/vscode-python#20597)


--------------------
Commit message for microsoft/vscode-python@b83aacb:

Update `debugpy` to v1.6.6 (microsoft/vscode-python#20596)


--------------------
Commit message for microsoft/vscode-python@93b0053:

Skip requirement files from `site-packages` or `__pypackages__` (microsoft/vscode-python#20573)

Fixes microsoft/vscode-python#20560

Lead-authored-by: Karthik Nadig <kanadig@microsoft.com>
Co-authored-by: Eleanor Boyd <eleanorboyd@microsoft.com>
Co-authored-by: Pete Farland <pete.farland@posit.co>
Co-authored-by: Kartik Raj <karraj@microsoft.com>
  • Loading branch information
4 people committed Feb 6, 2023
1 parent 3699778 commit 50a5d67
Show file tree
Hide file tree
Showing 53 changed files with 713 additions and 395 deletions.
1 change: 0 additions & 1 deletion extensions/positron-python/.vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ out/test/**
out/testMultiRootWkspc/**
precommit.hook
pythonFiles/**/*.pyc
pythonFiles/lib/**/*.dist-info/**
pythonFiles/lib/**/*.egg-info/**
pythonFiles/lib/python/bin/**
pythonFiles/jedilsp_requirements/**
Expand Down
84 changes: 53 additions & 31 deletions extensions/positron-python/build/test_update_ext_version.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

import datetime
import json

import freezegun
import pytest
import update_ext_version

TEST_DATETIME = "2022-03-14 01:23:45"

CURRENT_YEAR = datetime.datetime.now().year
TEST_DATETIME = f"{CURRENT_YEAR}-03-14 01:23:45"

# The build ID is calculated via:
# "1" + datetime.datetime.strptime(TEST_DATETIME,"%Y-%m-%d %H:%M:%S").strftime('%j%H%M')
Expand All @@ -31,14 +34,21 @@ def run_test(tmp_path, version, args, expected):
@pytest.mark.parametrize(
"version, args",
[
("1.0.0-rc", []),
("1.1.0-rc", ["--release"]),
("1.0.0-rc", ["--release", "--build-id", "-1"]),
("1.0.0-rc", ["--release", "--for-publishing", "--build-id", "-1"]),
("1.0.0-rc", ["--release", "--for-publishing", "--build-id", "999999999999"]),
("1.1.0-rc", ["--build-id", "-1"]),
("1.1.0-rc", ["--for-publishing", "--build-id", "-1"]),
("1.1.0-rc", ["--for-publishing", "--build-id", "999999999999"]),
("2000.1.0", []), # Wrong year for CalVer
(f"{CURRENT_YEAR}.0.0-rc", []),
(f"{CURRENT_YEAR}.1.0-rc", ["--release"]),
(f"{CURRENT_YEAR}.0.0-rc", ["--release", "--build-id", "-1"]),
(
f"{CURRENT_YEAR}.0.0-rc",
["--release", "--for-publishing", "--build-id", "-1"],
),
(
f"{CURRENT_YEAR}.0.0-rc",
["--release", "--for-publishing", "--build-id", "999999999999"],
),
(f"{CURRENT_YEAR}.1.0-rc", ["--build-id", "-1"]),
(f"{CURRENT_YEAR}.1.0-rc", ["--for-publishing", "--build-id", "-1"]),
(f"{CURRENT_YEAR}.1.0-rc", ["--for-publishing", "--build-id", "999999999999"]),
],
)
def test_invalid_args(tmp_path, version, args):
Expand All @@ -49,56 +59,68 @@ def test_invalid_args(tmp_path, version, args):
@pytest.mark.parametrize(
"version, args, expected",
[
("1.1.0-rc", ["--build-id", "12345"], ("1", "1", "12345", "rc")),
("1.0.0-rc", ["--release", "--build-id", "12345"], ("1", "0", "12345", "")),
(
"1.1.0-rc",
f"{CURRENT_YEAR}.1.0-rc",
["--build-id", "12345"],
(f"{CURRENT_YEAR}", "1", "12345", "rc"),
),
(
f"{CURRENT_YEAR}.0.0-rc",
["--release", "--build-id", "12345"],
(f"{CURRENT_YEAR}", "0", "12345", ""),
),
(
f"{CURRENT_YEAR}.1.0-rc",
["--for-publishing", "--build-id", "12345"],
("1", "1", "12345", ""),
(f"{CURRENT_YEAR}", "1", "12345", ""),
),
(
"1.0.0-rc",
f"{CURRENT_YEAR}.0.0-rc",
["--release", "--for-publishing", "--build-id", "12345"],
("1", "0", "12345", ""),
(f"{CURRENT_YEAR}", "0", "12345", ""),
),
(
"1.0.0-rc",
f"{CURRENT_YEAR}.0.0-rc",
["--release", "--build-id", "999999999999"],
("1", "0", "999999999999", ""),
(f"{CURRENT_YEAR}", "0", "999999999999", ""),
),
(
"1.1.0-rc",
f"{CURRENT_YEAR}.1.0-rc",
["--build-id", "999999999999"],
("1", "1", "999999999999", "rc"),
(f"{CURRENT_YEAR}", "1", "999999999999", "rc"),
),
(
f"{CURRENT_YEAR}.1.0-rc",
[],
(f"{CURRENT_YEAR}", "1", EXPECTED_BUILD_ID, "rc"),
),
("1.1.0-rc", [], ("1", "1", EXPECTED_BUILD_ID, "rc")),
(
"1.0.0-rc",
f"{CURRENT_YEAR}.0.0-rc",
["--release"],
("1", "0", "0", ""),
(f"{CURRENT_YEAR}", "0", "0", ""),
),
(
"1.1.0-rc",
f"{CURRENT_YEAR}.1.0-rc",
["--for-publishing"],
("1", "1", EXPECTED_BUILD_ID, ""),
(f"{CURRENT_YEAR}", "1", EXPECTED_BUILD_ID, ""),
),
(
"1.0.0-rc",
f"{CURRENT_YEAR}.0.0-rc",
["--release", "--for-publishing"],
("1", "0", "0", ""),
(f"{CURRENT_YEAR}", "0", "0", ""),
),
(
"1.0.0-rc",
f"{CURRENT_YEAR}.0.0-rc",
["--release"],
("1", "0", "0", ""),
(f"{CURRENT_YEAR}", "0", "0", ""),
),
(
"1.1.0-rc",
f"{CURRENT_YEAR}.1.0-rc",
[],
("1", "1", EXPECTED_BUILD_ID, "rc"),
(f"{CURRENT_YEAR}", "1", EXPECTED_BUILD_ID, "rc"),
),
],
)
@freezegun.freeze_time("2022-03-14 01:23:45")
@freezegun.freeze_time(f"{CURRENT_YEAR}-03-14 01:23:45")
def test_update_ext_version(tmp_path, version, args, expected):
run_test(tmp_path, version, args, expected)
7 changes: 7 additions & 0 deletions extensions/positron-python/build/update_ext_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ def main(package_json: pathlib.Path, argv: Sequence[str]) -> None:

major, minor, micro, suffix = parse_version(package["version"])

current_year = datetime.datetime.now().year
if int(major) != current_year:
raise ValueError(
f"Major version [{major}] must be the current year [{current_year}].",
f"If changing major version after new year's, change to {current_year}.1.0",
)

if args.release and not is_even(minor):
raise ValueError(
f"Release version should have EVEN numbered minor version: {package['version']}"
Expand Down
6 changes: 3 additions & 3 deletions extensions/positron-python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@
},
"python.defaultInterpreterPath": {
"default": "python",
"description": "%python.defaultInterpreterPath.description%",
"markdownDescription": "%python.defaultInterpreterPath.description%",
"scope": "machine-overridable",
"type": "string"
},
Expand All @@ -422,7 +422,7 @@
},
"python.experiments.optInto": {
"default": [],
"description": "%python.experiments.optInto.description%",
"markdownDescription": "%python.experiments.optInto.description%",
"items": {
"enum": [
"All",
Expand All @@ -436,7 +436,7 @@
},
"python.experiments.optOutFrom": {
"default": [],
"description": "%python.experiments.optOutFrom.description%",
"markdownDescription": "%python.experiments.optOutFrom.description%",
"items": {
"enum": [
"All",
Expand Down
10 changes: 5 additions & 5 deletions extensions/positron-python/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
"python.menu.createNewFile.title": "Python File",
"python.autoComplete.extraPaths.description": "List of paths to libraries and the like that need to be imported by auto complete engine. E.g. when using Google App SDK, the paths are not in system path, hence need to be added into this list.",
"python.condaPath.description": "Path to the conda executable to use for activation (version 4.4+).",
"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 https://aka.ms/AAfekmf to understand when this is used",
"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.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 https://github.com/microsoft/vscode-python/wiki/AB-Experiments for more details.",
"python.experiments.optOutFrom.description": "List of experiment to opt out of. If empty, user is assigned the default experiment groups. See https://github.com/microsoft/vscode-python/wiki/AB-Experiments for more details.",
"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.",
"python.experiments.optOutFrom.description": "List of experiment to opt out of. If empty, user is assigned the default experiment groups. See [here](https://github.com/microsoft/vscode-python/wiki/AB-Experiments) for more details.",
"python.formatting.autopep8Args.description": "Arguments passed in. Each argument is a separate item in the array.",
"python.formatting.autopep8Path.description": "Path to autopep8, you can use a custom version of autopep8 by modifying this setting to include the full path.",
"python.formatting.blackArgs.description": "Arguments passed in. Each argument is a separate item in the array.",
Expand Down Expand Up @@ -115,6 +115,6 @@
"python.testing.unittestEnabled.description": "Enable testing using unittest.",
"python.venvFolders.description": "Folders in your home directory to look into for virtual environments (supports pyenv, direnv and virtualenvwrapper by default).",
"python.venvPath.description": "Path to folder with a list of Virtual Environments (e.g. ~/.pyenv, ~/Envs, ~/.virtualenvs).",
"python.sortImports.args.deprecationMessage": "This setting will be removed soon. Use `isort.args` instead.",
"python.sortImports.path.deprecationMessage": "This setting will be removed soon. Use `isort.path` instead."
"python.sortImports.args.deprecationMessage": "This setting will be removed soon. Use 'isort.args' instead.",
"python.sortImports.path.deprecationMessage": "This setting will be removed soon. Use 'isort.path' instead."
}
2 changes: 1 addition & 1 deletion extensions/positron-python/pythonFiles/install_debugpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
DEBUGGER_DEST = os.path.join(EXTENSION_ROOT, "pythonFiles", "lib", "python")
DEBUGGER_PACKAGE = "debugpy"
DEBUGGER_PYTHON_ABI_VERSIONS = ("cp310",)
DEBUGGER_VERSION = "1.6.5" # can also be "latest"
DEBUGGER_VERSION = "1.6.6" # can also be "latest"


def _contains(s, parts=()):
Expand Down
Loading

0 comments on commit 50a5d67

Please sign in to comment.