diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93f1bb1..d250a23 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ permissions: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 concurrency: group: ${{ github.workflow }}-${{ matrix.python }}-${{ github.ref }} cancel-in-progress: true @@ -22,19 +22,19 @@ jobs: fail-fast: false matrix: python: [ - "3.7", - "3.8", "3.9", "3.10", - "3.11.0-rc.1", + "3.11", + "3.12", + "3.13" ] name: Python ${{ matrix.python }} steps: - name: Repository checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Configure Python ${{ matrix.python }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} architecture: x64 @@ -42,15 +42,22 @@ jobs: - name: Install dependencies run: | sudo apt -y update - sudo apt -y install gcc libsystemd-dev - python -m pip install pytest sphinx - + sudo apt -y install gcc libsystemd-dev python3-setuptools + - name: Create virtualenv + run: | + python3 -m venv ~/${{ matrix.python }} + - name: Install python dependencies + run: | + source ~/${{ matrix.python }}/bin/activate + python3 -m pip install pytest sphinx setuptools - name: Build (Python ${{ matrix.python }}) run: | set -x + source ~/${{ matrix.python }}/bin/activate make -j make doc SPHINXOPTS="-W -v" - name: Test (Python ${{ matrix.python }}) run: | + source ~/${{ matrix.python }}/bin/activate make check diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index c1d202c..58fec69 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -14,7 +14,7 @@ permissions: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 concurrency: group: ${{ github.workflow }}-${{ matrix.container }}-${{ github.ref }} cancel-in-progress: true @@ -24,16 +24,16 @@ jobs: container: [ "archlinux:latest", "debian:testing", - "quay.io/centos/centos:stream8", + "quay.io/centos/centos:stream9", "quay.io/fedora/fedora:rawhide", - "ubuntu:focal", + "ubuntu:noble", ] container: image: ${{ matrix.container }} name: ${{ matrix.container }} steps: - name: Repository checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install dependencies shell: bash @@ -52,14 +52,20 @@ jobs: case "$DIST_ID" in arch) pacman --noconfirm -Sy "${DEPS_COMMON[@]}" systemd-libs + python3 -m venv ~/venv + source ~/venv/bin/activate python3 -m ensurepip ;; centos|fedora) - dnf -y install "${DEPS_COMMON[@]}" systemd-devel python3-devel python3-pip + dnf -y install "${DEPS_COMMON[@]}" systemd-devel python3-devel python3-pip python3-setuptools + python3 -m venv ~/venv + source ~/venv/bin/activate ;; ubuntu|debian) apt -y update - DEBIAN_FRONTEND=noninteractive apt -y install "${DEPS_COMMON[@]}" libsystemd-dev python3-dev python3-pip + DEBIAN_FRONTEND=noninteractive apt -y install "${DEPS_COMMON[@]}" libsystemd-dev python3-dev python3-pip python3-setuptools python3-venv + python3 -m venv ~/venv + source ~/venv/bin/activate ;; *) echo >&2 "Invalid distribution ID: $DISTRO_ID" @@ -71,6 +77,7 @@ jobs: - name: Build & install shell: bash run: | + source ~/venv/bin/activate set -x python3 -m pip install -I -v . # Avoid importing the systemd module from the git repository diff --git a/Makefile b/Makefile index 02d357f..87758fa 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PYTHON = python +PYTHON = python3 SED = sed ETAGS = etags INCLUDE_DIR := $(shell pkg-config --variable=includedir libsystemd)