Skip to content

Use nox for python dependency installs #23210

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

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 3 additions & 18 deletions .github/actions/build-vsix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ runs:
cache: 'pip'
cache-dependency-path: |
requirements.txt
build/build-install-requirements.txt
python_files/jedilsp_requirements/requirements.txt

- name: Upgrade Pip
Expand All @@ -38,27 +37,13 @@ runs:

# For faster/better builds of sdists.
- name: Install build pre-requisite
run: python -m pip install wheel
run: python -m pip install wheel nox
shell: bash

- name: Install Python dependencies
uses: brettcannon/pip-secure-install@v1
with:
options: '-t ./python_files/lib/python --implementation py'

- name: Install debugpy and get-pip
run: |
python -m pip --disable-pip-version-check install packaging
python ./python_files/install_debugpy.py
python ./python_files/download_get_pip.py
- name: Install Python Extension dependencies (jedi, debugpy, etc.)
run: nox --session install_python_libs
shell: bash

- name: Install Jedi LSP
uses: brettcannon/pip-secure-install@v1
with:
requirements-file: './python_files/jedilsp_requirements/requirements.txt'
options: '-t ./python_files/lib/jedilsp --implementation py --platform any --abi none'

- name: Run npm ci
run: npm ci --prefer-offline
shell: bash
Expand Down
38 changes: 7 additions & 31 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,43 +188,19 @@ jobs:
with:
python-version: ${{ matrix.python }}

- name: Download get-pip.py
run: |
python -m pip install wheel
python -m pip install -r build/build-install-requirements.txt
python ./python_files/download_get_pip.py
shell: bash
- name: Upgrade Pip
run: python -m pip install -U pip

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

- name: Install core Python requirements
uses: brettcannon/pip-secure-install@v1
with:
requirements-file: '"${{ env.special-working-directory-relative }}/requirements.txt"'
options: '-t "${{ env.special-working-directory-relative }}/python_files/lib/python" --no-cache-dir --implementation py'
if: startsWith(matrix.python, 3.)

- name: Install Jedi requirements
uses: brettcannon/pip-secure-install@v1
with:
requirements-file: '"${{ env.special-working-directory-relative }}/python_files/jedilsp_requirements/requirements.txt"'
options: '-t "${{ env.special-working-directory-relative }}/python_files/lib/jedilsp" --no-cache-dir --implementation py'
if: startsWith(matrix.python, 3.)
- name: Install Python Extension dependencies (jedi, debugpy, etc.)
run: nox --session install_python_libs

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

- name: Install debugpy wheels (Python ${{ matrix.python }})
run: |
python -m pip install wheel
python -m pip install -r build/build-install-requirements.txt
python ./python_files/install_debugpy.py
shell: bash
if: matrix.test-suite == 'debugger'

- name: Install functional test requirements
run: python -m pip install --upgrade -r ./build/functional-test-requirements.txt
if: matrix.test-suite == 'functional'
Expand Down
36 changes: 7 additions & 29 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,41 +176,19 @@ jobs:
with:
python-version: ${{ matrix.python }}

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

- name: Download get-pip.py
run: |
python -m pip install wheel
python -m pip install -r build/build-install-requirements.txt
python ./python_files/download_get_pip.py
shell: bash
# For faster/better builds of sdists.
- name: Install build pre-requisite
run: python -m pip install wheel nox

- name: Install base Python requirements
uses: brettcannon/pip-secure-install@v1
with:
requirements-file: '"${{ env.special-working-directory-relative }}/requirements.txt"'
options: '-t "${{ env.special-working-directory-relative }}/python_files/lib/python" --no-cache-dir --implementation py'

- name: Install Jedi requirements
uses: brettcannon/pip-secure-install@v1
with:
requirements-file: '"${{ env.special-working-directory-relative }}/python_files/jedilsp_requirements/requirements.txt"'
options: '-t "${{ env.special-working-directory-relative }}/python_files/lib/jedilsp" --no-cache-dir --implementation py'
- name: Install Python Extension dependencies (jedi, debugpy, etc.)
run: nox --session install_python_libs

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

- name: Install debugpy wheels (Python ${{ matrix.python }})
run: |
python -m pip install wheel
python -m pip --disable-pip-version-check install -r build/build-install-requirements.txt
python ./python_files/install_debugpy.py
shell: bash
if: matrix.test-suite == 'debugger'

- name: Install functional test requirements
run: python -m pip install --upgrade -r ./build/functional-test-requirements.txt
if: matrix.test-suite == 'functional'
Expand Down
18 changes: 4 additions & 14 deletions build/azure-pipeline.pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,12 @@ extends:
- script: python -m pip install -U pip
displayName: Upgrade pip

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

- script: |
python -m pip --disable-pip-version-check install -r build/build-install-requirements.txt
python ./python_files/install_debugpy.py
python ./python_files/download_get_pip.py
displayName: Install debugpy and get-pip.py

- script: |
python -m pip install --no-deps --require-hashes --only-binary :all: -t ./python_files/lib/python --implementation py -r ./requirements.txt
displayName: Install Python dependencies

- script: |
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
displayName: Install Jedi Language Server
nox --session install_python_libs
displayName: Install debugpy, Jedi, get-pip, etc

- script: |
python ./build/update_ext_version.py --for-publishing
Expand Down
18 changes: 4 additions & 14 deletions build/azure-pipeline.stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,12 @@ extends:
- script: python -m pip install -U pip
displayName: Upgrade pip

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

- script: |
python -m pip --disable-pip-version-check install -r build/build-install-requirements.txt
python ./python_files/install_debugpy.py
python ./python_files/download_get_pip.py
displayName: Install debugpy and get-pip.py

- script: |
python -m pip install --no-deps --require-hashes --only-binary :all: -t ./python_files/lib/python --implementation py -r ./requirements.txt
displayName: Install Python dependencies

- script: |
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
displayName: Install Jedi Language Server
nox --session install_python_libs
displayName: Install debugpy, Jedi, get-pip, etc

- script: |
python ./build/update_ext_version.py --release --for-publishing
Expand Down