From 88ce771e848727c1ad021cdc98b7d788c0ee9901 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 2 Dec 2026 15:30:13 +0100 Subject: [PATCH 1/3] build: light core package; DataLad and nibabel move to extras The validator only needs click, jsonschema, license-expression and PyYAML. `tfmanager[add]` brings DataLad, nibabel and the client for `tfmgr add`; `tfmanager[content]` brings nibabel for image checks. Ruff is configured for the new modules. Co-Authored-By: Claude Opus 5.5 --- pyproject.toml | 12 ++++++++++++ setup.cfg | 24 +++++++++++++++++++----- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index accf07a..07cb122 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,3 +8,15 @@ write_to_template = """\ __version__ = "{version}" """ fallback_version = "0.0" + +[tool.ruff] +line-length = 99 +extend-exclude = ["docs", "tfmanager/_version.py"] + +[tool.ruff.format] +quote-style = "single" + +[tool.ruff.lint] +select = ["E", "F", "W", "I", "UP", "B"] +# cli.py, io.py and utils.py predate the linter +per-file-ignores = { "{setup.py,tfmanager/cli.py,tfmanager/io.py,tfmanager/utils.py}" = ["E", "W", "I", "UP", "B"] } diff --git a/setup.cfg b/setup.cfg index 4ce7304..10a5b69 100644 --- a/setup.cfg +++ b/setup.cfg @@ -25,17 +25,18 @@ setup_requires = setuptools_scm >= 8 toml install_requires = - click - datalad >= 0.16 - nibabel - numpy - templateflow >= 0.4.2 + click >= 8 + jsonschema >= 4.18 + license-expression >= 30.3 + pyyaml >= 6 toml packages = find: [options.package_data] tfmanager = data/*.LICENSE + schema/*.json + schema/*.yaml [options.packages.find] exclude = @@ -46,6 +47,19 @@ console_scripts = tfmgr=tfmanager.cli:cli [options.extras_require] +# Adding templates (tfmgr add, sanitize) and image checks (tfmgr validate --level content) +add = + datalad >= 0.16 + nibabel + numpy + templateflow >= 0.4.2 +content = + nibabel + numpy +test = + bidsschematools == 1.2.0 + pytest + %(content)s doc = nbsphinx packaging From e22e431fed3216b1be068ef99f3fa54d90ffe28f Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 2 Dec 2026 15:30:20 +0100 Subject: [PATCH 2/3] feat: TemplateFlow 2.0 rule set and `tfmgr validate` The rule set (tfmanager/schema) describes names, layout, metadata, lookup tables, licenses and atlases as YAML and JSON Schema. The entity order is derived from a vendored copy of the BIDS 1.11.0 schema. Each of the 69 rules has a code (TF101...), a slug, a severity and a legacy severity. `tfmgr validate` checks template directories, Archive checkouts and skeleton zips without annexed content; `--level content` opens images. Templates older than TemplateFlowVersion 2.0.0 are checked in legacy mode, where naming problems are warnings: the current Archive passes with 0 errors and the 1153 entity-order deviations found by the audit. Licenses are SPDX expressions (license-expression), and LICENSE files start with an `SPDX-License-Identifier:` line. Atlases are described in tpl-