From 841381dfc60e4fdebb5c0dede5bb1498742772c9 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 5 Feb 2024 14:39:49 +0100 Subject: [PATCH 1/3] apply precommi --- .github/dependabot.yml | 13 +++-- .github/workflows/test_and_coverage.yml | 78 +++++++++++++------------ .pre-commit-config.yaml | 37 +++++++----- bidsNighres/segment.py | 1 - 4 files changed, 69 insertions(+), 60 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f733c7a..e73f065 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,13 +1,14 @@ +--- # Documentation # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file version: 2 updates: - - package-ecosystem: 'github-actions' - directory: '/' +- package-ecosystem: github-actions + directory: / schedule: - interval: 'monthly' + interval: monthly - - package-ecosystem: 'gitsubmodule' - directory: '/' +- package-ecosystem: gitsubmodule + directory: / schedule: - interval: 'monthly' + interval: monthly diff --git a/.github/workflows/test_and_coverage.yml b/.github/workflows/test_and_coverage.yml index 926aae7..6baad69 100644 --- a/.github/workflows/test_and_coverage.yml +++ b/.github/workflows/test_and_coverage.yml @@ -1,43 +1,45 @@ +--- name: Test and coverage on: - push: - branches: [ master, main, dev ] - pull_request: - branches: [ master, main, dev ] + push: + branches: [master, main, dev] + pull_request: + branches: [master, main, dev] jobs: - build: - - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-latest, ubuntu-20.04] - python-version: ['3.8', '3.9', '3.10'] - - steps: - - - name: Clone repo - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools - pip install -r requirements.txt - - - name: Run tests and generate coverage report - run: pytest --cov=./ --cov-report=xml - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - with: - file: ./coverage.xml - flags: unittests - name: codecov-umbrella - fail_ci_if_error: true - verbose: true + build: + + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest, ubuntu-20.04] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + fail-fast: false # Don't cancel all jobs if one fails + + steps: + + - name: Clone repo + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools + pip install -r requirements.txt + + - name: Run tests and generate coverage report + run: pytest --cov=./ --cov-report=xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + file: ./coverage.xml + flags: unittests + name: codecov-umbrella + fail_ci_if_error: false + verbose: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d2f87d5..78ecac0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,26 +1,33 @@ +--- # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0pre-commit.ci] pre-commit autoupdate) +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 hooks: - - id: trailing-whitespace - - id: check-yaml - - id: check-added-large-files - - id: end-of-file-fixer + - id: trailing-whitespace + - id: check-yaml + - id: check-added-large-files + - id: end-of-file-fixer - - repo: https://github.com/psf/black +- repo: https://github.com/psf/black - rev: 22.10.0[pre-commit.ci] pre-commit autoupdate) + rev: 24.1.1 hooks: - - id: black + - id: black - - repo: https://github.com/ikamensh/flynt/ - rev: "0.76" +- repo: https://github.com/ikamensh/flynt/ + rev: 1.0.1 hooks: - - id: flynt + - id: flynt - - repo: https://github.com/asottile/reorder_python_imports - rev: v3.9.0 +- repo: https://github.com/asottile/reorder_python_imports + rev: v3.12.0 hooks: - - id: reorder-python-imports + - id: reorder-python-imports + +- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt + rev: 0.2.3 + hooks: + - id: yamlfmt + args: [--mapping, '4', --sequence, '4', --offset, '0'] diff --git a/bidsNighres/segment.py b/bidsNighres/segment.py index c65f256..2b2c714 100644 --- a/bidsNighres/segment.py +++ b/bidsNighres/segment.py @@ -70,7 +70,6 @@ def skullstrip(layout_in, layout_out, this_participant, bids_filter: dict): output_dir=output_dir, ) - bidsify_skullstrip_output( skullstrip_output, layout_in=layout_in, From 219030268c716d89cfc1473ecdc02eed8dd20c2e Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 5 Feb 2024 14:42:38 +0100 Subject: [PATCH 2/3] general maintenance --- .github/workflows/test_and_coverage.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_and_coverage.yml b/.github/workflows/test_and_coverage.yml index 6baad69..f0f9601 100644 --- a/.github/workflows/test_and_coverage.yml +++ b/.github/workflows/test_and_coverage.yml @@ -13,7 +13,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest, ubuntu-20.04] + os: [macos-latest, ubuntu-latest] python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] fail-fast: false # Don't cancel all jobs if one fails @@ -41,5 +41,6 @@ jobs: file: ./coverage.xml flags: unittests name: codecov-umbrella + token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: false verbose: true From 1a167ddaa4b73e6019264dc3f4dad74a0dd2c59a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 13:48:12 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/workflows/test_and_coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_and_coverage.yml b/.github/workflows/test_and_coverage.yml index f0f9601..d55f920 100644 --- a/.github/workflows/test_and_coverage.yml +++ b/.github/workflows/test_and_coverage.yml @@ -41,6 +41,6 @@ jobs: file: ./coverage.xml flags: unittests name: codecov-umbrella - token: ${{ secrets.CODECOV_TOKEN }} + token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: false verbose: true