Skip to content

Commit 06c5dad

Browse files
karthiknadigeleanorjboydpetetronicKartik Raj
authored andcommitted
Merge remote-tracking branch 'upstream/main'
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 <[email protected]> Co-authored-by: Eleanor Boyd <[email protected]> Co-authored-by: Pete Farland <[email protected]> Co-authored-by: Kartik Raj <[email protected]>
1 parent 9f1b733 commit 06c5dad

File tree

53 files changed

+713
-395
lines changed

Some content is hidden

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

53 files changed

+713
-395
lines changed

extensions/positron-python/.vscodeignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ out/test/**
5757
out/testMultiRootWkspc/**
5858
precommit.hook
5959
pythonFiles/**/*.pyc
60-
pythonFiles/lib/**/*.dist-info/**
6160
pythonFiles/lib/**/*.egg-info/**
6261
pythonFiles/lib/python/bin/**
6362
pythonFiles/jedilsp_requirements/**
Lines changed: 53 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
33

4+
import datetime
45
import json
56

67
import freezegun
78
import pytest
89
import update_ext_version
910

10-
TEST_DATETIME = "2022-03-14 01:23:45"
11+
12+
CURRENT_YEAR = datetime.datetime.now().year
13+
TEST_DATETIME = f"{CURRENT_YEAR}-03-14 01:23:45"
1114

1215
# The build ID is calculated via:
1316
# "1" + datetime.datetime.strptime(TEST_DATETIME,"%Y-%m-%d %H:%M:%S").strftime('%j%H%M')
@@ -31,14 +34,21 @@ def run_test(tmp_path, version, args, expected):
3134
@pytest.mark.parametrize(
3235
"version, args",
3336
[
34-
("1.0.0-rc", []),
35-
("1.1.0-rc", ["--release"]),
36-
("1.0.0-rc", ["--release", "--build-id", "-1"]),
37-
("1.0.0-rc", ["--release", "--for-publishing", "--build-id", "-1"]),
38-
("1.0.0-rc", ["--release", "--for-publishing", "--build-id", "999999999999"]),
39-
("1.1.0-rc", ["--build-id", "-1"]),
40-
("1.1.0-rc", ["--for-publishing", "--build-id", "-1"]),
41-
("1.1.0-rc", ["--for-publishing", "--build-id", "999999999999"]),
37+
("2000.1.0", []), # Wrong year for CalVer
38+
(f"{CURRENT_YEAR}.0.0-rc", []),
39+
(f"{CURRENT_YEAR}.1.0-rc", ["--release"]),
40+
(f"{CURRENT_YEAR}.0.0-rc", ["--release", "--build-id", "-1"]),
41+
(
42+
f"{CURRENT_YEAR}.0.0-rc",
43+
["--release", "--for-publishing", "--build-id", "-1"],
44+
),
45+
(
46+
f"{CURRENT_YEAR}.0.0-rc",
47+
["--release", "--for-publishing", "--build-id", "999999999999"],
48+
),
49+
(f"{CURRENT_YEAR}.1.0-rc", ["--build-id", "-1"]),
50+
(f"{CURRENT_YEAR}.1.0-rc", ["--for-publishing", "--build-id", "-1"]),
51+
(f"{CURRENT_YEAR}.1.0-rc", ["--for-publishing", "--build-id", "999999999999"]),
4252
],
4353
)
4454
def test_invalid_args(tmp_path, version, args):
@@ -49,56 +59,68 @@ def test_invalid_args(tmp_path, version, args):
4959
@pytest.mark.parametrize(
5060
"version, args, expected",
5161
[
52-
("1.1.0-rc", ["--build-id", "12345"], ("1", "1", "12345", "rc")),
53-
("1.0.0-rc", ["--release", "--build-id", "12345"], ("1", "0", "12345", "")),
5462
(
55-
"1.1.0-rc",
63+
f"{CURRENT_YEAR}.1.0-rc",
64+
["--build-id", "12345"],
65+
(f"{CURRENT_YEAR}", "1", "12345", "rc"),
66+
),
67+
(
68+
f"{CURRENT_YEAR}.0.0-rc",
69+
["--release", "--build-id", "12345"],
70+
(f"{CURRENT_YEAR}", "0", "12345", ""),
71+
),
72+
(
73+
f"{CURRENT_YEAR}.1.0-rc",
5674
["--for-publishing", "--build-id", "12345"],
57-
("1", "1", "12345", ""),
75+
(f"{CURRENT_YEAR}", "1", "12345", ""),
5876
),
5977
(
60-
"1.0.0-rc",
78+
f"{CURRENT_YEAR}.0.0-rc",
6179
["--release", "--for-publishing", "--build-id", "12345"],
62-
("1", "0", "12345", ""),
80+
(f"{CURRENT_YEAR}", "0", "12345", ""),
6381
),
6482
(
65-
"1.0.0-rc",
83+
f"{CURRENT_YEAR}.0.0-rc",
6684
["--release", "--build-id", "999999999999"],
67-
("1", "0", "999999999999", ""),
85+
(f"{CURRENT_YEAR}", "0", "999999999999", ""),
6886
),
6987
(
70-
"1.1.0-rc",
88+
f"{CURRENT_YEAR}.1.0-rc",
7189
["--build-id", "999999999999"],
72-
("1", "1", "999999999999", "rc"),
90+
(f"{CURRENT_YEAR}", "1", "999999999999", "rc"),
91+
),
92+
(
93+
f"{CURRENT_YEAR}.1.0-rc",
94+
[],
95+
(f"{CURRENT_YEAR}", "1", EXPECTED_BUILD_ID, "rc"),
7396
),
74-
("1.1.0-rc", [], ("1", "1", EXPECTED_BUILD_ID, "rc")),
7597
(
76-
"1.0.0-rc",
98+
f"{CURRENT_YEAR}.0.0-rc",
7799
["--release"],
78-
("1", "0", "0", ""),
100+
(f"{CURRENT_YEAR}", "0", "0", ""),
79101
),
80102
(
81-
"1.1.0-rc",
103+
f"{CURRENT_YEAR}.1.0-rc",
82104
["--for-publishing"],
83-
("1", "1", EXPECTED_BUILD_ID, ""),
105+
(f"{CURRENT_YEAR}", "1", EXPECTED_BUILD_ID, ""),
84106
),
85107
(
86-
"1.0.0-rc",
108+
f"{CURRENT_YEAR}.0.0-rc",
87109
["--release", "--for-publishing"],
88-
("1", "0", "0", ""),
110+
(f"{CURRENT_YEAR}", "0", "0", ""),
89111
),
90112
(
91-
"1.0.0-rc",
113+
f"{CURRENT_YEAR}.0.0-rc",
92114
["--release"],
93-
("1", "0", "0", ""),
115+
(f"{CURRENT_YEAR}", "0", "0", ""),
94116
),
95117
(
96-
"1.1.0-rc",
118+
f"{CURRENT_YEAR}.1.0-rc",
97119
[],
98-
("1", "1", EXPECTED_BUILD_ID, "rc"),
120+
(f"{CURRENT_YEAR}", "1", EXPECTED_BUILD_ID, "rc"),
99121
),
100122
],
101123
)
102-
@freezegun.freeze_time("2022-03-14 01:23:45")
124+
@freezegun.freeze_time(f"{CURRENT_YEAR}-03-14 01:23:45")
103125
def test_update_ext_version(tmp_path, version, args, expected):
104126
run_test(tmp_path, version, args, expected)

extensions/positron-python/build/update_ext_version.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ def main(package_json: pathlib.Path, argv: Sequence[str]) -> None:
6969

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

72+
current_year = datetime.datetime.now().year
73+
if int(major) != current_year:
74+
raise ValueError(
75+
f"Major version [{major}] must be the current year [{current_year}].",
76+
f"If changing major version after new year's, change to {current_year}.1.0",
77+
)
78+
7279
if args.release and not is_even(minor):
7380
raise ValueError(
7481
f"Release version should have EVEN numbered minor version: {package['version']}"

extensions/positron-python/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@
398398
},
399399
"python.defaultInterpreterPath": {
400400
"default": "python",
401-
"description": "%python.defaultInterpreterPath.description%",
401+
"markdownDescription": "%python.defaultInterpreterPath.description%",
402402
"scope": "machine-overridable",
403403
"type": "string"
404404
},
@@ -422,7 +422,7 @@
422422
},
423423
"python.experiments.optInto": {
424424
"default": [],
425-
"description": "%python.experiments.optInto.description%",
425+
"markdownDescription": "%python.experiments.optInto.description%",
426426
"items": {
427427
"enum": [
428428
"All",
@@ -436,7 +436,7 @@
436436
},
437437
"python.experiments.optOutFrom": {
438438
"default": [],
439-
"description": "%python.experiments.optOutFrom.description%",
439+
"markdownDescription": "%python.experiments.optOutFrom.description%",
440440
"items": {
441441
"enum": [
442442
"All",

extensions/positron-python/package.nls.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929
"python.menu.createNewFile.title": "Python File",
3030
"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.",
3131
"python.condaPath.description": "Path to the conda executable to use for activation (version 4.4+).",
32-
"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",
32+
"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",
3333
"python.diagnostics.sourceMapsEnabled.description": "Enable source map support for meaningful stack traces in error logs.",
3434
"python.envFile.description": "Absolute path to a file containing environment variable definitions.",
3535
"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.",
36-
"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.",
37-
"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.",
36+
"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.",
37+
"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.",
3838
"python.formatting.autopep8Args.description": "Arguments passed in. Each argument is a separate item in the array.",
3939
"python.formatting.autopep8Path.description": "Path to autopep8, you can use a custom version of autopep8 by modifying this setting to include the full path.",
4040
"python.formatting.blackArgs.description": "Arguments passed in. Each argument is a separate item in the array.",
@@ -115,6 +115,6 @@
115115
"python.testing.unittestEnabled.description": "Enable testing using unittest.",
116116
"python.venvFolders.description": "Folders in your home directory to look into for virtual environments (supports pyenv, direnv and virtualenvwrapper by default).",
117117
"python.venvPath.description": "Path to folder with a list of Virtual Environments (e.g. ~/.pyenv, ~/Envs, ~/.virtualenvs).",
118-
"python.sortImports.args.deprecationMessage": "This setting will be removed soon. Use `isort.args` instead.",
119-
"python.sortImports.path.deprecationMessage": "This setting will be removed soon. Use `isort.path` instead."
118+
"python.sortImports.args.deprecationMessage": "This setting will be removed soon. Use 'isort.args' instead.",
119+
"python.sortImports.path.deprecationMessage": "This setting will be removed soon. Use 'isort.path' instead."
120120
}

extensions/positron-python/pythonFiles/install_debugpy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
DEBUGGER_DEST = os.path.join(EXTENSION_ROOT, "pythonFiles", "lib", "python")
1414
DEBUGGER_PACKAGE = "debugpy"
1515
DEBUGGER_PYTHON_ABI_VERSIONS = ("cp310",)
16-
DEBUGGER_VERSION = "1.6.5" # can also be "latest"
16+
DEBUGGER_VERSION = "1.6.6" # can also be "latest"
1717

1818

1919
def _contains(s, parts=()):

0 commit comments

Comments
 (0)