diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 985bb35..7df1d46 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,12 +16,12 @@ jobs: strategy: matrix: os: ["ubuntu-latest"] - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} @@ -68,7 +68,7 @@ jobs: container: image: ${{ matrix.envs.container }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Enable EPEL repository (Rocky Linux) if: ${{ startsWith(matrix.envs.container, 'rockylinux') }} @@ -88,21 +88,11 @@ jobs: python3-PyYAML \ python3-tomli - # Unfortunately, pip and setuptools in RHEL8 do not fully support - # PEP517 pyproject.toml. As a workaround for this version, the setup.py - # script provided by RFL.build package is copied and executed. - - name: Install RFL.build setup wrapper (Rocky Linux 8) - if: ${{ matrix.envs.container == 'rockylinux/rockylinux:8' }} - run: | - cp src/build/rfl/build/scripts/setup src/core/setup.py - cp src/build/rfl/build/scripts/setup src/authentication/setup.py - cp src/build/rfl/build/scripts/setup src/build/setup.py - cp src/build/rfl/build/scripts/setup src/log/setup.py - cp src/build/rfl/build/scripts/setup src/permissions/setup.py - cp src/build/rfl/build/scripts/setup src/settings/setup.py - cp src/build/rfl/build/scripts/setup src/web/setup.py - + # pip and setuptools on Rocky Linux 8 do not fully support PEP 517 builds from + # pyproject.toml; enable PEP517_SETUP_WRAPPER on this distribution only. - name: Install application + env: + PEP517_SETUP_WRAPPER: ${{ matrix.envs.container == 'rockylinux/rockylinux:8' && '1' || '' }} run: NODEPS=1 PIP=pip3 bash install.sh # Unfortunately, pytest on rocky8 does not support @@ -139,7 +129,7 @@ jobs: container: image: ${{ matrix.envs.container }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install tests dependencies run: | @@ -155,24 +145,80 @@ jobs: python3-yaml \ python3-venv - # Unfortunately, pip and setuptools in Ubuntu jammy do not fully support - # PEP517 pyproject.toml. As a workaround for this version, the setup.py - # script provided by RFL.build package is copied and executed. - - name: Install RFL.build setup wrapper (Ubuntu Jammy 22.04) - if: ${{ matrix.envs.container == 'ubuntu:jammy' }} - run: | - cp src/build/rfl/build/scripts/setup src/core/setup.py - cp src/build/rfl/build/scripts/setup src/authentication/setup.py - cp src/build/rfl/build/scripts/setup src/build/setup.py - cp src/build/rfl/build/scripts/setup src/log/setup.py - cp src/build/rfl/build/scripts/setup src/permissions/setup.py - cp src/build/rfl/build/scripts/setup src/settings/setup.py - cp src/build/rfl/build/scripts/setup src/web/setup.py - + # pip and setuptools on Ubuntu Jammy do not fully support PEP 517 builds from + # pyproject.toml; enable PEP517_SETUP_WRAPPER on this distribution only. - name: Install application + env: + PEP517_SETUP_WRAPPER: ${{ matrix.envs.container == 'ubuntu:jammy' && '1' || '' }} run: | python3 -m venv --system-site-packages ~/venv NODEPS=1 EDITABLE=1 PIP=~/venv/bin/pip bash install.sh - name: Run tests run: ~/venv/bin/python3 -m pytest --import-mode=importlib + + os_suse_tests: + name: OS integration tests (suse) + strategy: + fail-fast: false + matrix: + envs: + - container: opensuse/leap:15 + - container: opensuse/leap:16.0 + - container: opensuse/tumbleweed + runs-on: ubuntu-latest + container: + image: ${{ matrix.envs.container }} + steps: + # Minimal openSUSE Leap 15 image does not ship tar/gzip; actions/checkout + # needs them to extract the downloaded repository archive (.tar.gz). + - name: Install checkout dependencies (Leap 15) + if: ${{ matrix.envs.container == 'opensuse/leap:15' }} + run: zypper -n ref && zypper -n in tar gzip + + - uses: actions/checkout@v6 + + - name: Install tests dependencies + run: | + zypper -n ref + zypper -n in \ + python3 \ + python3-pip \ + python3-pytest \ + python3-Flask \ + python3-PyJWT \ + python3-ldap \ + python3-PyYAML \ + python3-tomli + + # Leap 15 ships Python 3.6; wheel is required for pip builds. + - name: Install python3-wheel (Leap 15) + if: ${{ matrix.envs.container == 'opensuse/leap:15' }} + run: zypper -n in python3-wheel + + - name: Create virtual environment + run: python3 -m venv --system-site-packages ~/venv + + # pip on openSUSE Leap 15 (Python 3.6) does not fully support PEP 517 builds from + # pyproject.toml; enable PEP517_SETUP_WRAPPER on this distribution only. + - name: Install application + env: + PEP517_SETUP_WRAPPER: ${{ matrix.envs.container == 'opensuse/leap:15' && '1' || '' }} + run: NODEPS=1 PIP=~/venv/bin/pip bash install.sh + + # Unfortunately, pytest on Leap 15 does not support --import-mode=importlib. + # On this old version, explicitly test all packages individually. + - name: Run tests (Leap 15) + if: ${{ matrix.envs.container == 'opensuse/leap:15' }} + run: | + ~/venv/bin/python3 -m pytest src/core + ~/venv/bin/python3 -m pytest src/authentication + ~/venv/bin/python3 -m pytest src/build + ~/venv/bin/python3 -m pytest src/log + ~/venv/bin/python3 -m pytest src/permissions + ~/venv/bin/python3 -m pytest src/settings + ~/venv/bin/python3 -m pytest src/web + + - name: Run tests + if: ${{ matrix.envs.container != 'opensuse/leap:15' }} + run: ~/venv/bin/python3 -m pytest --import-mode=importlib diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 4f7ae28..5048650 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -14,6 +14,6 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 - uses: pre-commit/action@v3.0.1 diff --git a/install.sh b/install.sh index 53313ac..83f624c 100755 --- a/install.sh +++ b/install.sh @@ -2,6 +2,20 @@ : ${PIP:="pip"} +# Some platforms ship pip/setuptools without full PEP 517 support for pyproject.toml. +# When PEP517_SETUP_WRAPPER is set, copy the setup.py script from RFL.build into each +# package so pip can build and install them on these older toolchains. +function pep517_setup_wrappers { + SETUP_SCRIPT="src/build/rfl/build/scripts/setup" + for PKG in $(ls -1 src); do + cp "${SETUP_SCRIPT}" "src/${PKG}/setup.py" + done +} + +if [ -n "$PEP517_SETUP_WRAPPER" ]; then + pep517_setup_wrappers +fi + function install { PKG=$1 PIP_ARGS=()