Skip to content

Commit 40e472b

Browse files
karthiknadigwesm
authored andcommitted
Use nox for python dependency installs (microsoft/vscode-python#23210)
1 parent 70ba284 commit 40e472b

File tree

5 files changed

+25
-100
lines changed

5 files changed

+25
-100
lines changed

extensions/positron-python/.github/actions/build-vsix/action.yml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ runs:
2929
cache: 'pip'
3030
cache-dependency-path: |
3131
requirements.txt
32-
build/build-install-requirements.txt
3332
python_files/jedilsp_requirements/requirements.txt
3433
3534
- name: Upgrade Pip
@@ -38,27 +37,13 @@ runs:
3837

3938
# For faster/better builds of sdists.
4039
- name: Install build pre-requisite
41-
run: python -m pip install wheel
40+
run: python -m pip install wheel nox
4241
shell: bash
4342

44-
- name: Install Python dependencies
45-
uses: brettcannon/pip-secure-install@v1
46-
with:
47-
options: '-t ./python_files/lib/python --implementation py'
48-
49-
- name: Install debugpy and get-pip
50-
run: |
51-
python -m pip --disable-pip-version-check install packaging
52-
python ./python_files/install_debugpy.py
53-
python ./python_files/download_get_pip.py
43+
- name: Install Python Extension dependencies (jedi, debugpy, etc.)
44+
run: nox --session install_python_libs
5445
shell: bash
5546

56-
- name: Install Jedi LSP
57-
uses: brettcannon/pip-secure-install@v1
58-
with:
59-
requirements-file: './python_files/jedilsp_requirements/requirements.txt'
60-
options: '-t ./python_files/lib/jedilsp --implementation py --platform any --abi none'
61-
6247
- name: Run npm ci
6348
run: npm ci --prefer-offline
6449
shell: bash

extensions/positron-python/.github/workflows/build.yml

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -185,40 +185,19 @@ jobs:
185185
with:
186186
python-version: ${{ matrix.python }}
187187

188-
- name: Download get-pip.py
189-
run: |
190-
python -m pip install wheel
191-
python -m pip install -r build/build-install-requirements.txt
192-
python ./python_files/download_get_pip.py
193-
shell: bash
194-
195-
- name: Install debugpy
196-
run: |
197-
# 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.
198-
python -m pip --disable-pip-version-check install -t ./python_files/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy
188+
- name: Upgrade Pip
189+
run: python -m pip install -U pip
199190

200-
- name: Install core Python requirements
201-
uses: brettcannon/pip-secure-install@v1
202-
with:
203-
requirements-file: '"${{ env.special-working-directory-relative }}/requirements.txt"'
204-
options: '-t "${{ env.special-working-directory-relative }}/python_files/lib/python" --no-cache-dir --implementation py'
205-
if: startsWith(matrix.python, 3.)
191+
# For faster/better builds of sdists.
192+
- name: Install build pre-requisite
193+
run: python -m pip install wheel nox
206194

207-
- name: Install Jedi requirements
208-
run: python scripts/vendor.py
209-
if: startsWith(matrix.python, 3.)
195+
- name: Install Python Extension dependencies (jedi, debugpy, etc.)
196+
run: nox --session install_python_libs
210197

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

214-
- name: Install debugpy wheels (Python ${{ matrix.python }})
215-
run: |
216-
python -m pip install wheel
217-
python -m pip install -r build/build-install-requirements.txt
218-
python ./python_files/install_debugpy.py
219-
shell: bash
220-
if: matrix.test-suite == 'debugger'
221-
222201
- name: Install functional test requirements
223202
run: python -m pip install --upgrade -r ./build/functional-test-requirements.txt
224203
if: matrix.test-suite == 'functional'

extensions/positron-python/.github/workflows/pr-check.yml

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -173,38 +173,19 @@ jobs:
173173
with:
174174
python-version: ${{ matrix.python }}
175175

176-
- name: Install debugpy
177-
run: |
178-
# 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.
179-
python -m pip --disable-pip-version-check install -t ./python_files/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy
176+
- name: Upgrade Pip
177+
run: python -m pip install -U pip
180178

181-
- name: Download get-pip.py
182-
run: |
183-
python -m pip install wheel
184-
python -m pip install -r build/build-install-requirements.txt
185-
python ./python_files/download_get_pip.py
186-
shell: bash
187-
188-
- name: Install base Python requirements
189-
uses: brettcannon/pip-secure-install@v1
190-
with:
191-
requirements-file: '"${{ env.special-working-directory-relative }}/requirements.txt"'
192-
options: '-t "${{ env.special-working-directory-relative }}/python_files/lib/python" --no-cache-dir --implementation py'
179+
# For faster/better builds of sdists.
180+
- name: Install build pre-requisite
181+
run: python -m pip install wheel nox
193182

194-
- name: Install Jedi requirements
195-
run: python scripts/vendor.py
183+
- name: Install Python Extension dependencies (jedi, debugpy, etc.)
184+
run: nox --session install_python_libs
196185

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

200-
- name: Install debugpy wheels (Python ${{ matrix.python }})
201-
run: |
202-
python -m pip install wheel
203-
python -m pip --disable-pip-version-check install -r build/build-install-requirements.txt
204-
python ./python_files/install_debugpy.py
205-
shell: bash
206-
if: matrix.test-suite == 'debugger'
207-
208189
- name: Install functional test requirements
209190
run: python -m pip install --upgrade -r ./build/functional-test-requirements.txt
210191
if: matrix.test-suite == 'functional'

extensions/positron-python/build/azure-pipeline.pre-release.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,12 @@ extends:
4949
- script: python -m pip install -U pip
5050
displayName: Upgrade pip
5151

52-
- script: python -m pip install wheel
53-
displayName: Install wheel
52+
- script: python -m pip install wheel nox
53+
displayName: Install wheel and nox
5454

5555
- script: |
56-
python -m pip --disable-pip-version-check install -r build/build-install-requirements.txt
57-
python ./python_files/install_debugpy.py
58-
python ./python_files/download_get_pip.py
59-
displayName: Install debugpy and get-pip.py
60-
61-
- script: |
62-
python -m pip install --no-deps --require-hashes --only-binary :all: -t ./python_files/lib/python --implementation py -r ./requirements.txt
63-
displayName: Install Python dependencies
64-
65-
- script: |
66-
python -m pip install --no-deps --require-hashes --only-binary :all: -t ./python_files/lib/jedilsp --implementation py --platform any --abi none -r ./python_files/jedilsp_requirements/requirements.txt
67-
displayName: Install Jedi Language Server
56+
nox --session install_python_libs
57+
displayName: Install debugpy, Jedi, get-pip, etc
6858
6959
- script: |
7060
python ./build/update_ext_version.py --for-publishing

extensions/positron-python/build/azure-pipeline.stable.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,12 @@ extends:
4444
- script: python -m pip install -U pip
4545
displayName: Upgrade pip
4646

47-
- script: python -m pip install wheel
48-
displayName: Install wheel
47+
- script: python -m pip install wheel nox
48+
displayName: Install wheel and nox
4949

5050
- script: |
51-
python -m pip --disable-pip-version-check install -r build/build-install-requirements.txt
52-
python ./python_files/install_debugpy.py
53-
python ./python_files/download_get_pip.py
54-
displayName: Install debugpy and get-pip.py
55-
56-
- script: |
57-
python -m pip install --no-deps --require-hashes --only-binary :all: -t ./python_files/lib/python --implementation py -r ./requirements.txt
58-
displayName: Install Python dependencies
59-
60-
- script: |
61-
python -m pip install --no-deps --require-hashes --only-binary :all: -t ./python_files/lib/jedilsp --implementation py --platform any --abi none -r ./python_files/jedilsp_requirements/requirements.txt
62-
displayName: Install Jedi Language Server
51+
nox --session install_python_libs
52+
displayName: Install debugpy, Jedi, get-pip, etc
6353
6454
- script: |
6555
python ./build/update_ext_version.py --release --for-publishing

0 commit comments

Comments
 (0)