Skip to content

Update setup.py

Update setup.py #127

Workflow file for this run

name: Python Code Formatting
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
formatting:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install formatting tools
run: |
python -m pip install --upgrade pip
pip install black isort autoflake
- name: Apply formatting
run: |
isort -l 79 .
black -l 79 .
- name: Commit changes
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git diff --quiet && git diff --staged --quiet || (git commit -m "Apply black, isort, and autoflake formatting" && git push)