Skip to content

Commit 9cb268b

Browse files
authored
MAINT: Freeze black version (#185)
* MAINT: Freeze style check version * STY: Adjust exponent formatting * CI: Move away from external action * MAINT: Update style requirements
1 parent 322d670 commit 9cb268b

File tree

7 files changed

+17
-9
lines changed

7 files changed

+17
-9
lines changed

.github/workflows/style.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,15 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v2
2020
with:
21-
fetch-depth: 0
22-
- uses: jpetrucciani/black-check@master
21+
fetch-depth: 1 # Only fetch the latest commit
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v2
2324
with:
24-
path: 'nibabies/'
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install .[style]
30+
- name: black code formatting check
31+
run: |
32+
black --check nibabies/

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ repos:
77
- id: check-yaml
88
- id: check-added-large-files
99
- repo: https://github.com/psf/black
10-
rev: 21.12b0
10+
rev: 22.1.0
1111
hooks:
1212
- id: black

nibabies/cli/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def _min_one(value, parser):
3838
return value
3939

4040
def _to_gb(value):
41-
scale = {"G": 1, "T": 10 ** 3, "M": 1e-3, "K": 1e-6, "B": 1e-9}
41+
scale = {"G": 1, "T": 10**3, "M": 1e-3, "K": 1e-6, "B": 1e-9}
4242
digits = "".join([c for c in value if c.isdigit()])
4343
units = value[len(digits) :] or "M"
4444
return int(digits) * scale[units[0]]

nibabies/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
try:
158158
from psutil import virtual_memory
159159

160-
_free_mem_at_start = round(virtual_memory().free / 1024 ** 3, 1)
160+
_free_mem_at_start = round(virtual_memory().free / 1024**3, 1)
161161
except Exception:
162162
_free_mem_at_start = None
163163

nibabies/utils/misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def check_total_memory(recommended_gb):
8888
except ImportError:
8989
return
9090

91-
tot = int(psutil.virtual_memory().total / 1024 ** 3)
91+
tot = int(psutil.virtual_memory().total / 1024**3)
9292
return tot >= recommended_gb
9393

9494

nibabies/workflows/bold/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,7 @@ def _dpop(list_of_lists):
11711171

11721172

11731173
def _create_mem_gb(bold_fname):
1174-
bold_size_gb = os.path.getsize(bold_fname) / (1024 ** 3)
1174+
bold_size_gb = os.path.getsize(bold_fname) / (1024**3)
11751175
bold_tlen = nb.load(bold_fname).shape[-1]
11761176
mem_gb = {
11771177
"filesize": bold_size_gb,

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ duecredit =
7676
pointclouds =
7777
pyntcloud
7878
style =
79-
flake8 >= 3.7.0
79+
black ~= 22.1.0
8080
test =
8181
coverage < 5
8282
pytest >= 4.4

0 commit comments

Comments
 (0)