Skip to content

Commit daebb5c

Browse files
Add support for Python Environment Tools (#23643)
Closes #23564 --------- Co-authored-by: Raymond Zhao <[email protected]>
1 parent 6138ff8 commit daebb5c

File tree

89 files changed

+527
-4358
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+527
-4358
lines changed

.github/workflows/build.yml

+33
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,17 @@ jobs:
8484
- name: Checkout
8585
uses: actions/checkout@v4
8686

87+
- name: Checkout Python Environment Tools
88+
uses: actions/checkout@v4
89+
with:
90+
repository: 'microsoft/python-environment-tools'
91+
path: 'python-env-tools'
92+
sparse-checkout: |
93+
crates
94+
Cargo.toml
95+
Cargo.lock
96+
sparse-checkout-cone-mode: false
97+
8798
- name: Build VSIX
8899
uses: ./.github/actions/build-vsix
89100
with:
@@ -201,6 +212,17 @@ jobs:
201212
with:
202213
path: ${{ env.special-working-directory-relative }}
203214

215+
- name: Checkout Python Environment Tools
216+
uses: actions/checkout@v4
217+
with:
218+
repository: 'microsoft/python-environment-tools'
219+
path: ${{ env.special-working-directory-relative }}/python-env-tools
220+
sparse-checkout: |
221+
crates
222+
Cargo.toml
223+
Cargo.lock
224+
sparse-checkout-cone-mode: false
225+
204226
- name: Install Node
205227
uses: actions/setup-node@v4
206228
with:
@@ -387,6 +409,17 @@ jobs:
387409
- name: Checkout
388410
uses: actions/checkout@v4
389411

412+
- name: Checkout Python Environment Tools
413+
uses: actions/checkout@v4
414+
with:
415+
repository: 'microsoft/python-environment-tools'
416+
path: ${{ env.special-working-directory-relative }}/python-env-tools
417+
sparse-checkout: |
418+
crates
419+
Cargo.toml
420+
Cargo.lock
421+
sparse-checkout-cone-mode: false
422+
390423
- name: Smoke tests
391424
uses: ./.github/actions/smoke-tests
392425
with:

.github/workflows/pr-check.yml

+68-2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,17 @@ jobs:
5757
- name: Checkout
5858
uses: actions/checkout@v4
5959

60+
- name: Checkout Python Environment Tools
61+
uses: actions/checkout@v4
62+
with:
63+
repository: 'microsoft/python-environment-tools'
64+
path: 'python-env-tools'
65+
sparse-checkout: |
66+
crates
67+
Cargo.toml
68+
Cargo.lock
69+
sparse-checkout-cone-mode: false
70+
6071
- name: Build VSIX
6172
uses: ./.github/actions/build-vsix
6273
with:
@@ -90,6 +101,17 @@ jobs:
90101
- name: Checkout
91102
uses: actions/checkout@v4
92103

104+
- name: Checkout Python Environment Tools
105+
uses: actions/checkout@v4
106+
with:
107+
repository: 'microsoft/python-environment-tools'
108+
path: 'python-env-tools'
109+
sparse-checkout: |
110+
crates
111+
Cargo.toml
112+
Cargo.lock
113+
sparse-checkout-cone-mode: false
114+
93115
- name: Install base Python requirements
94116
uses: brettcannon/pip-secure-install@v1
95117
with:
@@ -186,6 +208,17 @@ jobs:
186208
with:
187209
path: ${{ env.special-working-directory-relative }}
188210

211+
- name: Checkout Python Environment Tools
212+
uses: actions/checkout@v4
213+
with:
214+
repository: 'microsoft/python-environment-tools'
215+
path: ${{ env.special-working-directory-relative }}/python-env-tools
216+
sparse-checkout: |
217+
crates
218+
Cargo.toml
219+
Cargo.lock
220+
sparse-checkout-cone-mode: false
221+
189222
- name: Install Node
190223
uses: actions/setup-node@v4
191224
with:
@@ -363,9 +396,20 @@ jobs:
363396
with:
364397
path: ${{ env.special-working-directory-relative }}
365398

366-
- name: Native Locator tests
399+
- name: Checkout Python Environment Tools
400+
uses: actions/checkout@v4
401+
with:
402+
repository: 'microsoft/python-environment-tools'
403+
path: ${{ env.special-working-directory-relative }}/python-env-tools
404+
sparse-checkout: |
405+
crates
406+
Cargo.toml
407+
Cargo.lock
408+
sparse-checkout-cone-mode: false
409+
410+
- name: Python Environment Tools tests
367411
run: cargo test -- --nocapture
368-
working-directory: ${{ env.special-working-directory }}/native_locator
412+
working-directory: ${{ env.special-working-directory }}/python-env-tools
369413

370414
smoke-tests:
371415
name: Smoke tests
@@ -388,6 +432,17 @@ jobs:
388432
- name: Checkout
389433
uses: actions/checkout@v4
390434

435+
- name: Checkout Python Environment Tools
436+
uses: actions/checkout@v4
437+
with:
438+
repository: 'microsoft/python-environment-tools'
439+
path: python-env-tools
440+
sparse-checkout: |
441+
crates
442+
Cargo.toml
443+
Cargo.lock
444+
sparse-checkout-cone-mode: false
445+
391446
- name: Smoke tests
392447
uses: ./.github/actions/smoke-tests
393448
with:
@@ -409,6 +464,17 @@ jobs:
409464
- name: Checkout
410465
uses: actions/checkout@v4
411466

467+
- name: Checkout Python Environment Tools
468+
uses: actions/checkout@v4
469+
with:
470+
repository: 'microsoft/python-environment-tools'
471+
path: python-env-tools
472+
sparse-checkout: |
473+
crates
474+
Cargo.toml
475+
Cargo.lock
476+
sparse-checkout-cone-mode: false
477+
412478
- name: Install Node
413479
uses: actions/setup-node@v4
414480
with:

.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,4 @@ dist/**
4848
*.xlf
4949
package.nls.*.json
5050
l10n/
51-
native_locator/target/**
52-
native_locator/Cargo.lock
51+
python-env-tools/**

.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@
7373
"python.testing.unittestEnabled": false,
7474
"python.testing.pytestEnabled": true,
7575
"rust-analyzer.linkedProjects": [
76-
".\\native_locator\\Cargo.toml"
76+
".\\python-env-tools\\Cargo.toml"
7777
]
7878
}

.vscodeignore

+5-6
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,8 @@ test/**
6767
tmp/**
6868
typings/**
6969
types/**
70-
native_locator/.vscode/**
71-
native_locator/src/**
72-
native_locator/tests/**
73-
native_locator/bin/**
74-
native_locator/target/**
75-
native_locator/Cargo.*
70+
python-env-tools/.github/**
71+
python-env-tools/.vscode/**
72+
python-env-tools/crates/**
73+
python-env-tools/target/**
74+
python-env-tools/Cargo.*

build/azure-pipeline.pre-release.yml

+79-14
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ resources:
1818
ref: main
1919
endpoint: Monaco
2020

21+
- repository: python-environment-tools
22+
type: github
23+
name: microsoft/python-environment-tools
24+
ref: main
25+
endpoint: Monaco
26+
27+
2128
parameters:
2229
- name: publishExtension
2330
displayName: 🚀 Publish Extension
@@ -30,7 +37,48 @@ extends:
3037
publishExtension: ${{ parameters.publishExtension }}
3138
ghCreateTag: false
3239
l10nSourcePaths: ./src/client
40+
sourceRepositoriesToScan:
41+
include:
42+
- repository: python-environment-tools
43+
exclude:
44+
- repository: translations
45+
46+
buildPlatforms:
47+
- name: Linux
48+
vsceTarget: 'web'
49+
# - name: Linux
50+
# packageArch: arm64
51+
# vsceTarget: linux-arm64
52+
# - name: Linux
53+
# packageArch: arm
54+
# vsceTarget: linux-armhf
55+
- name: Linux
56+
packageArch: x64
57+
vsceTarget: linux-x64
58+
# - name: Linux
59+
# packageArch: arm64
60+
# vsceTarget: alpine-arm64
61+
- name: Linux
62+
packageArch: x64
63+
vsceTarget: alpine-x64
64+
- name: MacOS
65+
packageArch: arm64
66+
vsceTarget: darwin-arm64
67+
- name: MacOS
68+
packageArch: x64
69+
vsceTarget: darwin-x64
70+
- name: Windows
71+
packageArch: arm
72+
vsceTarget: win32-arm64
73+
- name: Windows
74+
packageArch: x64
75+
vsceTarget: win32-x64
76+
3377
buildSteps:
78+
- checkout: self
79+
displayName: Checkout Python Extension
80+
path: ./s
81+
3482
- task: NodeTool@0
3583
inputs:
3684
versionSpec: '18.17.1'
@@ -43,37 +91,54 @@ extends:
4391
architecture: 'x64'
4492
displayName: Select Python version
4593

46-
- script: npm ci
47-
displayName: Install NPM dependencies
48-
4994
- script: python -m pip install -U pip
5095
displayName: Upgrade pip
5196

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

55-
- script: |
56-
nox --session install_python_libs
100+
- script: npm ci
101+
displayName: Install NPM dependencies
102+
103+
- script: nox --session install_python_libs
57104
displayName: Install Jedi, get-pip, etc
58105

59-
- script: |
60-
python ./build/update_ext_version.py --for-publishing
106+
- script: python ./build/update_ext_version.py --for-publishing
61107
displayName: Update build number
62108

63-
- script: |
64-
python ./build/update_package_file.py
109+
- script: python ./build/update_package_file.py
65110
displayName: Update telemetry in package.json
66111

67112
- script: npm run addExtensionPackDependencies
68113
displayName: Update optional extension dependencies
69114

70-
- script: gulp prePublishBundle
115+
- script: npx gulp prePublishBundle
71116
displayName: Build
72117

118+
- checkout: python-environment-tools
119+
displayName: Checkout python-environment-tools
120+
path: ./s/python-env-tools
121+
122+
- script: nox --session azure_pet_build_before
123+
displayName: Enable cargo config for azure
124+
125+
- template: azure-pipelines/extension/templates/steps/build-extension-rust-package.yml@templates
126+
parameters:
127+
vsceTarget: $(vsceTarget)
128+
binaryName: pet
129+
signing: true
130+
workingDirectory: $(Build.SourcesDirectory)/python-env-tools
131+
buildWasm: false
132+
runTest: false
133+
134+
- script: nox --session azure_pet_build_after
135+
displayName: Move bin to final location
136+
73137
- script: python -c "import shutil; shutil.rmtree('.nox', ignore_errors=True)"
74138
displayName: Clean up Nox
139+
75140
tsa:
76-
config:
77-
areaPath: 'Visual Studio Code Python Extensions'
78-
serviceTreeID: '6e6194bc-7baa-4486-86d0-9f5419626d46'
79-
enabled: true
141+
config:
142+
areaPath: 'Visual Studio Code Python Extensions'
143+
serviceTreeID: '6e6194bc-7baa-4486-86d0-9f5419626d46'
144+
enabled: true

native_locator/.vscode/settings.json

-3
This file was deleted.

native_locator/Cargo.toml

-23
This file was deleted.

0 commit comments

Comments
 (0)