From edbb865e7db49c1f37c920a5203e448d80cbf8da Mon Sep 17 00:00:00 2001 From: rocky Date: Tue, 2 Sep 2025 10:57:20 -0400 Subject: [PATCH 1/2] Try isort and black checks --- .github/workflows/isort-and-black-checks.yml | 32 ++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/isort-and-black-checks.yml diff --git a/.github/workflows/isort-and-black-checks.yml b/.github/workflows/isort-and-black-checks.yml new file mode 100644 index 0000000..04e23ec --- /dev/null +++ b/.github/workflows/isort-and-black-checks.yml @@ -0,0 +1,32 @@ +# GitHub Action that uses Black to reformat the Python code in an incoming pull request. +# If all Python code in the pull request is compliant with Black then this Action does nothing. +# Othewrwise, Black is run and its changes are committed back to the incoming pull request. +# https://github.com/cclauss/autoblack + +name: isort and black check +on: [pull_request] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.13 + uses: actions/setup-python@v5 + with: + python-version: 3.13 + - name: Install click, black and isort + run: pip install 'click==8.0.4' 'black==23.12.1' 'isort==5.13.2' + - name: Run isort --check . + run: isort --check . + - name: Run black --check . + run: black --check . + # - name: If needed, commit black changes to the pull request + # if: failure() + # run: | + # black . + # git config --global user.name 'autoblack' + # git config --global user.email 'rocky@users.noreply.github.com' + # git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY + # git checkout $GITHUB_HEAD_REF + # git commit -am "fixup: Format Python code with Black" + # git push From 5aa9c885fb2a7f6fc36a3888af4c3b72da853076 Mon Sep 17 00:00:00 2001 From: rocky Date: Tue, 2 Sep 2025 10:59:11 -0400 Subject: [PATCH 2/2] Put in isort order --- pymathics/hello/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymathics/hello/__init__.py b/pymathics/hello/__init__.py index 20ba6fa..bfe6ef0 100644 --- a/pymathics/hello/__init__.py +++ b/pymathics/hello/__init__.py @@ -27,8 +27,8 @@ """ -from pymathics.hello.version import __version__ from pymathics.hello.__main__ import Hello +from pymathics.hello.version import __version__ __all__ = ("__version__", "Hello", "pymathics_version_data")