Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor #10

Merged
merged 8 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .github/pull_request_template.yml

This file was deleted.

33 changes: 17 additions & 16 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
changelog:
exclude:
labels:
- ignore-for-release
- ignore-for-release
categories:
- title: 🛠 Breaking Changes
labels:
- breaking-change
- title: 🎉 Exciting New Features
labels:
- enhancement
- title: 👎 Deprecations
labels:
- deprecation
- title: 🐛 Bug Fixes
labels:
- bug
- title: Other Changes
labels:
- "*"
- title: 🛠 Breaking Changes
labels:
- breaking-change
- title: 🎉 Exciting New Features
labels:
- enhancement
- title: 👎 Deprecations
labels:
- deprecation
- title: 🐛 Bug Fixes
labels:
- bug
- title: Other Changes
labels:
- '*'
1 change: 1 addition & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

Expand Down
65 changes: 33 additions & 32 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: "Run Tests"
---
name: Run Tests

on:
push:
branches:
- "main"
- main
pull_request:
branches:
- '*'
- '*'

concurrency:
group: environment-${{ github.ref }}
Expand All @@ -19,43 +20,43 @@ jobs:
outputs:
skip: ${{ steps.result_step.outputs.ci-skip }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: result_step
uses: mstachniuk/ci-skip@master
with:
commit-filter: '[skip ci];[ci skip];[skip github]'
commit-filter-separator: ';'
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: result_step
uses: mstachniuk/ci-skip@master
with:
commit-filter: '[skip ci];[ci skip];[skip github];[no ci]'
commit-filter-separator: ;

run_tests:
needs: check_skip
if: ${{ needs.check_skip.outputs.skip == 'false' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
name: ${{ matrix.os }} with Python ${{ matrix.python-version }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: 'Set up python'
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: 'Display Python version'
shell: bash {0}
run: python -c "import sys; print(sys.version)"
- name: 'Install pybids-reports'
shell: bash {0}
run: pip install -e .[tests]
- name: 'Run tests'
shell: bash {0}
run: python -m pytest --pyargs bids/ext/reports --cov=bids/ext/reports
- name: 'Upload coverage to CodeCov'
uses: codecov/codecov-action@v3
if: success()
- uses: actions/checkout@v3
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
shell: bash {0}
run: python -c "import sys; print(sys.version)"
- name: Install pybids-reports
shell: bash {0}
run: pip install -e .[tests]
- name: Run tests
shell: bash {0}
run: python -m pytest --pyargs bids/ext/reports --cov=bids/ext/reports
- name: Upload coverage to CodeCov
uses: codecov/codecov-action@v1
if: success()
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ repos:
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-ast
- id: check-added-large-files
- id: check-case-conflict


- repo: https://github.com/psf/black
Expand All @@ -17,8 +22,21 @@ repos:
rev: 6.0.0
hooks:
- id: flake8
args: [--config=setup.cfg]

# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.991
# hooks:
# - id: mypy

- repo: https://github.com/pyCQA/isort
rev: 5.10.1
hooks:
- id: isort


- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.2
hooks:
- id: yamlfmt
args: [--mapping, '2', --sequence, '2', --offset, '0']
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"autoDocstring.docstringFormat": "numpy"
}
4 changes: 2 additions & 2 deletions bids/ext/reports/due.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def nondecorating_decorator(func):
activate = add = cite = dump = load = _donothing

def __repr__(self):
return self.__class__.__name__ + "()"
return f"{self.__class__.__name__}()"


def _donothing_func(*args, **kwargs):
Expand All @@ -63,7 +63,7 @@ def _donothing_func(*args, **kwargs):
if type(e).__name__ not in ("ImportError", "ModuleNotFoundError"):
import logging

logging.getLogger("duecredit").error("Failed to import duecredit due to %s" % str(e))
logging.getLogger("duecredit").error(f"Failed to import duecredit due to {str(e)}")
# Initiate due stub
due = InactiveDueCreditCollector()
BibTeX = Doi = Url = Text = _donothing_func
Expand Down
Loading