Skip to content

Commit 2d80227

Browse files
committed
Merge branch 'switch-to-uuid' into use-tcp-for-test-server
2 parents 7f9feeb + 0441e29 commit 2d80227

File tree

82 files changed

+3146
-773
lines changed

Some content is hidden

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

82 files changed

+3146
-773
lines changed

.eslintignore

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ src/test/testing/common/services/configSettingService.unit.test.ts
4848

4949
src/test/common/exitCIAfterTestReporter.ts
5050

51-
src/test/common/net/fileDownloader.unit.test.ts
52-
src/test/common/net/httpClient.unit.test.ts
5351

5452
src/test/common/terminals/activator/index.unit.test.ts
5553
src/test/common/terminals/activator/base.unit.test.ts
@@ -76,7 +74,6 @@ src/test/common/platform/filesystem.test.ts
7674

7775
src/test/common/utils/cacheUtils.unit.test.ts
7876
src/test/common/utils/decorators.unit.test.ts
79-
src/test/common/utils/localize.functional.test.ts
8077
src/test/common/utils/version.unit.test.ts
8178

8279
src/test/common/configSettings/configSettings.unit.test.ts
@@ -108,7 +105,6 @@ src/test/common/interpreterPathService.unit.test.ts
108105

109106
src/test/pythonFiles/formatting/dummy.ts
110107

111-
src/test/debugger/extension/banner.unit.test.ts
112108
src/test/debugger/extension/adapter/adapter.test.ts
113109
src/test/debugger/extension/adapter/outdatedDebuggerPrompt.unit.test.ts
114110
src/test/debugger/extension/adapter/factory.unit.test.ts
@@ -124,7 +120,6 @@ src/test/telemetry/index.unit.test.ts
124120
src/test/telemetry/envFileTelemetry.unit.test.ts
125121

126122
src/test/application/diagnostics/checks/macPythonInterpreter.unit.test.ts
127-
src/test/application/diagnostics/checks/pythonPathDeprecated.unit.test.ts
128123
src/test/application/diagnostics/checks/pythonInterpreter.unit.test.ts
129124
src/test/application/diagnostics/checks/invalidLaunchJsonDebugger.unit.test.ts
130125
src/test/application/diagnostics/checks/powerShellActivation.unit.test.ts
@@ -139,7 +134,6 @@ src/test/performance/load.perf.test.ts
139134

140135
src/client/interpreter/configuration/interpreterSelector/commands/base.ts
141136
src/client/interpreter/configuration/interpreterSelector/commands/resetInterpreter.ts
142-
src/client/interpreter/configuration/interpreterSelector/commands/setShebangInterpreter.ts
143137
src/client/interpreter/configuration/pythonPathUpdaterServiceFactory.ts
144138
src/client/interpreter/configuration/services/globalUpdaterService.ts
145139
src/client/interpreter/configuration/services/workspaceUpdaterService.ts
@@ -148,7 +142,6 @@ src/client/interpreter/helpers.ts
148142
src/client/interpreter/virtualEnvs/condaInheritEnvPrompt.ts
149143
src/client/interpreter/display/index.ts
150144

151-
src/client/api.ts
152145
src/client/extension.ts
153146
src/client/sourceMapSupport.ts
154147
src/client/startupTelemetry.ts
@@ -178,12 +171,9 @@ src/client/testing/common/runner.ts
178171

179172
src/client/common/helpers.ts
180173
src/client/common/net/browser.ts
181-
src/client/common/net/fileDownloader.ts
182-
src/client/common/net/httpClient.ts
183174
src/client/common/net/socket/socketCallbackHandler.ts
184175
src/client/common/net/socket/socketServer.ts
185176
src/client/common/net/socket/SocketStream.ts
186-
src/client/common/asyncDisposableRegistry.ts
187177
src/client/common/editor.ts
188178
src/client/common/contextKey.ts
189179
src/client/common/experiments/telemetry.ts
@@ -208,10 +198,6 @@ src/client/common/terminal/shellDetectors/vscEnvironmentShellDetector.ts
208198
src/client/common/terminal/shellDetectors/terminalNameShellDetector.ts
209199
src/client/common/terminal/shellDetectors/settingsShellDetector.ts
210200
src/client/common/terminal/shellDetectors/baseShellDetector.ts
211-
src/client/common/terminal/environmentActivationProviders/baseActivationProvider.ts
212-
src/client/common/terminal/environmentActivationProviders/commandPrompt.ts
213-
src/client/common/terminal/environmentActivationProviders/bash.ts
214-
src/client/common/terminal/environmentActivationProviders/pyenvActivationProvider.ts
215201
src/client/common/utils/decorators.ts
216202
src/client/common/utils/enum.ts
217203
src/client/common/utils/platform.ts
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Community Feedback Auto Comment
2+
3+
on:
4+
issues:
5+
types:
6+
- labeled
7+
jobs:
8+
add-comment:
9+
if: github.event.label.name == 'needs community feedback'
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
issues: write
14+
15+
steps:
16+
- name: Check For Existing Comment
17+
uses: peter-evans/find-comment@v2
18+
id: finder
19+
with:
20+
issue-number: ${{ github.event.issue.number }}
21+
comment-author: 'github-actions[bot]'
22+
body-includes: Thanks for the feature request! We are going to give the community
23+
24+
- name: Add Community Feedback Comment
25+
if: steps.finder.outputs.comment-id == ''
26+
uses: peter-evans/create-or-update-comment@v3
27+
with:
28+
issue-number: ${{ github.event.issue.number }}
29+
body: |
30+
Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
on:
2+
issues:
3+
types: [opened]
4+
5+
jobs:
6+
python27-issue-response:
7+
runs-on: ubuntu-latest
8+
if: "contains(github.event.issue.body, 'Python version (& distribution if applicable, e.g. Anaconda): 2.7')"
9+
steps:
10+
- name: Check for Python 2.7 string
11+
run: |
12+
response="We're sorry, but we no longer support Python 2.7. If you need to work with Python 2.7, you will have to pin to 2022.2.* version of the extension, which was the last version that had the debugger (debugpy) with support for python 2.7, and was tested with `2.7`. Thank you for your understanding! \n ![https://user-images.githubusercontent.com/51720070/80000627-39dacc00-8472-11ea-9755-ac7ba0acbb70.gif](https://user-images.githubusercontent.com/51720070/80000627-39dacc00-8472-11ea-9755-ac7ba0acbb70.gif)"
13+
gh issue comment ${{ github.event.issue.number }} --body "$response"
14+
gh issue close ${{ github.event.issue.number }}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Triage "info-needed" label
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
env:
8+
TRIAGERS: '["karrtikr","karthiknadig","paulacamargo25","eleanorjboyd", "brettcannon"]'
9+
10+
jobs:
11+
add_label:
12+
runs-on: ubuntu-latest
13+
if: contains(github.event.issue.labels.*.name, 'triage-needed') && !contains(github.event.issue.labels.*.name, 'info-needed')
14+
env:
15+
KEYWORDS: '["\\?", "please", "kindly", "let me know", "try", "can you", "could you", "would you", "may I", "provide", "let us know", "tell me", "give me", "send me", "what", "when", "where", "why", "how"]'
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
- name: Check for author
20+
uses: actions/github-script@v6
21+
with:
22+
github-token: ${{ secrets.GITHUB_TOKEN }}
23+
script: |
24+
const issue = await github.issues.get({
25+
owner: context.repo.owner,
26+
repo: context.repo.repo,
27+
issue_number: context.issue.number
28+
});
29+
const commentAuthor = context.payload.comment.user.login;
30+
const commentBody = context.payload.comment.body;
31+
const isTeamMember = ${{ env.TRIAGERS }}.includes(commentAuthor);
32+
33+
const keywords = ${{ env.KEYWORDS }};
34+
const isRequestForInfo = new RegExp(keywords.join('|'), 'i').test(commentBody);
35+
36+
const shouldAddLabel = isTeamMember && commentAuthor !== issue.data.user.login && isRequestForInfo;
37+
38+
if (shouldAddLabel) {
39+
await github.issues.addLabels({
40+
owner: context.repo.owner,
41+
repo: context.repo.repo,
42+
issue_number: context.issue.number,
43+
labels: ['info-needed']
44+
});
45+
}
46+
47+
remove_label:
48+
if: contains(github.event.issue.labels.*.name, 'info-needed') && contains(github.event.issue.labels.*.name, 'triage-needed')
49+
runs-on: ubuntu-latest
50+
steps:
51+
- name: Checkout code
52+
uses: actions/checkout@v3
53+
- name: Check for author
54+
uses: actions/github-script@v6
55+
with:
56+
github-token: ${{ secrets.GITHUB_TOKEN }}
57+
script: |
58+
const issue = await github.issues.get({
59+
owner: context.repo.owner,
60+
repo: context.repo.repo,
61+
issue_number: context.issue.number
62+
});
63+
const commentAuthor = context.payload.comment.user.login;
64+
const issueAuthor = issue.data.user.login;
65+
if (commentAuthor === issueAuthor) {
66+
await github.issues.removeLabel({
67+
owner: context.repo.owner,
68+
repo: context.repo.repo,
69+
issue_number: context.issue.number,
70+
name: 'info-needed'
71+
});
72+
return;
73+
}
74+
if (${{ env.TRIAGERS }}.includes(commentAuthor)) {
75+
// If one of triagers made a comment, ignore it
76+
return;
77+
}
78+
// Loop through all the comments on the issue in reverse order and find the last username that a TRIAGER mentioned
79+
// If the comment author is the last mentioned username, remove the "info-needed" label
80+
const comments = await github.issues.listComments({
81+
owner: context.repo.owner,
82+
repo: context.repo.repo,
83+
issue_number: context.issue.number
84+
});
85+
for (const comment of comments.data.slice().reverse()) {
86+
if (!${{ env.TRIAGERS }}.includes(comment.user.login)) {
87+
continue;
88+
}
89+
const matches = comment.body.match(/@\w+/g) || [];
90+
const mentionedUsernames = matches.map(match => match.replace('@', ''));
91+
if (mentionedUsernames.includes(commentAuthor)) {
92+
await github.issues.removeLabel({
93+
owner: context.repo.owner,
94+
repo: context.repo.repo,
95+
issue_number: context.issue.number,
96+
name: 'info-needed'
97+
});
98+
break;
99+
}
100+
}

.vscode/launch.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,14 @@
253253
"request": "attach",
254254
"listen": { "host": "localhost", "port": 5678 },
255255
"justMyCode": true
256+
},
257+
{
258+
"name": "Pytest Module",
259+
"type": "python",
260+
"request": "launch",
261+
"module": "pytest",
262+
"args": ["${workspaceFolder}/pythonFiles/tests/pytestadapter"],
263+
"justMyCode": true
256264
}
257265
],
258266
"compounds": [

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@
6666
],
6767
"typescript.preferences.importModuleSpecifier": "relative",
6868
"debug.javascript.usePreview": false
69-
}
69+
}

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ Extensions installed through the marketplace are subject to the [Marketplace Ter
3737

3838
## Jupyter Notebook quick start
3939

40-
The Python extension and the [Jupyter extension](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter) work together to give you a great Notebook experience in VS Code.
40+
The Python extension offers support for Jupyter notebooks via the [Jupyter extension](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter) to provide you a great Python notebook experience in VS Code.
41+
42+
- Install the [Jupyter extension](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter).
4143

4244
- Open or create a Jupyter Notebook file (.ipynb) and start coding in our Notebook Editor!
4345

build/existingFiles.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@
379379
"src/test/common/socketStream.test.ts",
380380
"src/test/common/terminals/activation.bash.unit.test.ts",
381381
"src/test/common/terminals/activation.commandPrompt.unit.test.ts",
382+
"src/test/common/terminals/activation.nushell.unit.test.ts",
382383
"src/test/common/terminals/activation.conda.unit.test.ts",
383384
"src/test/common/terminals/activation.unit.test.ts",
384385
"src/test/common/terminals/activator/base.unit.test.ts",

gulpfile.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,13 @@ async function addExtensionPackDependencies() {
8282
// extension dependencies need not be installed during development
8383
const packageJsonContents = await fsExtra.readFile('package.json', 'utf-8');
8484
const packageJson = JSON.parse(packageJsonContents);
85-
packageJson.extensionPack = ['ms-toolsai.jupyter', 'ms-python.vscode-pylance'].concat(
85+
packageJson.extensionPack = ['ms-python.vscode-pylance'].concat(
8686
packageJson.extensionPack ? packageJson.extensionPack : [],
8787
);
88+
// Remove potential duplicates.
89+
packageJson.extensionPack = packageJson.extensionPack.filter(
90+
(item, index) => packageJson.extensionPack.indexOf(item) === index,
91+
);
8892
await fsExtra.writeFile('package.json', JSON.stringify(packageJson, null, 4), 'utf-8');
8993
}
9094

package.json

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,15 +1693,28 @@
16931693
{
16941694
"group": "Python",
16951695
"command": "python.createEnvironment",
1696-
"when": "resourceLangId == pip-requirements && !virtualWorkspace && shellExecutionSupported"
1696+
"when": "resourceLangId == pip-requirements && !virtualWorkspace && shellExecutionSupported && !inDiffEditor"
16971697
},
16981698
{
16991699
"group": "Python",
17001700
"command": "python.createEnvironment",
1701-
"when": "resourceFilename == pyproject.toml && pipInstallableToml && !virtualWorkspace && shellExecutionSupported"
1701+
"when": "resourceFilename == pyproject.toml && pipInstallableToml && !virtualWorkspace && shellExecutionSupported && !inDiffEditor"
17021702
}
17031703
],
17041704
"editor/context": [
1705+
{
1706+
"submenu": "python.run",
1707+
"group": "Python",
1708+
"when": "editorLangId == python && !virtualWorkspace && shellExecutionSupported"
1709+
},
1710+
{
1711+
"command": "python.sortImports",
1712+
"group": "Refactor",
1713+
"title": "%python.command.python.sortImports.title%",
1714+
"when": "editorLangId == python && !notebookEditorFocused && !virtualWorkspace && shellExecutionSupported"
1715+
}
1716+
],
1717+
"python.run": [
17051718
{
17061719
"command": "python.execInTerminal",
17071720
"group": "Python",
@@ -1716,12 +1729,6 @@
17161729
"command": "python.execSelectionInTerminal",
17171730
"group": "Python",
17181731
"when": "editorFocus && editorLangId == python && !virtualWorkspace && shellExecutionSupported"
1719-
},
1720-
{
1721-
"command": "python.sortImports",
1722-
"group": "Refactor",
1723-
"title": "%python.command.python.sortImports.title%",
1724-
"when": "editorLangId == python && !notebookEditorFocused && !virtualWorkspace && shellExecutionSupported"
17251732
}
17261733
],
17271734
"editor/title": [
@@ -1767,6 +1774,13 @@
17671774
}
17681775
]
17691776
},
1777+
"submenus": [
1778+
{
1779+
"id": "python.run",
1780+
"label": "%python.editor.context.submenu.runPython%",
1781+
"icon": "$(play)"
1782+
}
1783+
],
17701784
"viewsWelcome": [
17711785
{
17721786
"view": "testing",

package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"python.command.python.launchTensorBoard.title": "Launch TensorBoard",
2626
"python.command.python.refreshTensorBoard.title": "Refresh TensorBoard",
2727
"python.menu.createNewFile.title": "Python File",
28+
"python.editor.context.submenu.runPython": "Run Python",
2829
"python.activeStateToolPath.description": "Path to the State Tool executable for ActiveState runtimes (version 0.36+).",
2930
"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.",
3031
"python.condaPath.description": "Path to the conda executable to use for activation (version 4.4+).",

pythonFiles/create_conda.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from typing import Optional, Sequence, Union
1010

1111
CONDA_ENV_NAME = ".conda"
12-
CWD = pathlib.PurePath(os.getcwd())
12+
CWD = pathlib.Path.cwd()
1313

1414

1515
class VenvError(Exception):

0 commit comments

Comments
 (0)