Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply positron-python updates from vscode-python v2024.4.0 #2678

Merged
merged 48 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
3443895
Add more validation checks when accessing envs from cache (microsoft/…
Feb 26, 2024
799006f
Reactivate terminals if `.env` file changes (microsoft/vscode-python#…
Feb 26, 2024
8ce46e0
skip tests, pytest upstream regression (microsoft/vscode-python#22974)
eleanorjboyd Feb 26, 2024
3cee238
Bump release 2024.2 (microsoft/vscode-python#22972)
anthonykim1 Feb 26, 2024
a7d3c27
Update version main branch to pre release (microsoft/vscode-python#22…
anthonykim1 Feb 27, 2024
21df895
Log best effort versions calculated for an environment (microsoft/vsc…
Feb 27, 2024
f5bec75
Log environment collection activity at info level (microsoft/vscode-p…
Feb 28, 2024
38236bc
Remove old Pylance-related code (microsoft/vscode-python#22985)
debonte Feb 29, 2024
0c4f41d
Remove sync file operation to unblock ext host (microsoft/vscode-pyth…
DonJayamanne Feb 29, 2024
ed8bab3
Remove verbose logging which is not used (microsoft/vscode-python#23001)
Feb 29, 2024
e9c1543
chore: add APIScan field (microsoft/vscode-python#23007)
rzhao271 Mar 1, 2024
b51aac1
Make `environments.known` API faster (microsoft/vscode-python#23010)
Mar 1, 2024
44d8f90
Do not use readSync everytime telemetry is sent (microsoft/vscode-pyt…
Mar 1, 2024
14d7156
Rename `pythonFiles` to `python_files` (microsoft/vscode-python#22921)
karthiknadig Mar 1, 2024
db2cf97
Update release_plan.md (microsoft/vscode-python#22973)
eleanorjboyd Feb 27, 2024
7103a45
Fix duplicated environments in interpreter list (microsoft/vscode-pyt…
Feb 26, 2024
124d2d4
fixes bug which stops duplicate pytest args (microsoft/vscode-python#…
eleanorjboyd Mar 4, 2024
5991d5f
Updating devcontainer.json and README.md (microsoft/vscode-python#22984)
cwebster-99 Mar 4, 2024
1d40aac
Fix backed up command and false exit code (microsoft/vscode-python#23…
anthonykim1 Mar 4, 2024
ecdaed3
Do not use worker threads to launching binaries (microsoft/vscode-pyt…
Mar 6, 2024
66cdd29
Add `server_side_request` to `telemetry\pylance.ts` (microsoft/vscode…
debonte Mar 7, 2024
79d4dea
Add linting rules for ruff (microsoft/vscode-python#22741)
brettcannon Mar 12, 2024
b8c0267
Move to Ruff for formatting (microsoft/vscode-python#23060)
brettcannon Mar 12, 2024
31bd010
Ignore reformatting commits in `git blame` (microsoft/vscode-python#2…
brettcannon Mar 13, 2024
6f6e4cf
Use new report issue command api (microsoft/vscode-python#23033)
paulacamargo25 Mar 13, 2024
6d74b7a
Take Smart Send Out of Experiment (microsoft/vscode-python#23067)
anthonykim1 Mar 14, 2024
27a1f4d
Include windows registry perf improvement in `pythonDiscoveryUsingWor…
Mar 14, 2024
b7b7003
Clear duplicated environments from storage (microsoft/vscode-python#2…
Mar 14, 2024
e5a986e
Smart Send default value should be true (microsoft/vscode-python#23074)
anthonykim1 Mar 14, 2024
3ba069f
Add support for Hatch environments (microsoft/vscode-python#22779)
flying-sheep Mar 15, 2024
f76905d
Respect `VIRTUAL_ENV_PROMPT` when calculating PS1 (microsoft/vscode-p…
Mar 15, 2024
6b377d9
If type identifier for an environment is not registered, infer type f…
Mar 17, 2024
2fbeac9
Double quote value returned by `${command:python.interpreterPath}` if…
Mar 17, 2024
bd2a665
Engineering - cleanup TSA pipeline template parameter (microsoft/vsco…
lszomoru Mar 18, 2024
00092b7
Upgrade to latest prerelease LSP 3.18 (python) (microsoft/vscode-pyth…
debonte Mar 18, 2024
40c64a6
Select pyenv environment based on folder `.python-version` file (micr…
Mar 18, 2024
bddb32f
Use random sampling for sending Python environments API telemetry (mi…
Mar 20, 2024
273e300
Auto select pipenv and poetry environments created for a workspace (m…
Mar 21, 2024
69fa364
Updates to walkthrough (microsoft/vscode-python#23107)
cwebster-99 Mar 22, 2024
d122b31
Address localization bug in walkthrough (microsoft/vscode-python#23112)
cwebster-99 Mar 22, 2024
c55a3d5
Add workaround for hatch environment discovery on Windows (microsoft/…
Mar 26, 2024
bb90387
Fix Pyenv auto-selection on MacOS (microsoft/vscode-python#23132)
anthonykim1 Mar 26, 2024
d1fa798
Change default value of env settings (microsoft/vscode-python#23144)
luabud Mar 28, 2024
a4a6cd1
Resolve test suite execution import errors due to path ordering (micr…
shanesaravia Mar 29, 2024
fe8a335
Update release_plan.md (microsoft/vscode-python#23149)
eleanorjboyd Mar 29, 2024
c3ee526
revert symlink changes which switched to using argMap for testing arg…
eleanorjboyd Apr 1, 2024
d304a6f
revert arg map change to remove from stable release (microsoft/vscode…
eleanorjboyd Apr 1, 2024
dd08d81
Move positron files to python_files, reformat with Ruff, and make
wesm Apr 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 11 additions & 16 deletions .github/workflows/positron-python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ env:
NODE_VERSION: '18.17.1'
PYTHON_VERSION: '3.10'
PROJECT_DIR: 'extensions/positron-python'
PYTHON_SRC_DIR: 'extensions/positron-python/pythonFiles'
PYTHON_SRC_DIR: 'extensions/positron-python/python_files'
# Force a path with spaces and to test extension works in these scenarios
# Unicode characters are causing 2.7 failures so skip that for now.
special-working-directory: './path with spaces'
Expand Down Expand Up @@ -67,16 +67,11 @@ jobs:
- name: Check TypeScript format
run: yarn format-check

- name: Check Python format
run: |
python -m pip install -U black
python -m black . --check
working-directory: ${{ env.PYTHON_SRC_DIR }}

- name: Run Ruff
- name: Lint and Check Formatting with Ruff
run: |
python -m pip install -U ruff
python -m ruff check .
python -m ruff format --check
working-directory: ${{ env.PYTHON_SRC_DIR }}

check-types:
Expand All @@ -93,16 +88,16 @@ jobs:
cache: 'pip'

- name: Install base Python requirements
run: 'python -m pip install --no-deps --require-hashes --only-binary :all: -t ./pythonFiles/lib/python --no-cache-dir --implementation py -r requirements.txt'
run: 'python -m pip install --no-deps --require-hashes --only-binary :all: -t ./python_files/lib/python --no-cache-dir --implementation py -r requirements.txt'

- name: Install Positron IPyKernel requirements
run: python scripts/vendor.py

- name: Install other Python requirements
run: |
python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy
python -m pip --disable-pip-version-check install -t ./python_files/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy
python -m pip install --upgrade -r build/test-requirements.txt
python -m pip install --upgrade -r ./pythonFiles/positron/pinned-test-requirements.txt
python -m pip install --upgrade -r ./python_files/positron/pinned-test-requirements.txt

- name: Run Pyright
uses: jakebailey/pyright-action@v2
Expand Down Expand Up @@ -169,13 +164,13 @@ jobs:
run: python -m pytest --version

- name: Install base Python requirements
run: 'python -m pip install --no-deps --require-hashes --only-binary :all: -t ./pythonFiles/lib/python --no-cache-dir --implementation py -r requirements.txt'
run: 'python -m pip install --no-deps --require-hashes --only-binary :all: -t ./python_files/lib/python --no-cache-dir --implementation py -r requirements.txt'

- name: Install test requirements
run: python -m pip install -r build/test-requirements.txt

- name: Run Python unit tests
run: python pythonFiles/tests/run_all.py
run: python python_files/tests/run_all.py

positron-ipykernel-tests:
name: Test Positron IPyKernel
Expand Down Expand Up @@ -225,7 +220,7 @@ jobs:
run: python scripts/vendor.py

- name: Install Positron IPyKernel test requirements
run: python -m pip install --prefer-binary --upgrade -r pythonFiles/positron/pinned-test-requirements.txt
run: python -m pip install --prefer-binary --upgrade -r python_files/positron/pinned-test-requirements.txt

- name: Get date for older dependencies
if: ${{ matrix.time-elapsed != '' }}
Expand All @@ -237,10 +232,10 @@ jobs:
run: |
python -m pip config set global.index-url https://packagemanager.posit.co/pypi/${{ env.SNAPSHOT_DATE }}/simple
python -m pip config set global.trusted-host packagemanager.posit.co
python -m pip install --prefer-binary --force-reinstall -r pythonFiles/positron/data-science-requirements.txt
python -m pip install --prefer-binary --force-reinstall -r python_files/positron/data-science-requirements.txt

- name: Run Positron IPyKernel unit tests
run: pytest pythonFiles/positron
run: pytest python_files/positron

typescript-tests:
name: Test TypeScript
Expand Down
4 changes: 2 additions & 2 deletions extensions/positron-python/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
"customizations": {
"vscode": {
"extensions": [
"charliermarsh.ruff",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"ms-python.python",
"ms-python.black-formatter",
"ms-python.vscode-pylance",
"charliermarsh.ruff"
"ms-python.debugpy"
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion extensions/positron-python/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ src/test/common/process/proc.unit.test.ts
src/test/common/interpreterPathService.unit.test.ts


src/test/pythonFiles/formatting/dummy.ts
src/test/python_files/formatting/dummy.ts

src/test/debugger/extension/adapter/adapter.test.ts
src/test/debugger/extension/adapter/outdatedDebuggerPrompt.unit.test.ts
Expand Down
15 changes: 15 additions & 0 deletions extensions/positron-python/.git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Prettier
2b6a8f2d439fe9d5e66665ea46d8b690ac9b2c39
649156a09ccdc51c0d20f7cd44540f1918f9347b
4f774d94bf4fbf87bb417b2b2b8e79e334eb3536
61b179b2092050709e3c373a6738abad8ce581c4
c33617b0b98daeb4d72040b48c5850b476d6256c
db8e1e2460e9754ec0672d958789382b6d15c5aa
08bc9ad3bee5b19f02fa756fbc53ab32f1b39920
# Black
a58eeffd1b64498e2afe5f11597888dfd1c8699c
5cd8f539f4d2086b718c8f11f823c0ac12fc2c49
9ec9e9eaebb25adc6d942ac19d4d6c128abb987f
c4af91e090057d20d7a633b3afa45eaa13ece76f
# Ruff
e931bed3efbede7b05113316506958ecd7506777
12 changes: 6 additions & 6 deletions extensions/positron-python/.github/actions/build-vsix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ runs:
cache-dependency-path: |
requirements.txt
build/build-install-requirements.txt
pythonFiles/jedilsp_requirements/requirements.txt
python_files/jedilsp_requirements/requirements.txt

- name: Upgrade Pip
run: python -m pip install -U pip
Expand All @@ -44,20 +44,20 @@ runs:
- name: Install Python dependencies
uses: brettcannon/pip-secure-install@v1
with:
options: '-t ./pythonFiles/lib/python --implementation py'
options: '-t ./python_files/lib/python --implementation py'

- name: Install debugpy and get-pip
run: |
python -m pip --disable-pip-version-check install packaging
python ./pythonFiles/install_debugpy.py
python ./pythonFiles/download_get_pip.py
python ./python_files/install_debugpy.py
python ./python_files/download_get_pip.py
shell: bash

- name: Install Jedi LSP
uses: brettcannon/pip-secure-install@v1
with:
requirements-file: './pythonFiles/jedilsp_requirements/requirements.txt'
options: '-t ./pythonFiles/lib/jedilsp --implementation py --platform any --abi none'
requirements-file: './python_files/jedilsp_requirements/requirements.txt'
options: '-t ./python_files/lib/jedilsp --implementation py --platform any --abi none'

- name: Run npm ci
run: npm ci --prefer-offline
Expand Down
10 changes: 2 additions & 8 deletions extensions/positron-python/.github/actions/lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,10 @@ runs:
python-version: '3.x'
cache: 'pip'

- name: Check Python format
run: |
python -m pip install -U black
python -m black . --check
working-directory: pythonFiles
shell: bash

- name: Run Ruff
run: |
python -m pip install -U ruff
python -m ruff check .
working-directory: pythonFiles
python -m ruff format --check
working-directory: python_files
shell: bash
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ runs:
- name: Install Python requirements
uses: brettcannon/pip-secure-install@v1
with:
options: '-t ./pythonFiles/lib/python --implementation py'
options: '-t ./python_files/lib/python --implementation py'

- name: pip install system test requirements
run: |
python -m pip install --upgrade -r build/test-requirements.txt
python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --implementation py --no-deps --upgrade --pre debugpy
python -m pip --disable-pip-version-check install -t ./python_files/lib/python --implementation py --no-deps --upgrade --pre debugpy
shell: bash

# Bits from the VSIX are reused by smokeTest.ts to speed things up.
Expand Down
24 changes: 22 additions & 2 deletions extensions/positron-python/.github/release_plan.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,34 @@
### General Notes
All dates should align with VS Code's [iteration](https://github.com/microsoft/vscode/labels/iteration-plan) and [endgame](https://github.com/microsoft/vscode/labels/endgame-plan) plans.

Feature freeze is Monday @ 17:00 America/Vancouver, XXX XX. At that point, commits to `main` should only be in response to bugs found during endgame testing until the release candidate is ready.

<details>
<summary>Release Primary and Secondary Assignments for the 2024 Calendar Year</summary>

NOTE: the number of this release is in the issue title and can be substituted in wherever you see [YYYY.minor].
| Month | Primary | Secondary |
|:----------|:----------|:------------|
✅ | ~~January~~ | ~~Eleanor~~ | ~~Karthik~~ |
✅ | February | Kartik | Anthony |
| March | Karthik | Eleanor |
| April | Paula | Kartik |
| May | Anthony | Karthik |
| June | Eleanor | Paula |
| July | Anthony | Karthik |
| August | Paula | Kartik |
| September | Anthony | Eleanor |
| October | Paula | Kartik |
| November | Kartik | Eleanor |
| December | Karthik | Anthony |

</details>


# Release candidate (Monday, XXX XX)

NOTE: Third Party Notices are automatically added by our build pipelines using https://tools.opensource.microsoft.com/notice.
NOTE: the number of this release is in the issue title and can be substituted in wherever you see [YYYY.minor].


### Step 1:
##### Bump the version of `main` to be a release candidate (also updating debugpy dependences, third party notices, and package-lock.json).❄️ (steps with ❄️ will dictate this step happens while main is frozen 🥶)
Expand All @@ -17,7 +37,7 @@ NOTE: Third Party Notices are automatically added by our build pipelines using
- [ ] Create a new branch called **`bump-release-[YYYY.minor]`**.
- [ ] Change the version in `package.json` to the next **even** number and switch the `-dev` to `-rc`. (🤖)
- [ ] Run `npm install` to make sure `package-lock.json` is up-to-date _(you should now see changes to the `package.json` and `package-lock.json` at this point which update the version number **only**)_. (🤖)
- [ ] Check [debugpy on PyPI](https://pypi.org/project/debugpy/) for a new release and update the version of debugpy in [`install_debugpy.py`](https://github.com/microsoft/vscode-python/blob/main/pythonFiles/install_debugpy.py) if necessary.
- [ ] Check [debugpy on PyPI](https://pypi.org/project/debugpy/) for a new release and update the version of debugpy in [`install_debugpy.py`](https://github.com/microsoft/vscode-python/blob/main/python_files/install_debugpy.py) if necessary.
- [ ] Update `ThirdPartyNotices-Repository.txt` as appropriate. You can check by looking at the [commit history](https://github.com/microsoft/vscode-python/commits/main) and scrolling through to see if there's anything listed there which might have pulled in some code directly into the repository from somewhere else. If you are still unsure you can check with the team.
- [ ] Create a PR from your branch **`bump-release-[YYYY.minor]`** to `main`. Add the `"no change-log"` tag to the PR so it does not show up on the release notes before merging it.

Expand Down
18 changes: 9 additions & 9 deletions extensions/positron-python/.github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,21 @@ jobs:
- name: Install core Python requirements
uses: brettcannon/pip-secure-install@v1
with:
options: '-t ./pythonFiles/lib/python --no-cache-dir --implementation py'
options: '-t ./python_files/lib/python --no-cache-dir --implementation py'

- name: Install Jedi requirements
run: python scripts/vendor.py

- name: Install other Python requirements
run: |
python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy
python -m pip --disable-pip-version-check install -t ./python_files/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy
python -m pip install --upgrade -r build/test-requirements.txt

- name: Run Pyright
uses: jakebailey/pyright-action@v2
with:
version: 1.1.308
working-directory: 'pythonFiles'
working-directory: 'python_files'

python-tests:
name: Python Tests
Expand Down Expand Up @@ -134,13 +134,13 @@ jobs:
uses: brettcannon/pip-secure-install@v1
with:
requirements-file: '"${{ env.special-working-directory-relative }}/requirements.txt"'
options: '-t "${{ env.special-working-directory-relative }}/pythonFiles/lib/python" --no-cache-dir --implementation py'
options: '-t "${{ env.special-working-directory-relative }}/python_files/lib/python" --no-cache-dir --implementation py'

- name: Install test requirements
run: python -m pip install --upgrade -r build/test-requirements.txt

- name: Run Python unit tests
run: python pythonFiles/tests/run_all.py
run: python python_files/tests/run_all.py

tests:
name: Tests
Expand Down Expand Up @@ -189,19 +189,19 @@ jobs:
run: |
python -m pip install wheel
python -m pip install -r build/build-install-requirements.txt
python ./pythonFiles/download_get_pip.py
python ./python_files/download_get_pip.py
shell: bash

- name: Install debugpy
run: |
# We need to have debugpy so that tests relying on it keep passing, but we don't need install_debugpy's logic in the test phase.
python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy
python -m pip --disable-pip-version-check install -t ./python_files/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy

- name: Install core Python requirements
uses: brettcannon/pip-secure-install@v1
with:
requirements-file: '"${{ env.special-working-directory-relative }}/requirements.txt"'
options: '-t "${{ env.special-working-directory-relative }}/pythonFiles/lib/python" --no-cache-dir --implementation py'
options: '-t "${{ env.special-working-directory-relative }}/python_files/lib/python" --no-cache-dir --implementation py'
if: startsWith(matrix.python, 3.)

- name: Install Jedi requirements
Expand All @@ -215,7 +215,7 @@ jobs:
run: |
python -m pip install wheel
python -m pip install -r build/build-install-requirements.txt
python ./pythonFiles/install_debugpy.py
python ./python_files/install_debugpy.py
shell: bash
if: matrix.test-suite == 'debugger'

Expand Down
Loading
Loading