From 0c0d05aa7a6c321974b7f9f35449e8da300d9f53 Mon Sep 17 00:00:00 2001 From: Louis PERDEREAU Date: Tue, 3 Dec 2024 15:27:09 +0100 Subject: [PATCH] chore: Add CI job for black and config in pyproject --- .github/workflows/tests.yml | 27 +++++++++++++++++++++++++++ dev-requirements.txt | 1 - pyproject.toml | 13 +++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/tests.yml delete mode 100644 dev-requirements.txt diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..972343e --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,27 @@ +name: Run tests + +jobs: + # Run tests for code formating + black: + runs-on: ubuntu-latest + concurrency: tests + environment: tests + permissions: + id-token: write + contents: write + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.10' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install black + - name: Build package + run: python -m black . diff --git a/dev-requirements.txt b/dev-requirements.txt deleted file mode 100644 index 7e66a17..0000000 --- a/dev-requirements.txt +++ /dev/null @@ -1 +0,0 @@ -black diff --git a/pyproject.toml b/pyproject.toml index 1c2eb0f..61ab68e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,3 +55,16 @@ env = "GH_TOKEN" [tool.semantic_release.publish] dist_glob_patterns = ["dist/*"] upload_to_vcs_release = true + +[tool.black] +line-length = 120 +exclude = ''' +/( + .git + .tox + .nox + .venv + build + dist +)/ +'''