Skip to content

Commit

Permalink
Apply vscode-python changes from v2024.6.0 to v2024.10.0 (#3790)
Browse files Browse the repository at this point in the history
The latest release has been finalized at
https://github.com/microsoft/vscode-python/tree/release/2024.10.

The new env locator is housed at
https://github.com/microsoft/python-environment-tools. The least
invasive thing to do for now would be to host builds on GitHub and
download then at yarn time like we do for Ark.

There are also a handful of other changes having to do with the terminal
REPL in vscode-python, so we should investigate those to make sure I
didn't break anything when resolving the merge conflicts.

---------

Co-authored-by: positron-bot[bot] <173392469+positron-bot[bot]@users.noreply.github.com>
Co-authored-by: Jonathan McPherson <jonathan@rstudio.com>
  • Loading branch information
3 people authored Jul 19, 2024
1 parent 1e125e9 commit af322f2
Show file tree
Hide file tree
Showing 133 changed files with 5,979 additions and 501 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/positron-python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defaults:
working-directory: 'extensions/positron-python'

env:
NODE_VERSION: '18.17.1'
NODE_VERSION: '20.12.1'
PYTHON_VERSION: '3.10'
PROJECT_DIR: 'extensions/positron-python'
PYTHON_SRC_DIR: 'extensions/positron-python/python_files'
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
cache: 'pip'

- name: Install Node dependencies
run: yarn install --immutable --network-timeout 120000 --prefer-offline
run: yarn --immutable --network-timeout 120000

- name: Run `gulp prePublishNonBundle`
run: yarn prePublish
Expand Down Expand Up @@ -263,7 +263,7 @@ jobs:
cache: 'pip'

- name: Install Node dependencies
run: yarn install --immutable --network-timeout 120000 --prefer-offline
run: yarn --immutable --network-timeout 120000

- name: Run `gulp prePublishNonBundle`
run: yarn prePublish
Expand Down
34 changes: 26 additions & 8 deletions extensions/positron-python/.github/actions/build-vsix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ inputs:
artifact_name:
description: 'Name to give the artifact containing the VSIX'
required: true
cargo_target:
description: 'Cargo build target for the native build'
required: true
vsix_target:
description: 'vsix build target for the native build'
required: true

runs:
using: 'composite'
Expand All @@ -21,6 +27,9 @@ runs:
node-version: ${{ inputs.node_version }}
cache: 'npm'

- name: Rust Tool Chain setup
uses: dtolnay/rust-toolchain@stable

# Jedi LS depends on dataclasses which is not in the stdlib in Python 3.7.
- name: Use Python 3.8 for JediLSP
uses: actions/setup-python@v5
Expand All @@ -44,23 +53,32 @@ runs:
run: nox --session install_python_libs
shell: bash

- name: Run npm ci
run: npm ci --prefer-offline
- name: Add Rustup target
run: rustup target add ${{ inputs.cargo_target }}
shell: bash

# Use the GITHUB_RUN_ID environment variable to update the build number.
# GITHUB_RUN_ID is a unique number for each run within a repository.
# This number does not change if you re-run the workflow run.
- name: Update extension build number
run: npm run updateBuildNumber -- --buildNumber $GITHUB_RUN_ID
- name: Build Native Binaries
run: nox --session native_build
shell: bash
env:
CARGO_TARGET: ${{ inputs.cargo_target }}

- name: Run npm ci
run: npm ci --prefer-offline
shell: bash

- name: Update optional extension dependencies
run: npm run addExtensionPackDependencies
shell: bash

- name: Build Webpack
run: |
npx gulp clean
npx gulp prePublishBundle
shell: bash

- name: Build VSIX
run: npm run package
run: npx vsce package --target ${{ inputs.vsix_target }} --out ms-python-insiders.vsix --pre-release
shell: bash

- name: Rename VSIX
Expand Down
22 changes: 13 additions & 9 deletions extensions/positron-python/.github/release_plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,23 @@ Feature freeze is Monday @ 17:00 America/Vancouver, XXX XX. At that point, commi
| Month | Primary | Secondary |
|:----------|:----------|:------------|
✅ | ~~January~~ | ~~Eleanor~~ | ~~Karthik~~ |
✅ | February | Kartik | Anthony |
| March | Karthik | Eleanor |
| April | Paula | Kartik |
✅ | ~~February~~ | ~~Kartik~~ | ~~Anthony~~ |
✅| ~~March~~ | ~~Karthik~~ | ~~Eleanor~~ |
✅| ~~April~~ | ~~Paula~~ | ~~Eleanor~~ |
| May | Anthony | Karthik |
| June | Eleanor | Paula |
| July | Anthony | Karthik |
| August | Paula | Kartik |
| August | Paula | Anthony |
| September | Anthony | Eleanor |
| October | Paula | Kartik |
| November | Kartik | Eleanor |
| October | Paula | Karthik |
| November | Eleanor | Paula |
| December | Karthik | Anthony |

Paula: 3 primary, 2 secondary
Eleanor: 3 primary (2 left), 3 secondary (2 left)
Anthony: 2 primary, 3 secondary (2 left)
Karthik: 2 primary (1 left), 4 secondary (3 left)

</details>


Expand All @@ -31,13 +36,12 @@ NOTE: the number of this release is in the issue title and can be substituted in


### 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 🥶)
##### Bump the version of `main` to be a release candidate (also updating third party notices, and package-lock.json).❄️ (steps with ❄️ will dictate this step happens while main is frozen 🥶)

- [ ] checkout to `main` on your local machine and run `git fetch` to ensure your local is up to date with the remote repo.
- [ ] 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/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 Expand Up @@ -136,4 +140,4 @@ NOTE: this PR should make all CI relating to `main` be passing again (such as th
## Prep for the _next_ release

- [ ] Create a new [release plan](https://raw.githubusercontent.com/microsoft/vscode-python/main/.github/release_plan.md). (🤖)
- [ ] [(Un-)pin](https://help.github.com/en/articles/pinning-an-issue-to-your-repository) [release plan issues](https://github.com/Microsoft/vscode-python/labels/release%20plan) (🤖)
- [ ] [(Un-)pin](https://help.github.com/en/articles/pinning-an-issue-to-your-repository) [release plan issues](https://github.com/Microsoft/vscode-python/labels/release-plan) (🤖)
85 changes: 79 additions & 6 deletions extensions/positron-python/.github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
run:
shell: python
outputs:
vsix_basename: ${{ steps.vsix_names.outputs.vsix_basename }}
vsix_name: ${{ steps.vsix_names.outputs.vsix_name }}
vsix_artifact_name: ${{ steps.vsix_names.outputs.vsix_artifact_name }}
steps:
Expand All @@ -40,23 +41,68 @@ jobs:
else:
vsix_type = "release"
print(f"::set-output name=vsix_name::ms-python-{vsix_type}.vsix")
print(f"::set-output name=vsix_basename::ms-python-{vsix_type}")
print(f"::set-output name=vsix_artifact_name::ms-python-{vsix_type}-vsix")
build-vsix:
name: Create VSIX
if: github.repository == 'microsoft/vscode-python'
needs: setup
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
vsix-target: win32-x64
- os: windows-latest
target: aarch64-pc-windows-msvc
vsix-target: win32-arm64
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
vsix-target: linux-x64
# - os: ubuntu-latest
# target: aarch64-unknown-linux-gnu
# vsix-target: linux-arm64
# - os: ubuntu-latest
# target: arm-unknown-linux-gnueabihf
# vsix-target: linux-armhf
# - os: macos-latest
# target: x86_64-apple-darwin
# vsix-target: darwin-x64
# - os: macos-14
# target: aarch64-apple-darwin
# vsix-target: darwin-arm64
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
vsix-target: alpine-x64
# - os: ubuntu-latest
# target: aarch64-unknown-linux-musl
# vsix-target: alpine-arm64
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Checkout Python Environment Tools
uses: actions/checkout@v4
with:
repository: 'microsoft/python-environment-tools'
path: 'python-env-tools'
sparse-checkout: |
crates
Cargo.toml
Cargo.lock
sparse-checkout-cone-mode: false

- name: Build VSIX
uses: ./.github/actions/build-vsix
with:
node_version: ${{ env.NODE_VERSION }}
vsix_name: ${{ needs.setup.outputs.vsix_name }}
artifact_name: ${{ needs.setup.outputs.vsix_artifact_name }}
node_version: ${{ env.NODE_VERSION}}
vsix_name: ${{ needs.setup.outputs.vsix_basename }}-${{ matrix.vsix-target }}.vsix
artifact_name: ${{ needs.setup.outputs.vsix_artifact_name }}-${{ matrix.vsix-target }}
cargo_target: ${{ matrix.target }}
vsix_target: ${{ matrix.vsix-target }}

lint:
name: Lint
Expand Down Expand Up @@ -163,6 +209,17 @@ jobs:
with:
path: ${{ env.special-working-directory-relative }}

- name: Checkout Python Environment Tools
uses: actions/checkout@v4
with:
repository: 'microsoft/python-environment-tools'
path: ${{ env.special-working-directory-relative }}/python-env-tools
sparse-checkout: |
crates
Cargo.toml
Cargo.lock
sparse-checkout-cone-mode: false

- name: Install Node
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -339,13 +396,29 @@ jobs:
matrix:
# We're not running CI on macOS for now because it's one less matrix entry to lower the number of runners used,
# macOS runners are expensive, and we assume that Ubuntu is enough to cover the UNIX case.
os: [ubuntu-latest, windows-latest]
include:
- os: windows-latest
vsix-target: win32-x64
- os: ubuntu-latest
vsix-target: linux-x64

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Checkout Python Environment Tools
uses: actions/checkout@v4
with:
repository: 'microsoft/python-environment-tools'
path: ${{ env.special-working-directory-relative }}/python-env-tools
sparse-checkout: |
crates
Cargo.toml
Cargo.lock
sparse-checkout-cone-mode: false

- name: Smoke tests
uses: ./.github/actions/smoke-tests
with:
node_version: ${{ env.NODE_VERSION }}
artifact_name: ${{ needs.setup.outputs.vsix_artifact_name }}
artifact_name: ${{ needs.setup.outputs.vsix_artifact_name }}-${{ matrix.vsix-target }}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
types: [trigger-needs-more-info]
workflow_dispatch:

permissions:
issues: write

jobs:
main:
runs-on: ubuntu-latest
Expand Down
Loading

0 comments on commit af322f2

Please sign in to comment.