diff --git a/.github/workflows/black-formatting.yml b/.github/workflows/black-formatting.yml new file mode 100644 index 000000000..8514e31bd --- /dev/null +++ b/.github/workflows/black-formatting.yml @@ -0,0 +1,29 @@ +name: Black formatting + +on: + workflow_dispatch: + schedule: + - cron: "0 12 * * 0" # Weekly at noon UTC on Sundays + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Check and apply black formatting + id: black-check + uses: psf/black@stable + with: + options: "--check --verbose" + continue-on-error: true + + - name: Create PR + uses: peter-evans/create-pull-request@v5 + if : ${{ steps.black-check.outcome == 'failure' }} + with: + commit-message: black formatting + title: Black formatting + body: Reformatting code with black style + branch: black-formatting diff --git a/.github/workflows/io-test.yml b/.github/workflows/io-test.yml index 66690722c..6f6009101 100644 --- a/.github/workflows/io-test.yml +++ b/.github/workflows/io-test.yml @@ -46,10 +46,10 @@ jobs: key: ${{ runner.os }}-datasets-${{ steps.ephy_testing_data.outputs.dataset_hash }} restore-keys: ${{ runner.os }}-datasets- - - uses: conda-incubator/setup-miniconda@v2.2.0 + - uses: conda-incubator/setup-miniconda@v3 with: activate-environment: neo-test-env - python-version: ${{ matrix.python-version }} + python-version: "${{ matrix.python-version }}" - name: Get current dependencies hash id: dependencies @@ -81,6 +81,11 @@ jobs: git config --global user.email "neo_ci@fake_mail.com" git config --global user.name "neo CI" + - name: Python version + run: | + which python + python --version + - name: Install neo including dependencies # installation with dependencies is only required if no cache was found # restore-key hits should result in `cache-hit` == 'false' diff --git a/pyproject.toml b/pyproject.toml index 8d886720c..480a183d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,7 +62,7 @@ test = [ "coverage", "coveralls", "pillow", - "sonpy", + "sonpy;python_version<'3.10'", "pynwb", "probeinterface", "zugbruecke>=0.2", @@ -84,7 +84,8 @@ docs = [ dev = [ "build", - "twine" + "twine", + "black" ] igorproio = ["igor2"] @@ -125,3 +126,7 @@ all = [ "zugbruecke>=0.2; sys_platform!='win32'", ] # we do not include 'stfio' in 'all' as it is not pip installable + + +[tool.black] +line-length = 120