Skip to content

Commit fc49f2b

Browse files
authored
Use nox for python dependency installs (#23210)
1 parent b55e460 commit fc49f2b

File tree

5 files changed

+25
-106
lines changed

5 files changed

+25
-106
lines changed

.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

.github/workflows/build.yml

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -188,43 +188,19 @@ jobs:
188188
with:
189189
python-version: ${{ matrix.python }}
190190

191-
- name: Download get-pip.py
192-
run: |
193-
python -m pip install wheel
194-
python -m pip install -r build/build-install-requirements.txt
195-
python ./python_files/download_get_pip.py
196-
shell: bash
191+
- name: Upgrade Pip
192+
run: python -m pip install -U pip
197193

198-
- name: Install debugpy
199-
run: |
200-
# 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.
201-
python -m pip --disable-pip-version-check install -t ./python_files/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy
194+
# For faster/better builds of sdists.
195+
- name: Install build pre-requisite
196+
run: python -m pip install wheel nox
202197

203-
- name: Install core Python requirements
204-
uses: brettcannon/pip-secure-install@v1
205-
with:
206-
requirements-file: '"${{ env.special-working-directory-relative }}/requirements.txt"'
207-
options: '-t "${{ env.special-working-directory-relative }}/python_files/lib/python" --no-cache-dir --implementation py'
208-
if: startsWith(matrix.python, 3.)
209-
210-
- name: Install Jedi requirements
211-
uses: brettcannon/pip-secure-install@v1
212-
with:
213-
requirements-file: '"${{ env.special-working-directory-relative }}/python_files/jedilsp_requirements/requirements.txt"'
214-
options: '-t "${{ env.special-working-directory-relative }}/python_files/lib/jedilsp" --no-cache-dir --implementation py'
215-
if: startsWith(matrix.python, 3.)
198+
- name: Install Python Extension dependencies (jedi, debugpy, etc.)
199+
run: nox --session install_python_libs
216200

217201
- name: Install test requirements
218202
run: python -m pip install --upgrade -r build/test-requirements.txt
219203

220-
- name: Install debugpy wheels (Python ${{ matrix.python }})
221-
run: |
222-
python -m pip install wheel
223-
python -m pip install -r build/build-install-requirements.txt
224-
python ./python_files/install_debugpy.py
225-
shell: bash
226-
if: matrix.test-suite == 'debugger'
227-
228204
- name: Install functional test requirements
229205
run: python -m pip install --upgrade -r ./build/functional-test-requirements.txt
230206
if: matrix.test-suite == 'functional'

.github/workflows/pr-check.yml

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -176,41 +176,19 @@ jobs:
176176
with:
177177
python-version: ${{ matrix.python }}
178178

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

184-
- name: Download get-pip.py
185-
run: |
186-
python -m pip install wheel
187-
python -m pip install -r build/build-install-requirements.txt
188-
python ./python_files/download_get_pip.py
189-
shell: bash
182+
# For faster/better builds of sdists.
183+
- name: Install build pre-requisite
184+
run: python -m pip install wheel nox
190185

191-
- name: Install base Python requirements
192-
uses: brettcannon/pip-secure-install@v1
193-
with:
194-
requirements-file: '"${{ env.special-working-directory-relative }}/requirements.txt"'
195-
options: '-t "${{ env.special-working-directory-relative }}/python_files/lib/python" --no-cache-dir --implementation py'
196-
197-
- name: Install Jedi requirements
198-
uses: brettcannon/pip-secure-install@v1
199-
with:
200-
requirements-file: '"${{ env.special-working-directory-relative }}/python_files/jedilsp_requirements/requirements.txt"'
201-
options: '-t "${{ env.special-working-directory-relative }}/python_files/lib/jedilsp" --no-cache-dir --implementation py'
186+
- name: Install Python Extension dependencies (jedi, debugpy, etc.)
187+
run: nox --session install_python_libs
202188

203189
- name: Install test requirements
204190
run: python -m pip install --upgrade -r build/test-requirements.txt
205191

206-
- name: Install debugpy wheels (Python ${{ matrix.python }})
207-
run: |
208-
python -m pip install wheel
209-
python -m pip --disable-pip-version-check install -r build/build-install-requirements.txt
210-
python ./python_files/install_debugpy.py
211-
shell: bash
212-
if: matrix.test-suite == 'debugger'
213-
214192
- name: Install functional test requirements
215193
run: python -m pip install --upgrade -r ./build/functional-test-requirements.txt
216194
if: matrix.test-suite == 'functional'

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

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)