Skip to content

Commit

Permalink
Update nox and pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
paulacamargo25 committed Jul 28, 2023
1 parent 149c93e commit 56c9923
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build-vsix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ runs:
shell: bash

- name: Install bundled python libraries
run: pipx run nox --session install_bundled_libs
run: pipx run nox --session install_old_bundled_libs
shell: bash

# Use the GITHUB_RUN_ID environment variable to update the build number.
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ runs:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.7'
python-version: '3.6'

- name: Pip cache
uses: actions/cache@v3
Expand All @@ -47,7 +47,7 @@ runs:

# This will install libraries to a target directory.
- name: Install bundled python libraries
run: pipx run nox --session install_bundled_libs
run: pipx run nox --session install_old_bundled_libs
shell: bash

- name: Check linting and formatting
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,27 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
python: ['3.6']

steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: ${{ env.special-working-directory-relative }}

# Install bundled libs using 3.7 even though you test it on other versions.
- name: Use Python 3.7
# Install bundled libs using 3.6 even though you test it on other versions.
- name: Use Python 3.6
uses: actions/setup-python@v4
with:
python-version: '3.7'
python-version: '3.6'

- name: Update pip, install pipx and install wheel
run: python -m pip install -U pip pipx wheel
shell: bash

# This will install libraries to a target directory.
- name: Install bundled python libraries
run: pipx run nox --session install_bundled_libs
run: pipx run nox --session install_old_bundled_libs
shell: bash

- name: Install Node
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/push-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,27 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
python: ['3.6']

steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: ${{ env.special-working-directory-relative }}

# Install bundled libs using 3.7 even though you test it on other versions.
- name: Use Python 3.7
# Install bundled libs using 3.6 even though you test it on other versions.
- name: Use Python 3.6
uses: actions/setup-python@v4
with:
python-version: '3.7'
python-version: '3.6'

- name: Update pip, install pipx and install wheel
run: python -m pip install -U pip pipx wheel
shell: bash

# This will install libraries to a target directory.
- name: Install bundled python libraries
run: pipx run nox --session install_bundled_libs
run: pipx run nox --session install_old_bundled_libs
shell: bash

- name: Install Node
Expand Down
4 changes: 2 additions & 2 deletions build/azure-pipeline.pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extends:

- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
versionSpec: '3.6'
addToPath: true
architecture: 'x64'
displayName: Select Python version
Expand All @@ -53,7 +53,7 @@ extends:
- script: python -m pip install nox
displayName: Install wheel

- script: python -m nox --session install_bundled_libs
- script: python -m nox --session install_old_bundled_libs
displayName: Install Python dependencies

- script: python ./build/update_ext_version.py --for-publishing
Expand Down
4 changes: 2 additions & 2 deletions build/azure-pipeline.stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extends:

- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
versionSpec: '3.6'
addToPath: true
architecture: 'x64'
displayName: Select Python version
Expand All @@ -50,7 +50,7 @@ extends:
- script: python -m pip install nox
displayName: Install wheel

- script: python -m nox --session install_bundled_libs
- script: python -m nox --session install_old_bundled_libs
displayName: Install Python dependencies

- script: python ./build/update_ext_version.py --release --for-publishing
Expand Down
11 changes: 9 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import nox # pylint: disable=import-error


def _install_bundle(session: nox.Session) -> None:
def _install_bundle(session: nox.Session, version="latest") -> None:
session.install(
"-t",
"./bundled/libs",
Expand All @@ -25,7 +25,7 @@ def _install_bundle(session: nox.Session) -> None:
"./requirements.txt",
)
session.install("packaging")
_install_package(f"{os.getcwd()}/bundled/libs", "debugpy", "1.5.1")
_install_package(f"{os.getcwd()}/bundled/libs", "debugpy", version)


def _update_pip_packages(session: nox.Session) -> None:
Expand Down Expand Up @@ -117,6 +117,13 @@ def install_bundled_libs(session):
_install_bundle(session)


@nox.session(python="3.6")
def install_old_bundled_libs(session):
"""Installs the libraries that will be bundled with the extension."""
session.install("wheel")
_install_bundle(session, "1.5.1")


@nox.session(python="3.7")
def setup(session: nox.Session) -> None:
"""Sets up the extension for development."""
Expand Down

0 comments on commit 56c9923

Please sign in to comment.