Skip to content

Upgrade Python to 3.12 #1347

Upgrade Python to 3.12

Upgrade Python to 3.12 #1347

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
env:
PYTHON_VERSION: "3.12"
jobs:
pre-commit:
name: Pre-commit
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Poetry
uses: abatilo/actions-poetry@v3
- name: Use local virtual environment
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v4
id: cache-poetry-deps
name: Cache Poetry dependencies
with:
path: ./.venv
key: venv-${{ env.PYTHON_VERSION }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
venv-${{ env.PYTHON_VERSION }}-
- uses: actions/cache@v4
name: Cache pre-commit hooks
with:
path: ~/.cache/pre-commit/
key: >
${{ format('pre-commit-{0}-{1}',
env.PYTHON_VERSION,
hashFiles('.pre-commit-config.yaml')
) }}
restore-keys: |
pre-commit-${{ env.PYTHON_VERSION }}-
pre-commit-
- name: Install dependencies with Poetry
if: steps.cache-poetry-deps.outputs.cache-hit != 'true'
run: poetry install
- name: Run pre-commit on all files
run: |
poetry run pre-commit run --all-files --show-diff-on-failure --color=always
- name: Run python-typing-update
run: |
poetry run pre-commit run --hook-stage manual python-typing-update --all-files --show-diff-on-failure --color=always