Skip to content

Commit

Permalink
Merged PR posit-dev/positron-python#122: Merging upstream vscode-pyth…
Browse files Browse the repository at this point in the history
…on release 2023.10.0

Merge pull request #122 from posit-dev/merge/2023.10.0

Merging upstream vscode-python release 2023.10.0
--------------------
Commit message for posit-dev/positron-python@fc0926f:

Add typings to get updated EnvironmentVariableCollection API

--------------------
Commit message for posit-dev/positron-python@8c11f29:

Merge remote-tracking branch 'upstream/release/2023.10'

--------------------
Commit message for posit-dev/positron-python@fea895f:

Update version and readme for release (posit-dev/positron-python#21388)

Co-authored-by: Soojin (Min) Choi <[email protected]>
--------------------
Commit message for microsoft/vscode-python@ad9c899:

Update version for release candidate (microsoft/vscode-python#21369)


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

fix bug so canceling debug works in rewrite (microsoft/vscode-python#21361)

fixes microsoft/vscode-python#21336
--------------------
Commit message for microsoft/vscode-python@be829b3:

Unittest for large workspaces (microsoft/vscode-python#21351)

follows the same steps as making pytest compatible with large workspaces
with many tests. Now test_ids are sent over a port as a json instead of
in the exec function which can hit a cap on # of characters. Should fix
microsoft/vscode-python#21339.
--------------------
Commit message for microsoft/vscode-python@cd76ee1:

add pythonTestAdapter to experiment enum (microsoft/vscode-python#21357)

allow people to opt in and out of the pythonTestAdapter rewrite via the
settings `python.experiment.optInto` or `python.experiment.optOutfrom`
--------------------
Commit message for microsoft/vscode-python@dbd0b73:

adding extra log messages for rewrite debugging (microsoft/vscode-python#21352)

These logs print errors and other bits of information which will be
helpful for debugging workflows of users where we need to get
information such as args or which step in the process they got to.
--------------------
Commit message for microsoft/vscode-python@d968b8c:

Dont show command for button trigger in command pallet (microsoft/vscode-python#21350)

Fixes microsoft/vscode-python#21322
--------------------
Commit message for microsoft/vscode-python@e9a8dd5:

remove duplicates from test_ids array (microsoft/vscode-python#21347)

this will partially remediate
microsoft/vscode-python#21339 in regards to
the duplicate IDs being run.
--------------------
Commit message for microsoft/vscode-python@f148139:

allow pytest tests to handle multiple payloads (microsoft/vscode-python#21301)

As part of the switch to allow for dynamic run- the pytest discovery and
execution tests are now switched to be take lists of dicts where the
dicts are the payloads.
--------------------
Commit message for microsoft/vscode-python@c213491:

Apply environment variables after shell initialization scripts are run in `pythonTerminalEnvVarActivation` experiment (microsoft/vscode-python#21290)

For microsoft/vscode-python#11039 microsoft/vscode-python#20822
Closes microsoft/vscode-python#21297

Update proposed APIs to be used in Terminal activation experiment.
--------------------
Commit message for microsoft/vscode-python@72f7ef8:

Set up testing rewrite experiment (microsoft/vscode-python#21258)

is the beginning of this issue:
microsoft/vscode-python#21150, in that it will
start the process of implementing the setting in the extension
--------------------
Commit message for microsoft/vscode-python@4109228:

fix debugging with new pytest run script (microsoft/vscode-python#21299)

fix debugging for run_pytest_script.py setup
--------------------
Commit message for microsoft/vscode-python@b916981:

remove unneeded multiroot code (microsoft/vscode-python#21295)

removed extra steps to wrap data since this creates duplicate folders in
the controller and only keeps the most recent instead of all the roots
from different workspaces.
--------------------
Commit message for microsoft/vscode-python@e2a9cec:

allow large scale testing (microsoft/vscode-python#21269)

allows new testing rewrite to handle 500+ tests and load and run these
tests. High limit tested was 10,000 tests.
--------------------
Commit message for microsoft/vscode-python@f2f5fe2:

Check config type in the ChildProcessAttachEvents (microsoft/vscode-python#21272)


--------------------
Commit message for microsoft/vscode-python@4b4e5b7:

Update pyright version (microsoft/vscode-python#21296)

Fix error in tests, updating pyright version
--------------------
Commit message for microsoft/vscode-python@c9a7268:

Revert "Remove hack to check the vscode version" (microsoft/vscode-python#21294)

Reverts microsoft/vscode-python#21180
For microsoft/vscode-python#20769
--------------------
Commit message for microsoft/vscode-python@a74f1d1:

Detect installed packages in the selected environment (microsoft/vscode-python#21231)

Fixes microsoft/vscode-python#21140
--------------------
Commit message for microsoft/vscode-python@b0ebc9b:

Enable debug pytest (microsoft/vscode-python#21228)

fixes microsoft/vscode-python#21147

---------

Co-authored-by: Aidos Kanapyanov <[email protected]>
Co-authored-by: Karthik Nadig <[email protected]>
--------------------
Commit message for microsoft/vscode-python@be9662f:

revert testing to using socket (microsoft/vscode-python#21242)

switch back to using a socket instead of an output file for use in the
plugin communication during testing. This should work now that we
resolved the issue with python path for windows.
--------------------
Commit message for microsoft/vscode-python@b4a47bb:

Add reload flag on fastApi provider (microsoft/vscode-python#21241)


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

Add option for pyenv interpreters when creating environments with venv (microsoft/vscode-python#21219)

Resolves microsoft/vscode-python#20881 .

Testing:

Behaves as expected when testing with Extension Development Host:


![image](https://github.com/microsoft/vscode-python/assets/30149293/d114d9ab-f2d8-4273-877b-d7dd030cfe76)
--------------------
Commit message for microsoft/vscode-python@b3d43e5:

Do not open "save as" window when running existing Python files (microsoft/vscode-python#21232)

Closes microsoft/vscode-python#21209
--------------------
Commit message for microsoft/vscode-python@b0da28c:

Remove IS_WINDOWS constant in favor of PlatformService (microsoft/vscode-python#21157)

Solves partially microsoft/vscode-python#8542
--------------------
Commit message for microsoft/vscode-python@0c4fa40:

Change name of command to run Python files in separate terminals (microsoft/vscode-python#21229)

Closes microsoft/vscode-python#14094
--------------------
Commit message for microsoft/vscode-python@1533818:

Added option to run multiple Python files in separate terminals (microsoft/vscode-python#21223)

Closes microsoft/vscode-python#21215
microsoft/vscode-python#14094

Added the option to assign a dedicated terminal for each Python file:


![image](https://github.com/microsoft/vscode-python/assets/13199757/b01248e4-c826-4de0-b15f-cde959965e68)
--------------------
Commit message for microsoft/vscode-python@eb9fde3:

Add `createEnvironment.contentButton` setting (microsoft/vscode-python#21212)

Closes microsoft/vscode-python#20982

---------

Co-authored-by: Luciana Abud <[email protected]>
--------------------
Commit message for microsoft/vscode-python@5eef525:

Add logging when interpreter path changes (microsoft/vscode-python#21210)

For microsoft/vscode-python#21208
--------------------
Commit message for microsoft/vscode-python@8d291f7:

Disable "snippets" expansion in Jedi LSP (microsoft/vscode-python#21194)

This brings the Jedi based completion experience in line with that
provided by Pylance. Completions now insert only the current symbol
rather than assuming that the user wants to e.g: call that symbol.

This means for example that completing `max` will insert just `max`
rather `max(arg1, arg2)`. While for this case this may be seen as less
useful, it means that insertions in places where a call is not desired
(such as imports and typing contexts) will not be forced to manually
remove the parentheses and template arguments which might otherwise be
inserted.

Users can still use the signature support UI to explore signatures and
of course insertion of an opening parenthesis will still insert a
closing one.

Hopefully this new configuration will be preferable to a majority of
users.

I've done some light testing to check that this disables the described
additional completion, however I'm not massively familiar with JediLSP
so I'm not sure what other behaviours this will disable.

Fixes microsoft/vscode-python#15858
--------------------
Commit message for microsoft/vscode-python@a85eb3b:

Fix startup telemetry issue (microsoft/vscode-python#21203)

Could fix microsoft/vscode-python#20874 based
on error trace.
--------------------
Commit message for microsoft/vscode-python@17daae4:

Open separate Python terminals when running different Python files (microsoft/vscode-python#21202)

Closes microsoft/vscode-python#21097
Closes microsoft/vscode-python#14094
--------------------
Commit message for microsoft/vscode-python@f0253e5:

Use actions from `vscode-github-triage-actions` in all Python automations (microsoft/vscode-python#21178)


--------------------
Commit message for microsoft/vscode-python@678f70d:

Remove hack to check the vscode version (microsoft/vscode-python#21180)

Closed: microsoft/vscode-python#20769
--------------------
Commit message for microsoft/vscode-python@6bdada0:

Use `saveEditor` proposed API for running untitled Python files (microsoft/vscode-python#21183)

Closes microsoft/vscode-python#21182

Lead-authored-by: Eleanor Boyd <[email protected]>
Co-authored-by: Peter Law <[email protected]>
Co-authored-by: Carlos Piña Martinez <[email protected]>
Co-authored-by: Jonathan Rayner <[email protected]>
Co-authored-by: Pete Farland <[email protected]>
Co-authored-by: paulacamargo25 <[email protected]>
Co-authored-by: Karthik Nadig <[email protected]>
Co-authored-by: Kartik Raj <[email protected]>
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
8 people authored and wesm committed Mar 28, 2024
1 parent 9d901d5 commit c908a36
Show file tree
Hide file tree
Showing 99 changed files with 2,579 additions and 846 deletions.
1 change: 1 addition & 0 deletions extensions/positron-python/.github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ jobs:
- name: Run Pyright
uses: jakebailey/pyright-action@v1
with:
version: 1.1.308
working-directory: 'pythonFiles'

### Non-smoke tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,17 @@ jobs:
issues: write

steps:
- name: Check For Existing Comment
uses: peter-evans/find-comment@v2
id: finder
- name: Checkout Actions
uses: actions/checkout@v3
with:
issue-number: ${{ github.event.issue.number }}
comment-author: 'github-actions[bot]'
body-includes: Thanks for the feature request! We are going to give the community
repository: 'microsoft/vscode-github-triage-actions'
ref: stable
path: ./actions

- name: Install Actions
run: npm install --production --prefix ./actions

- name: Add Community Feedback Comment
if: steps.finder.outputs.comment-id == ''
uses: peter-evans/create-or-update-comment@v3
- name: Add Community Feedback Comment if applicable
uses: ./actions/python-community-feedback-auto-comment
with:
issue-number: ${{ github.event.issue.number }}
body: |
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.
62 changes: 13 additions & 49 deletions extensions/positron-python/.github/workflows/issue-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,55 +18,19 @@ jobs:
name: "Add 'triage-needed' and remove unrecognizable labels & assignees"
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
- name: Checkout Actions
uses: actions/checkout@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const result = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
})
const labels = result.data.map((label) => label.name)
const hasNeedsOrTPI = labels.some((label) => (label.startsWith('needs') || label === 'testplan-item' || label.startsWith('iteration-plan') || label === 'release-plan'))
repository: 'microsoft/vscode-github-triage-actions'
ref: stable
path: ./actions

if (!hasNeedsOrTPI) {
console.log('This issue is not labeled with a "needs __", "iteration-plan", "release-plan", or the "testplan-item" label; add the "triage-needed" label.')
- name: Install Actions
run: npm install --production --prefix ./actions

github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['triage-needed']
})
} else {
console.log('This issue already has a "needs __", "iteration-plan", "release-plan", or the "testplan-item" label, do not add the "triage-needed" label.')
}
const knownTriagers = ${{ env.TRIAGERS }}
const currentAssignees = await github.rest.issues
.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
})
.then((result) => result.data.assignees.map((a) => a.login));
console.log('Known triagers:', JSON.stringify(knownTriagers));
console.log('Current assignees:', JSON.stringify(currentAssignees));
const assigneesToRemove = currentAssignees.filter(a => !knownTriagers.includes(a));
console.log('Assignees to remove:', JSON.stringify(assigneesToRemove));
github.rest.issues.removeAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
assignees: assigneesToRemove,
});
const knownLabels = ${{ env.REPO_LABELS }}
for( const label of labels) {
if (!knownLabels.includes(label)) {
await github.rest.issues.deleteLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: label,
})
}
}
- name: "Add 'triage-needed' and remove unrecognizable labels & assignees"
uses: ./actions/python-issue-labels
with:
triagers: ${{ env.TRIAGERS }}
token: ${{secrets.GITHUB_TOKEN}}
repo_labels: ${{ env.REPO_LABELS }}
18 changes: 13 additions & 5 deletions extensions/positron-python/.github/workflows/lock-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@ jobs:
lock-issues:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v4
- name: Checkout Actions
uses: actions/checkout@v3
with:
github-token: ${{ github.token }}
issue-inactive-days: '30'
process-only: 'issues'
log-output: true
repository: 'microsoft/vscode-github-triage-actions'
ref: stable
path: ./actions

- name: Install Actions
run: npm install --production --prefix ./actions

- name: 'Lock Issues'
uses: ./actions/python-lock-issues
with:
token: ${{ github.token }}
1 change: 1 addition & 0 deletions extensions/positron-python/.github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ jobs:
- name: Run Pyright
uses: jakebailey/pyright-action@v1
with:
version: 1.1.308
working-directory: 'pythonFiles'

### Non-smoke tests
Expand Down
32 changes: 9 additions & 23 deletions extensions/positron-python/.github/workflows/pr-file-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,15 @@ jobs:
name: 'Check for changed files'
runs-on: ubuntu-latest
steps:
- name: 'package-lock.json matches package.json'
uses: brettcannon/[email protected]
- name: Checkout Actions
uses: actions/checkout@v3
with:
prereq-pattern: 'package.json'
file-pattern: 'package-lock.json'
skip-label: 'skip package*.json'
failure-message: '${prereq-pattern} was edited but ${file-pattern} was not (the ${skip-label} label can be used to pass this check)'
repository: 'microsoft/vscode-github-triage-actions'
ref: stable
path: ./actions

- name: 'package.json matches package-lock.json'
uses: brettcannon/[email protected]
with:
prereq-pattern: 'package-lock.json'
file-pattern: 'package.json'
skip-label: 'skip package*.json'
failure-message: '${prereq-pattern} was edited but ${file-pattern} was not (the ${skip-label} label can be used to pass this check)'
- name: Install Actions
run: npm install --production --prefix ./actions

- name: 'Tests'
uses: brettcannon/[email protected]
with:
prereq-pattern: src/**/*.ts
file-pattern: |
src/**/*.test.ts
src/**/*.testvirtualenvs.ts
.github/test_plan.md
skip-label: 'skip tests'
failure-message: 'TypeScript code was edited without also editing a ${file-pattern} file; see the Testing page in our wiki on testing guidelines (the ${skip-label} label can be used to pass this check)'
- name: Check for changed files
uses: ./actions/python-pr-file-check
16 changes: 11 additions & 5 deletions extensions/positron-python/.github/workflows/pr-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ jobs:
name: 'Classify PR'
runs-on: ubuntu-latest
steps:
- name: 'PR impact specified'
uses: mheap/github-action-required-labels@v4
- name: Checkout Actions
uses: actions/checkout@v3
with:
mode: exactly
count: 1
labels: 'bug, debt, feature-request, no-changelog'
repository: 'microsoft/vscode-github-triage-actions'
ref: stable
path: ./actions

- name: Install Actions
run: npm install --production --prefix ./actions

- name: Classify PR
uses: ./actions/python-pr-labels
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ jobs:
repository: 'microsoft/vscode-github-triage-actions'
path: ./actions
ref: stable

- name: Install Actions
run: npm install --production --prefix ./actions

- name: Run Test Plan Item Validator
uses: ./actions/test-plan-item-validator
with:
Expand Down
101 changes: 28 additions & 73 deletions extensions/positron-python/.github/workflows/triage-info-needed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,86 +11,41 @@ jobs:
add_label:
runs-on: ubuntu-latest
if: contains(github.event.issue.labels.*.name, 'triage-needed') && !contains(github.event.issue.labels.*.name, 'info-needed')
env:
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"]'
steps:
- name: Check for author
uses: actions/github-script@v6
- name: Checkout Actions
uses: actions/checkout@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issue = await github.rest.issues.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
});
const commentAuthor = context.payload.comment.user.login;
const commentBody = context.payload.comment.body;
const isTeamMember = ${{ env.TRIAGERS }}.includes(commentAuthor);
repository: 'microsoft/vscode-github-triage-actions'
ref: stable
path: ./actions

const keywords = ${{ env.KEYWORDS }};
const isRequestForInfo = new RegExp(keywords.join('|'), 'i').test(commentBody);
- name: Install Actions
run: npm install --production --prefix ./actions

const shouldAddLabel = isTeamMember && commentAuthor !== issue.data.user.login && isRequestForInfo;
if (shouldAddLabel) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['info-needed']
});
}
- name: Add "info-needed" label
uses: ./actions/python-triage-info-needed
with:
triagers: ${{ env.TRIAGERS }}
action: 'add'
token: ${{secrets.GITHUB_TOKEN}}

remove_label:
if: contains(github.event.issue.labels.*.name, 'info-needed') && contains(github.event.issue.labels.*.name, 'triage-needed')
runs-on: ubuntu-latest
steps:
- name: Check for author
uses: actions/github-script@v6
- name: Checkout Actions
uses: actions/checkout@v3
with:
repository: 'microsoft/vscode-github-triage-actions'
ref: stable
path: ./actions

- name: Install Actions
run: npm install --production --prefix ./actions

- name: Remove "info-needed" label
uses: ./actions/python-triage-info-needed
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issue = await github.rest.issues.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
});
const commentAuthor = context.payload.comment.user.login;
const issueAuthor = issue.data.user.login;
if (commentAuthor === issueAuthor) {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: 'info-needed'
});
return;
}
if (${{ env.TRIAGERS }}.includes(commentAuthor)) {
// If one of triagers made a comment, ignore it
return;
}
// Loop through all the comments on the issue in reverse order and find the last username that a TRIAGER mentioned
// If the comment author is the last mentioned username, remove the "info-needed" label
const comments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
});
for (const comment of comments.data.slice().reverse()) {
if (!${{ env.TRIAGERS }}.includes(comment.user.login)) {
continue;
}
const matches = comment.body.match(/@\w+/g) || [];
const mentionedUsernames = matches.map(match => match.replace('@', ''));
if (mentionedUsernames.includes(commentAuthor)) {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: 'info-needed'
});
break;
}
}
triagers: ${{ env.TRIAGERS }}
action: 'remove'
token: ${{secrets.GITHUB_TOKEN}}
2 changes: 1 addition & 1 deletion extensions/positron-python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The Python extension does offer [some support](https://github.com/microsoft/vsco

## Installed extensions

The Python extension will automatically install the [Pylance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance) and [Jupyter](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter) extensions to give you the best experience when working with Python files and Jupyter notebooks. However, Pylance is an optional dependency, meaning the Python extension will remain fully functional if it fails to be installed. You can also [uninstall](https://code.visualstudio.com/docs/editor/extension-marketplace#_uninstall-an-extension) it at the expense of some features if you’re using a different language server.
The Python extension will automatically install the [Pylance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance) extension to give you the best experience when working with Python files. However, Pylance is an optional dependency, meaning the Python extension will remain fully functional if it fails to be installed. You can also [uninstall](https://code.visualstudio.com/docs/editor/extension-marketplace#_uninstall-an-extension) it at the expense of some features if you’re using a different language server.

Extensions installed through the marketplace are subject to the [Marketplace Terms of Use](https://cdn.vsassets.io/v/M146_20190123.39/_content/Microsoft-Visual-Studio-Marketplace-Terms-of-Use.pdf).

Expand Down
Loading

0 comments on commit c908a36

Please sign in to comment.