From fe9868875f1bbc3a58ef296dd9f2854ce07acbc6 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 26 Jan 2024 11:09:38 +0100 Subject: [PATCH] update black pre-commit hook and run it --- .pre-commit-config.yaml | 2 +- tools/examplecode/__init__.py | 1 + tools/mkdocs_macros_bids/macros.py | 1 + tools/mkdocs_macros_bids/main.py | 1 + tools/pull_files.py | 1 + tools/schemacode/bidsschematools/data/__init__.py | 1 + tools/schemacode/bidsschematools/data/tests/test_rules.py | 1 + tools/schemacode/bidsschematools/expressions.py | 1 + tools/schemacode/bidsschematools/render/__init__.py | 1 + tools/schemacode/bidsschematools/render/tables.py | 1 + tools/schemacode/bidsschematools/render/text.py | 1 + tools/schemacode/bidsschematools/render/utils.py | 1 + tools/schemacode/bidsschematools/rules.py | 1 + tools/schemacode/bidsschematools/schema.py | 1 + tools/schemacode/bidsschematools/tests/data/__init__.py | 1 + tools/schemacode/bidsschematools/tests/test_render_tables.py | 1 + tools/schemacode/bidsschematools/tests/test_render_text.py | 1 + tools/schemacode/bidsschematools/tests/test_schema.py | 1 + tools/schemacode/bidsschematools/types/namespace.py | 1 + tools/schemacode/bidsschematools/utils.py | 1 + 20 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3780ff968a..f6b269a1ca 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: - id: check-added-large-files - id: check-case-conflict - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.1.0 hooks: - id: black files: ^tools/(?!schemacode) diff --git a/tools/examplecode/__init__.py b/tools/examplecode/__init__.py index 886bf1c86a..414983f48d 100644 --- a/tools/examplecode/__init__.py +++ b/tools/examplecode/__init__.py @@ -1,4 +1,5 @@ """A Python package to render BIDS example with tree like output.""" + from examplecode.example import DirectoryTree __all__ = [ diff --git a/tools/mkdocs_macros_bids/macros.py b/tools/mkdocs_macros_bids/macros.py index aa29f21b28..f68453c6b8 100644 --- a/tools/mkdocs_macros_bids/macros.py +++ b/tools/mkdocs_macros_bids/macros.py @@ -1,4 +1,5 @@ """Functions used by the macros mkdocs plugin.""" + import os import sys diff --git a/tools/mkdocs_macros_bids/main.py b/tools/mkdocs_macros_bids/main.py index 30a93e6ce9..13bb5caf44 100644 --- a/tools/mkdocs_macros_bids/main.py +++ b/tools/mkdocs_macros_bids/main.py @@ -4,6 +4,7 @@ Functions decorated in "define_env()" are callable throughout the specification and are run/rendered with the mkdocs plugin "macros". """ + import os import sys diff --git a/tools/pull_files.py b/tools/pull_files.py index 2e6658ba83..a2a32aa552 100644 --- a/tools/pull_files.py +++ b/tools/pull_files.py @@ -7,6 +7,7 @@ https://github.com/alan-turing-institute/the-turing-way/blob/af98c94/tests/pull_files.py """ + import argparse import requests diff --git a/tools/schemacode/bidsschematools/data/__init__.py b/tools/schemacode/bidsschematools/data/__init__.py index e275ce39b4..14df1fc5ec 100644 --- a/tools/schemacode/bidsschematools/data/__init__.py +++ b/tools/schemacode/bidsschematools/data/__init__.py @@ -2,6 +2,7 @@ .. autofunction:: load_resource """ + import atexit import os from contextlib import ExitStack diff --git a/tools/schemacode/bidsschematools/data/tests/test_rules.py b/tools/schemacode/bidsschematools/data/tests/test_rules.py index c44634f814..e8da90ee93 100644 --- a/tools/schemacode/bidsschematools/data/tests/test_rules.py +++ b/tools/schemacode/bidsschematools/data/tests/test_rules.py @@ -1,4 +1,5 @@ """Simple validation tests on schema rules.""" + import warnings from collections.abc import Mapping diff --git a/tools/schemacode/bidsschematools/expressions.py b/tools/schemacode/bidsschematools/expressions.py index c850d24551..3c22673095 100644 --- a/tools/schemacode/bidsschematools/expressions.py +++ b/tools/schemacode/bidsschematools/expressions.py @@ -1,5 +1,6 @@ """Parsing utilities for BIDS Schema expression language """ + from functools import partial from pyparsing import ( diff --git a/tools/schemacode/bidsschematools/render/__init__.py b/tools/schemacode/bidsschematools/render/__init__.py index 506e6b4583..a251a1f3cd 100644 --- a/tools/schemacode/bidsschematools/render/__init__.py +++ b/tools/schemacode/bidsschematools/render/__init__.py @@ -1,4 +1,5 @@ """Functions for rendering elements of the schema in the specification text.""" + from bidsschematools.render.tables import ( make_columns_table, make_entity_table, diff --git a/tools/schemacode/bidsschematools/render/tables.py b/tools/schemacode/bidsschematools/render/tables.py index 90d091f5db..cf8645ffeb 100644 --- a/tools/schemacode/bidsschematools/render/tables.py +++ b/tools/schemacode/bidsschematools/render/tables.py @@ -1,4 +1,5 @@ """Functions for rendering portions of the schema as text.""" + from __future__ import annotations import logging diff --git a/tools/schemacode/bidsschematools/render/text.py b/tools/schemacode/bidsschematools/render/text.py index 6468007625..1106e17185 100644 --- a/tools/schemacode/bidsschematools/render/text.py +++ b/tools/schemacode/bidsschematools/render/text.py @@ -1,4 +1,5 @@ """Functions for rendering portions of the schema as text.""" + import logging import os diff --git a/tools/schemacode/bidsschematools/render/utils.py b/tools/schemacode/bidsschematools/render/utils.py index a482b54492..873699058e 100644 --- a/tools/schemacode/bidsschematools/render/utils.py +++ b/tools/schemacode/bidsschematools/render/utils.py @@ -1,4 +1,5 @@ """Utility functions for specification rendering tools.""" + import math import posixpath diff --git a/tools/schemacode/bidsschematools/rules.py b/tools/schemacode/bidsschematools/rules.py index 6dd837629f..d0d6f5dae9 100644 --- a/tools/schemacode/bidsschematools/rules.py +++ b/tools/schemacode/bidsschematools/rules.py @@ -3,6 +3,7 @@ This module is currently limited to constructing filename rules from ``schema.rules.files``. """ + import re import typing as ty from collections.abc import Mapping diff --git a/tools/schemacode/bidsschematools/schema.py b/tools/schemacode/bidsschematools/schema.py index 22dac02cb6..8a51725f1b 100644 --- a/tools/schemacode/bidsschematools/schema.py +++ b/tools/schemacode/bidsschematools/schema.py @@ -1,4 +1,5 @@ """Schema loading- and processing-related functions.""" + import logging import os import re diff --git a/tools/schemacode/bidsschematools/tests/data/__init__.py b/tools/schemacode/bidsschematools/tests/data/__init__.py index 6415366aea..978e681be5 100644 --- a/tools/schemacode/bidsschematools/tests/data/__init__.py +++ b/tools/schemacode/bidsschematools/tests/data/__init__.py @@ -2,6 +2,7 @@ .. autofunction:: load_test_data """ + from ...data import Loader __all__ = ("load_test_data",) diff --git a/tools/schemacode/bidsschematools/tests/test_render_tables.py b/tools/schemacode/bidsschematools/tests/test_render_tables.py index be41b8c5eb..9e1116fe68 100644 --- a/tools/schemacode/bidsschematools/tests/test_render_tables.py +++ b/tools/schemacode/bidsschematools/tests/test_render_tables.py @@ -1,4 +1,5 @@ """Tests for the bidsschematools package.""" + from bidsschematools.render import tables diff --git a/tools/schemacode/bidsschematools/tests/test_render_text.py b/tools/schemacode/bidsschematools/tests/test_render_text.py index 3d25fd8b32..e6745c8780 100644 --- a/tools/schemacode/bidsschematools/tests/test_render_text.py +++ b/tools/schemacode/bidsschematools/tests/test_render_text.py @@ -1,4 +1,5 @@ """Tests for the bidsschematools package.""" + import os import pytest diff --git a/tools/schemacode/bidsschematools/tests/test_schema.py b/tools/schemacode/bidsschematools/tests/test_schema.py index b0703361a3..5e7b0e3575 100644 --- a/tools/schemacode/bidsschematools/tests/test_schema.py +++ b/tools/schemacode/bidsschematools/tests/test_schema.py @@ -1,4 +1,5 @@ """Tests for the bidsschematools package.""" + import os from collections.abc import Mapping diff --git a/tools/schemacode/bidsschematools/types/namespace.py b/tools/schemacode/bidsschematools/types/namespace.py index b59e8bb586..39943ac3f0 100644 --- a/tools/schemacode/bidsschematools/types/namespace.py +++ b/tools/schemacode/bidsschematools/types/namespace.py @@ -4,6 +4,7 @@ YAML files available as a single dictionary and allow attribute (``.``) lookups. """ + import json import typing as ty from collections.abc import ItemsView, KeysView, Mapping, MutableMapping, ValuesView diff --git a/tools/schemacode/bidsschematools/utils.py b/tools/schemacode/bidsschematools/utils.py index 308fd981f6..ec2947fb37 100644 --- a/tools/schemacode/bidsschematools/utils.py +++ b/tools/schemacode/bidsschematools/utils.py @@ -1,4 +1,5 @@ """Utility functions for the bids-specification schema.""" + import logging from . import data