commit:     79540b64fa272904ebe23bb44d9f30abe7b1378f
Author:     Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Fri Jan 26 22:43:55 2024 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat Mar  9 18:07:10 2024 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=79540b64

GH: use whatever black version is defined in pyproject.toml

This avoids black releasing a new version and all of our
tests failure due to the formatter changing.

The downside here is we probably want a notification that
black can be upgraded.

Signed-off-by: Brian Harring <ferringb <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 .github/workflows/test.yml | 6 +++++-
 pyproject.toml             | 3 +++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index ef0d594cc..fa40f4530 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -148,7 +148,11 @@ jobs:
     steps:
     - name: Checkout code
       uses: actions/checkout@v4
-    - uses: psf/black@stable
+    - name: Install black version
+      run: |
+        python -m pip install --upgrade pip
+        pip install -e .[formatter]
+        black --check --diff .
 
   gentoo-regen:
     runs-on: ubuntu-latest

diff --git a/pyproject.toml b/pyproject.toml
index b129bd9a9..6ad4fb98e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -45,6 +45,9 @@ doc = [
        "sphinx",
        "tomli; python_version < '3.11'"
 ]
+formatter = [
+       "black ~= 24.1"
+]
 
 [project.urls]
 Homepage = "https://github.com/pkgcore/pkgcore";

Reply via email to