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

python: use Python Environment Tools for interpreter discovery #5897

Draft
wants to merge 33 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2d1658c
install PET in CI
isabelizimm Jan 7, 2025
72ce282
install nox into ci
isabelizimm Jan 7, 2025
5d4a4cf
take into account different wd for ts tests
isabelizimm Jan 7, 2025
3e317cb
specify which noxfile
isabelizimm Jan 7, 2025
9c2ddba
use actions for smoke tests to build vsix
isabelizimm Jan 8, 2025
c8db8b0
correct path name
isabelizimm Jan 8, 2025
06d13d4
cd into positron-python every time(?)
isabelizimm Jan 8, 2025
f1d2c1f
format yml
isabelizimm Jan 8, 2025
8b247ed
place pet in project dir
isabelizimm Jan 8, 2025
8ba5db2
do not clone with special-working-dir
isabelizimm Jan 9, 2025
77efe40
debug where vsix is
isabelizimm Jan 9, 2025
55b7461
rm tmate session
isabelizimm Jan 9, 2025
c0ddffb
move to ext dir
isabelizimm Jan 9, 2025
b01e189
try quotes perhaps
isabelizimm Jan 9, 2025
383cf53
try to move file again
isabelizimm Jan 9, 2025
c5a64c9
using working-directory arg
isabelizimm Jan 9, 2025
018cd9f
no working dir for upload
isabelizimm Jan 9, 2025
2d9ca1b
use cp instead of mv
isabelizimm Jan 10, 2025
c57dca8
upload vsix for smoke tests
isabelizimm Jan 10, 2025
db5cf4c
update paths for smoke tests
isabelizimm Jan 10, 2025
69dbdb1
include version in interpreter name
isabelizimm Jan 13, 2025
aed1167
add pet specific tests
isabelizimm Jan 13, 2025
5dcf7bf
include PROJECT_DIR for cargo tests
isabelizimm Jan 13, 2025
ad4dbb1
scripts to download and unzip python-env-tools
isabelizimm Jan 14, 2025
8fc277c
script to build pet
isabelizimm Jan 14, 2025
b6f7586
copyright headers
isabelizimm Jan 14, 2025
89b0949
use positron-pet-builds
isabelizimm Jan 22, 2025
57ad325
update e2e test
isabelizimm Jan 22, 2025
afa542e
Merge branch 'main' into pet-python
isabelizimm Jan 22, 2025
f1ace23
move test to new dir
isabelizimm Jan 22, 2025
74040e9
add post-install script
isabelizimm Jan 23, 2025
a683063
Merge branch 'main' into pet-python
isabelizimm Jan 24, 2025
8ce1c69
adjust imports for install
isabelizimm Jan 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/actions/install-pet/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Setup Python Environment Tools"
description: "Install and build microsoft/python-environment-tools"

defaults:
run:
working-directory: 'extensions/positron-python'

runs:
using: "composite"
steps:
- 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: Rust Tool Chain setup
uses: dtolnay/rust-toolchain@stable

- name: Build Native Binaries
run: nox --session native_build
shell: bash
1 change: 1 addition & 0 deletions .github/actions/install-python/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ runs:
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install ipykernel trcli
python -m pip install nox

- name: Verify Python Version
shell: bash
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/setup-test-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ runs:
with:
version: "3.10"

- name: Setup Python Environment Tools
uses: ./.github/actions/install-pet

- name: Setup R
uses: ./.github/actions/install-r
with:
Expand Down
22 changes: 21 additions & 1 deletion .github/workflows/positron-python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,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 ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
Expand All @@ -267,7 +278,16 @@ jobs:
run: npx @vscode/l10n-dev@latest export ./src

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

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

- name: Build Native Binaries
run: nox --session native_build
shell: bash

- name: Install functional test requirements
run: python -m pip install --upgrade -r ./build/functional-test-requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion extensions/positron-python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@
"type": "string"
},
"python.locator": {
"default": "js",
"default": "native",
Copy link
Contributor Author

@isabelizimm isabelizimm Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, the rust locator is considered experimental and is opt-in only for upstream. I've swapped it for testing purposes, but we'll want to decide what we want as the default. I've played around with it locally, and it seems to be finding everything and is MUCH FASTER, eg, 1-3 seconds to find my 80+ envs. We should do a bit more robust testing before deciding though.

"description": "%python.locator.description%",
"enum": [
"js",
Expand Down
Loading