Skip to content

Commit d130604

Browse files
committed
pin Black to (20)22 & reformat using the new stable release
1 parent 2c43c85 commit d130604

File tree

6 files changed

+10
-9
lines changed

6 files changed

+10
-9
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ MODULE=cwltool
2525
# `SHELL=bash` doesn't work for some, so don't use BASH-isms like
2626
# `[[` conditional expressions.
2727
PYSOURCES=$(wildcard ${MODULE}/**.py tests/*.py) setup.py
28-
DEVPKGS=diff_cover black pylint pep257 pydocstyle flake8 tox tox-pyenv \
29-
isort wheel autoflake flake8-bugbear pyupgrade bandit \
28+
DEVPKGS=diff_cover pylint pep257 pydocstyle tox tox-pyenv \
29+
isort wheel autoflake pyupgrade bandit -rlint-requirements.txt\
3030
-rtest-requirements.txt -rmypy-requirements.txt
3131
DEBDEVPKGS=pep8 python-autopep8 pylint python-coverage pydocstyle sloccount \
3232
python-flake8 python-mock shellcheck

cwltool/executors.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ def __init__(self) -> None:
277277
self.pending_jobs = [] # type: List[JobsType]
278278
self.pending_jobs_lock = threading.Lock()
279279

280-
self.max_ram = int(psutil.virtual_memory().available / 2 ** 20) # type: ignore[no-untyped-call]
280+
self.max_ram = int(psutil.virtual_memory().available / 2**20) # type: ignore[no-untyped-call]
281281
self.max_cores = float(psutil.cpu_count())
282282
self.allocated_ram = float(0)
283283
self.allocated_cores = float(0)

cwltool/expression.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ def jshead(engine_config: List[str], rootvars: CWLObjectType) -> str:
3939
seg_single = r"""\['([^']|\\')+'\]"""
4040
seg_double = r"""\["([^"]|\\")+"\]"""
4141
seg_index = r"""\[[0-9]+\]"""
42-
segments = fr"(\.{seg_symbol}|{seg_single}|{seg_double}|{seg_index})"
42+
segments = rf"(\.{seg_symbol}|{seg_single}|{seg_double}|{seg_index})"
4343
segment_re = re.compile(segments, flags=re.UNICODE)
44-
param_str = fr"\(({seg_symbol}){segments}*\)$"
44+
param_str = rf"\(({seg_symbol}){segments}*\)$"
4545
param_re = re.compile(param_str, flags=re.UNICODE)
4646

4747

cwltool/job.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ def get_tree_mem_usage(memory_usage: MutableSequence[Optional[int]]) -> None:
546546
_logger.info(
547547
"[job %s] Max memory used: %iMiB",
548548
self.name,
549-
round(memory_usage[0] / (2 ** 20)),
549+
round(memory_usage[0] / (2**20)),
550550
)
551551
else:
552552
_logger.debug(
@@ -934,7 +934,7 @@ def docker_monitor(
934934
_logger.info(
935935
"[job %s] Max memory used: %iMiB",
936936
self.name,
937-
int((max_mem_percent / 100 * max_mem) / (2 ** 20)),
937+
int((max_mem_percent / 100 * max_mem) / (2**20)),
938938
)
939939
if cleanup_cidfile:
940940
os.remove(cidfile)

lint-requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
flake8-bugbear
2+
black ~= 22.0

tox.ini

+1-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ extras =
4545
deps =
4646
py3{7,8,9,10}-{unit,lint,bandit,mypy}: -rrequirements.txt
4747
py3{7,8,9,10}-{unit,mypy}: -rtest-requirements.txt
48-
py3{7,8,9,10}-lint: flake8-bugbear
49-
py3{7,8,9,10}-lint: black
48+
py3{7,8,9,10}-lint: -rlint-requirements.txt
5049
py3{7,8,9,10}-bandit: bandit
5150
py3{7,8,9,10}-bandit: importlib_metadata != 4.8.0
5251
py3{7,8,9,10}-mypy: -rmypy-requirements.txt

0 commit comments

Comments
 (0)