Skip to content

Drop remaining python2 shims #120

Drop remaining python2 shims

Drop remaining python2 shims #120

Workflow file for this run

---
# vi: ts=2 sw=2 et:
# SPDX-License-Identifier: LGPL-2.1-or-later
#
name: Install then test
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ matrix.container }}-${{ github.ref }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
container: [
"archlinux:latest",
"debian:testing",
"quay.io/centos/centos:stream10",
"quay.io/fedora/fedora:rawhide",
"ubuntu:noble",
]
container:
image: ${{ matrix.container }}
name: ${{ matrix.container }}
steps:
- name: Install dependencies
shell: bash
run: |
DIST_ID="$(sed -nr 's/^ID="?(\w+)"?/\1/p' /etc/os-release)"
echo "Distribution ID: $DIST_ID"
DEPS_COMMON=(
gcc
git
pkg-config
python3
systemd
)
case "$DIST_ID" in
arch)
pacman --noconfirm -Sy -u "${DEPS_COMMON[@]}" systemd-libs python-pip
;;
centos)
dnf config-manager --set-enabled crb
dnf install -y epel-release
dnf -y install "${DEPS_COMMON[@]}" systemd-devel python3-devel python3-pip
;;
fedora)
dnf -y install "${DEPS_COMMON[@]}" systemd-devel python3-devel python3-pip
;;
ubuntu|debian)
apt -y update
DEBIAN_FRONTEND=noninteractive apt -y install "${DEPS_COMMON[@]}" libsystemd-dev python3-dev python3-pip
;;
*)
echo >&2 "Invalid distribution ID: $DISTRO_ID"
exit 1
esac
python3 -m pip install -U --break-system-packages build pytest
- name: Fix Git config to satisfy Meson
run: git config --global safe.directory "*"
# Checkout repo after installing Git, or the "checkout" GH Action will download our source as non-Git repo, making Meson fail
# to build Python source dist.
- name: Repository checkout
uses: actions/checkout@v4
- name: Install & test
shell: bash
run: |
set -x
git --version
python3 -m build
python3 -m pip install --break-system-packages .
python3 -c 'from systemd import journal; print(journal.__version__)'
pytest -v --pyargs systemd