From 29cb1b5736f339d2523a33c69c33341afa21d31c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Tue, 5 Dec 2023 12:13:28 +0100 Subject: [PATCH] Use our local pre-commit for compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Newer versions of Black only support pre-commit > 3.2.0 and the distro's version may be older. See https://github.com/psf/black/pull/4041 Signed-off-by: Aurélien Bompard --- .github/workflows/tests.yml | 11 ++++++++--- tox.ini | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 26811102..0cb62115 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,14 +17,19 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install pre-commit - run: dnf install -y pre-commit git + - name: Install dependencies + run: | + dnf install -y git + pip install poetry>=1.2 - name: Mark the working directory as safe for Git run: git config --global --add safe.directory $PWD + - name: Install the project + run: poetry install + - name: Run pre-commit checks - run: pre-commit run --all-files + run: poetry run pre-commit run --all-files licenses: diff --git a/tox.ini b/tox.ini index 53eef1d7..2c607ec1 100644 --- a/tox.ini +++ b/tox.ini @@ -18,7 +18,7 @@ commands = poetry run pytest {posargs} [testenv:checks] -commands = pre-commit run --all-files +commands = poetry run pre-commit run --all-files [testenv:docs] changedir = datagrepper/docs