From 4f8e195e0fb05997f7918531c8911a5ce67d96e6 Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Wed, 29 Nov 2023 22:47:31 +0000 Subject: [PATCH] Render template ../cookiecutter-python-cli at 8814ff782f --- .github/workflows/check.yaml | 37 ++++++++++++++++-------------------- pyproject.toml | 20 +++++++++++++++++++ 2 files changed, 36 insertions(+), 21 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index d12bc14..d31a00e 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -95,32 +95,27 @@ jobs: container: ${{ matrix.image }} steps: - - name: Install dependencies via apt + - name: Install prerequisites via apt + env: + DEBIAN_FRONTEND: noninteractive run: | set -ex - export DEBIAN_FRONTEND=noninteractive apt update + apt install -y git + - uses: actions/checkout@v4 + - name: Install dependencies via apt + env: + DEBIAN_FRONTEND: noninteractive + run: | + set -ex + deps=$(sed -n '/^\[tool.gha-check-distro\]/,/^\[/p' pyproject.toml \ + | tr '\n' ' ' \ + | grep -o -P '\sdependencies-apt\s*=\s*\K\[.*?\]' \ + | grep -o -P '".*?"' \ + | tr -d '"') apt-cache --generate pkgnames \ - | grep --line-regexp --fixed-strings \ - -e git \ - -e python3-build \ - -e python3-click \ - -e python3-configobj \ - -e python3-cram \ - -e python3-flake8 \ - -e python3-importlib-metadata \ - -e python3-isort \ - -e python3-mypy \ - -e python3-pip \ - -e python3-pip-whl \ - -e python3-platformdirs \ - -e python3-pytest \ - -e python3-typeshed \ - -e python3-venv \ - -e python3-yaml \ - -e twine \ + | grep --line-regexp --fixed-strings "$deps" \ | xargs apt install -y - - uses: actions/checkout@v4 - name: Workaround for https://github.com/actions/checkout/pull/762 not persisting run: git config --global --add safe.directory "$PWD" - name: Install remaining dependencies diff --git a/pyproject.toml b/pyproject.toml index 74cb729..05d8afc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,6 +52,26 @@ test = [ [project.scripts] strava-offline = "strava_offline.cli:cli" +[tool.gha-check-distro] +dependencies-apt = [ + "python3-build", + "python3-click", + "python3-configobj", + "python3-cram", + "python3-flake8", + "python3-importlib-metadata", + "python3-isort", + "python3-mypy", + "python3-pip", + "python3-pip-whl", + "python3-platformdirs", + "python3-pytest", + "python3-typeshed", + "python3-venv", + "python3-yaml", + "twine", +] + [tool.setuptools_scm] [tool.setuptools.packages.find]