Fix Python CI jobs: drop container, install Python 3.12 directly
python:3.12-slim has no Node, causing actions/checkout@v4's post-step to fail with 'exec: node not found'. Drop the container: declaration so jobs run on the ubuntu-latest runner (which has Node). Install Python 3.12 via deadsnakes PPA for the test job since the runner base image (Ubuntu 22.04) ships with Python 3.10. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -60,8 +60,6 @@ jobs:
|
|||||||
lint:
|
lint:
|
||||||
name: Python lint
|
name: Python lint
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
|
||||||
image: python:3.12-slim
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -74,20 +72,25 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
name: Python tests
|
name: Python tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
|
||||||
image: python:3.12-slim
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
# git is required by setuptools-scm during package build
|
# The act runner base image ships Ubuntu 22.04 with Python 3.10.
|
||||||
- name: Install git
|
# Our package requires 3.12, so install it from the deadsnakes PPA.
|
||||||
run: apt-get update -qq && apt-get install -y -qq git
|
- name: Install Python 3.12
|
||||||
|
run: |
|
||||||
|
apt-get update -qq
|
||||||
|
apt-get install -y -qq software-properties-common
|
||||||
|
add-apt-repository -y ppa:deadsnakes/ppa
|
||||||
|
apt-get update -qq
|
||||||
|
apt-get install -y -qq python3.12 python3.12-dev python3.12-venv python3-pip git
|
||||||
|
python3.12 -m ensurepip --upgrade
|
||||||
|
|
||||||
- name: Install package with dev deps
|
- name: Install package with dev deps
|
||||||
run: pip install -e ".[dev]"
|
run: python3.12 -m pip install -e ".[dev]"
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: pytest tests/ -v
|
run: python3.12 -m pytest tests/ -v
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build & push image
|
name: Build & push image
|
||||||
|
|||||||
Reference in New Issue
Block a user