Skip to content

Commit

Permalink
Add support for Python Environment Tools (#23643)
Browse files Browse the repository at this point in the history
Closes microsoft#23564

---------

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>
  • Loading branch information
2 people authored and DonJayamanne committed Jun 24, 2024
1 parent 29652d3 commit 03b9701
Show file tree
Hide file tree
Showing 89 changed files with 527 additions and 4,358 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,17 @@ jobs:
- 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:
Expand Down Expand Up @@ -201,6 +212,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 @@ -387,6 +409,17 @@ jobs:
- 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:
Expand Down
70 changes: 68 additions & 2 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ jobs:
- 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:
Expand Down Expand Up @@ -90,6 +101,17 @@ jobs:
- 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: Install base Python requirements
uses: brettcannon/pip-secure-install@v1
with:
Expand Down Expand Up @@ -186,6 +208,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 @@ -363,9 +396,20 @@ jobs:
with:
path: ${{ env.special-working-directory-relative }}

- name: Native Locator tests
- 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: Python Environment Tools tests
run: cargo test -- --nocapture
working-directory: ${{ env.special-working-directory }}/native_locator
working-directory: ${{ env.special-working-directory }}/python-env-tools

smoke-tests:
name: Smoke tests
Expand All @@ -388,6 +432,17 @@ jobs:
- 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: Smoke tests
uses: ./.github/actions/smoke-tests
with:
Expand All @@ -409,6 +464,17 @@ jobs:
- 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: Install Node
uses: actions/setup-node@v4
with:
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,4 @@ dist/**
*.xlf
package.nls.*.json
l10n/
native_locator/target/**
native_locator/Cargo.lock
python-env-tools/**
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"rust-analyzer.linkedProjects": [
".\\native_locator\\Cargo.toml"
".\\python-env-tools\\Cargo.toml"
]
}
11 changes: 5 additions & 6 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@ test/**
tmp/**
typings/**
types/**
native_locator/.vscode/**
native_locator/src/**
native_locator/tests/**
native_locator/bin/**
native_locator/target/**
native_locator/Cargo.*
python-env-tools/.github/**
python-env-tools/.vscode/**
python-env-tools/crates/**
python-env-tools/target/**
python-env-tools/Cargo.*
93 changes: 79 additions & 14 deletions build/azure-pipeline.pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ resources:
ref: main
endpoint: Monaco

- repository: python-environment-tools
type: github
name: microsoft/python-environment-tools
ref: main
endpoint: Monaco


parameters:
- name: publishExtension
displayName: 🚀 Publish Extension
Expand All @@ -30,7 +37,48 @@ extends:
publishExtension: ${{ parameters.publishExtension }}
ghCreateTag: false
l10nSourcePaths: ./src/client
sourceRepositoriesToScan:
include:
- repository: python-environment-tools
exclude:
- repository: translations

buildPlatforms:
- name: Linux
vsceTarget: 'web'
# - name: Linux
# packageArch: arm64
# vsceTarget: linux-arm64
# - name: Linux
# packageArch: arm
# vsceTarget: linux-armhf
- name: Linux
packageArch: x64
vsceTarget: linux-x64
# - name: Linux
# packageArch: arm64
# vsceTarget: alpine-arm64
- name: Linux
packageArch: x64
vsceTarget: alpine-x64
- name: MacOS
packageArch: arm64
vsceTarget: darwin-arm64
- name: MacOS
packageArch: x64
vsceTarget: darwin-x64
- name: Windows
packageArch: arm
vsceTarget: win32-arm64
- name: Windows
packageArch: x64
vsceTarget: win32-x64

buildSteps:
- checkout: self
displayName: Checkout Python Extension
path: ./s

- task: NodeTool@0
inputs:
versionSpec: '18.17.1'
Expand All @@ -43,37 +91,54 @@ extends:
architecture: 'x64'
displayName: Select Python version

- script: npm ci
displayName: Install NPM dependencies

- script: python -m pip install -U pip
displayName: Upgrade pip

- script: python -m pip install wheel nox
displayName: Install wheel and nox

- script: |
nox --session install_python_libs
- script: npm ci
displayName: Install NPM dependencies

- script: nox --session install_python_libs
displayName: Install Jedi, get-pip, etc

- script: |
python ./build/update_ext_version.py --for-publishing
- script: python ./build/update_ext_version.py --for-publishing
displayName: Update build number

- script: |
python ./build/update_package_file.py
- script: python ./build/update_package_file.py
displayName: Update telemetry in package.json

- script: npm run addExtensionPackDependencies
displayName: Update optional extension dependencies

- script: gulp prePublishBundle
- script: npx gulp prePublishBundle
displayName: Build

- checkout: python-environment-tools
displayName: Checkout python-environment-tools
path: ./s/python-env-tools

- script: nox --session azure_pet_build_before
displayName: Enable cargo config for azure

- template: azure-pipelines/extension/templates/steps/build-extension-rust-package.yml@templates
parameters:
vsceTarget: $(vsceTarget)
binaryName: pet
signing: true
workingDirectory: $(Build.SourcesDirectory)/python-env-tools
buildWasm: false
runTest: false

- script: nox --session azure_pet_build_after
displayName: Move bin to final location

- script: python -c "import shutil; shutil.rmtree('.nox', ignore_errors=True)"
displayName: Clean up Nox

tsa:
config:
areaPath: 'Visual Studio Code Python Extensions'
serviceTreeID: '6e6194bc-7baa-4486-86d0-9f5419626d46'
enabled: true
config:
areaPath: 'Visual Studio Code Python Extensions'
serviceTreeID: '6e6194bc-7baa-4486-86d0-9f5419626d46'
enabled: true
3 changes: 0 additions & 3 deletions native_locator/.vscode/settings.json

This file was deleted.

23 changes: 0 additions & 23 deletions native_locator/Cargo.toml

This file was deleted.

Loading

0 comments on commit 03b9701

Please sign in to comment.