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 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")