diff --git a/.github/workflows/isort_check.yml b/.github/workflows/isort_check.yml new file mode 100644 index 00000000..4241bf35 --- /dev/null +++ b/.github/workflows/isort_check.yml @@ -0,0 +1,27 @@ +name: Black + +on: + push: + branches: [ main, release-1.0.0] + pull_request: + branches: [ main, release-1.0.0] + +jobs: + + check-black: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.11 + - name: Install isort 5.13.2 - check setup.py if version matches + run: | + python -m pip install --upgrade pip + pip install isort==5.13.2 + - name: Isort check + run: | + isort --check --diff factgenie || echo "We know it fails ATM" + isort --check --diff tests diff --git a/pyproject.toml b/pyproject.toml index f83c639e..60b9b103 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,12 @@ [tool.black] line-length = 120 target-version = ['py39'] +force-exclude = ''' +/( + \.git + | \.github +)/ +''' + +[tool.isort] +profile="black" diff --git a/setup.py b/setup.py index 203a4973..cbe92e06 100644 --- a/setup.py +++ b/setup.py @@ -67,6 +67,7 @@ # See also pyproject.toml and setup of line length (to 120 characters) "ipdb", "black==24.10.0", + "isort==5.13.2", ], "test": [ "pytest>=8.3.3", diff --git a/tests/conftest.py b/tests/conftest.py index 1bfd81f3..84b5101d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,6 +1,8 @@ # conftest.py -import pytest import shutil + +import pytest + from factgenie import MAIN_CONFIG_PATH diff --git a/tests/test_cli_commands.py b/tests/test_cli_commands.py index df4a3b77..f2453829 100644 --- a/tests/test_cli_commands.py +++ b/tests/test_cli_commands.py @@ -2,11 +2,11 @@ Run cli commands which wrap high level functionalites as a kind of functional tests. """ -from pathlib import Path -import subprocess import logging +import subprocess +from pathlib import Path -from factgenie import INPUT_DIR, OUTPUT_DIR, CAMPAIGN_DIR +from factgenie import CAMPAIGN_DIR, INPUT_DIR, OUTPUT_DIR def test_factgenie_help():