diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index f8e4031..2e9abdc 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -22,7 +22,7 @@ on: jobs: lint: - name: 'lint & typecheck & test (Python ${{ matrix.python }})' + name: "lint & typecheck & test (Python ${{ matrix.python }}${{ matrix.baseline && ', baseline deps' || '' }}${{ matrix.experimental && ', experimental' || '' }})" runs-on: ubuntu-latest continue-on-error: ${{ matrix.experimental }} strategy: @@ -33,9 +33,14 @@ jobs: - '3.11' - '3.12' experimental: [false] + baseline: [false] include: - python: '3.13' + baseline: false experimental: true + - python: '3.10' + baseline: true + experimental: false steps: - uses: actions/checkout@v4 - name: Install Poetry @@ -46,6 +51,9 @@ jobs: cache: poetry - name: Install deps run: poetry install --with=dev + - name: Replace deps with baseline versions + if: matrix.baseline + run: ./scripts/install-baseline-deps.sh - name: Lint with ruff run: poetry run ruff check - name: Type-check with mypy diff --git a/scripts/install-baseline-deps.sh b/scripts/install-baseline-deps.sh new file mode 100755 index 0000000..babd4b9 --- /dev/null +++ b/scripts/install-baseline-deps.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +set -e + +MY_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +main() { + local requirements_file="$MY_DIR/requirements.baseline.txt" + + # Install pygit2 build deps -- prebuilt 1.6.1 wheels on PyPI are only + # available for Python up to 3.9. + export DEBIAN_FRONTEND=noninteractive + export DEBCONF_NONINTERACTIVE_SEEN=true + sudo apt-get update -qqy + sudo apt-get install -qqy libgit2-dev + + # Workaround https://github.com/yaml/pyyaml/issues/724 because we need + # exactly this version of PyYAML for faithful reproduction of the baseline + # environment. + poetry run pip install 'Cython<3' + poetry run pip install --no-build-isolation 'PyYAML==5.4.1' + + poetry run pip install -r "$requirements_file" +} + +main "$@" diff --git a/scripts/requirements.baseline.txt b/scripts/requirements.baseline.txt new file mode 100644 index 0000000..46d1e4d --- /dev/null +++ b/scripts/requirements.baseline.txt @@ -0,0 +1,13 @@ +# Package versions provided by Ubuntu 22.04 LTS. +arpy==1.1.1 +certifi==2020.6.20 +jinja2==3.0.3 +packaging==21.3 +pygit2==1.6.1 +# pyyaml==5.4.1 # https://github.com/yaml/pyyaml/issues/724 +requests==2.25.1 +rich==11.2.0 +semver==2.10.2 +tomli==1.2.2 +tomlkit==0.9.2 +typing_extensions==3.10.0.2