Skip to content

Commit d2f89b9

Browse files
authored
Merge pull request #444 from effigies/mnt/updates
chore: Clean up doc builds, environment, style checks
2 parents 6501da1 + f471662 commit d2f89b9

File tree

8 files changed

+182
-146
lines changed

8 files changed

+182
-146
lines changed

.git-blame-ignore-revs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
# 2024-07-19 - [email protected] - chore(ruff): ruff check --fix && ruff format [git-blame-ignore-rev]
2+
6333f4735f341e556113325c7bc9d0f2e284e418
13
# 2024-03-07 - [email protected] - STY: ruff format smriprep [git-blame-ignore-rev]
24
83a50d465145c6e8176c3f13d4673ed4e0bdb26f
35
# 2023-11-21 - [email protected] - STY: ruff --fix smriprep [git-blame-ignore-rev]
4-
3a586cf46cb1bb963b93d9546f20273194d15de5
6+
5d4743142c43d415b761230d83a471cd5aae0314
57
# 2023-11-20 - [email protected] - STY: ruff --fix smriprep [git-blame-ignore-rev]
6-
c5e8b6b8ddb69284a4cba58e2512b299f1e29464
8+
946f030e4409bd2fcc044e4a0716ba8af91df247
79
# 2023-11-20 - [email protected] - STY: ruff format smriprep [git-blame-ignore-rev]
8-
8d62c0f3f3c6a911b1dfe2e9a2016b8de7da051a
10+
d14bcb0d65defd18affb6164867ab665c780637e

.pre-commit-config.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.4.0
3+
rev: v4.6.0
44
hooks:
55
- id: trailing-whitespace
66
exclude: '.gitignore|.*\.gii$'
@@ -11,7 +11,10 @@ repos:
1111
- id: check-toml
1212
- id: check-json
1313
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.3.1
14+
rev: v0.5.3
1515
hooks:
1616
- id: ruff
17+
args: [ --fix ]
1718
- id: ruff-format
19+
- id: ruff
20+
args: [ --select, ISC001, --fix ]

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
api/

docs/conf.py

Lines changed: 78 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,31 @@
1212
#
1313
import os
1414
import sys
15+
1516
from packaging.version import Version
1617

18+
from smriprep import (
19+
__copyright__ as _copyright,
20+
)
1721
from smriprep import (
1822
__package__ as _package,
23+
)
24+
from smriprep import (
1925
__version__ as _version,
20-
__copyright__ as _copyright,
2126
)
2227

23-
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "sphinxext")))
28+
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), 'sphinxext')))
2429

2530
from github_link import make_linkcode_resolve # noqa: E402
2631

2732
os.environ['NO_ET'] = '1'
2833

29-
sys.path.insert(0, os.path.abspath("../wrapper"))
34+
sys.path.insert(0, os.path.abspath('../wrapper'))
3035

3136
# -- Project information -----------------------------------------------------
3237
project = _package
33-
copyright = _copyright
34-
author = "The sMRIPrep Developers"
38+
copyright = _copyright # noqa: A001
39+
author = 'The sMRIPrep Developers'
3540

3641
# The short X.Y version
3742
version = Version(_version).public
@@ -41,30 +46,29 @@
4146

4247
# -- General configuration ---------------------------------------------------
4348
extensions = [
44-
"sphinx.ext.autodoc",
45-
"sphinx.ext.doctest",
46-
"sphinx.ext.intersphinx",
47-
"sphinx.ext.coverage",
48-
"sphinx.ext.mathjax",
49-
"sphinx.ext.ifconfig",
50-
"sphinx.ext.viewcode",
51-
"sphinx.ext.githubpages",
52-
"sphinxarg.ext", # argparse extension
53-
"sphinxcontrib.apidoc",
54-
"nipype.sphinxext.plot_workflow",
55-
"nipype.sphinxext.apidoc",
49+
'sphinx.ext.autodoc',
50+
'sphinx.ext.doctest',
51+
'sphinx.ext.intersphinx',
52+
'sphinx.ext.coverage',
53+
'sphinx.ext.mathjax',
54+
'sphinx.ext.ifconfig',
55+
'sphinx.ext.viewcode',
56+
'sphinx.ext.githubpages',
57+
'sphinxarg.ext', # argparse extension
58+
'sphinxcontrib.apidoc',
59+
'nipype.sphinxext.plot_workflow',
60+
'nipype.sphinxext.apidoc',
5661
]
5762

5863
autodoc_mock_imports = [
59-
"matplotlib",
60-
"nilearn",
61-
"nitime",
62-
"numpy",
63-
"pandas",
64-
"seaborn",
65-
"skimage",
66-
"svgutils",
67-
"transforms3d",
64+
'matplotlib',
65+
'nilearn',
66+
'nitime',
67+
'pandas',
68+
'seaborn',
69+
'skimage',
70+
'svgutils',
71+
'transforms3d',
6872
]
6973

7074
# Accept custom section names to be parsed for numpy-style docstrings
@@ -73,41 +77,41 @@
7377
# https://github.com/sphinx-contrib/napoleon/pull/10 is merged.
7478
napoleon_use_param = False
7579
napoleon_custom_sections = [
76-
("Inputs", "Parameters"),
77-
("Outputs", "Parameters"),
78-
("Attributes", "Parameters"),
79-
("Mandatory Inputs", "Parameters"),
80-
("Optional Inputs", "Parameters"),
80+
('Inputs', 'Parameters'),
81+
('Outputs', 'Parameters'),
82+
('Attributes', 'Parameters'),
83+
('Mandatory Inputs', 'Parameters'),
84+
('Optional Inputs', 'Parameters'),
8185
]
8286

8387
# Add any paths that contain templates here, relative to this directory.
84-
templates_path = ["_templates"]
88+
templates_path = ['_templates']
8589

8690
# The suffix(es) of source filenames.
8791
# You can specify multiple suffix as a list of string:
8892
#
8993
# source_suffix = ['.rst', '.md']
90-
source_suffix = ".rst"
94+
source_suffix = '.rst'
9195

9296
# The master toctree document.
93-
master_doc = "index"
97+
master_doc = 'index'
9498

9599
# The language for content autogenerated by Sphinx. Refer to documentation
96100
# for a list of supported languages.
97101
#
98102
# This is also used if you do content translation via gettext catalogs.
99103
# Usually you set "language" from the command line for these cases.
100-
language = "en"
104+
language = 'en'
101105

102106
# List of patterns, relative to source directory, that match files and
103107
# directories to ignore when looking for source files.
104108
# This pattern also affects html_static_path and html_extra_path.
105109
exclude_patterns = [
106-
"_build",
107-
"Thumbs.db",
108-
".DS_Store",
109-
"api/modules.rst",
110-
"api/smriprep.rst",
110+
'_build',
111+
'Thumbs.db',
112+
'.DS_Store',
113+
'api/modules.rst',
114+
'api/smriprep.rst',
111115
]
112116

113117
# The name of the Pygments (syntax highlighting) style to use.
@@ -119,7 +123,7 @@
119123
# The theme to use for HTML and HTML Help pages. See the documentation for
120124
# a list of builtin themes.
121125
#
122-
html_theme = "sphinx_rtd_theme"
126+
html_theme = 'sphinx_rtd_theme'
123127

124128
# Theme options are theme-specific and customize the look and feel of a theme
125129
# further. For a list of options available for each theme, see the
@@ -130,7 +134,7 @@
130134
# Add any paths that contain custom static files (such as style sheets) here,
131135
# relative to this directory. They are copied after the builtin static files,
132136
# so a file named "default.css" will overwrite the builtin "default.css".
133-
html_static_path = ["_static"]
137+
html_static_path = ['_static']
134138

135139
# Custom sidebar templates, must be a dictionary that maps document names
136140
# to template names.
@@ -146,7 +150,7 @@
146150
# -- Options for HTMLHelp output ---------------------------------------------
147151

148152
# Output file base name for HTML help builder.
149-
htmlhelp_basename = "smriprepdoc"
153+
htmlhelp_basename = 'smriprepdoc'
150154

151155

152156
# -- Options for LaTeX output ------------------------------------------------
@@ -172,10 +176,10 @@
172176
latex_documents = [
173177
(
174178
master_doc,
175-
"smriprep.tex",
176-
"sMRIPrep Documentation",
177-
"The NiPreps Developers",
178-
"manual",
179+
'smriprep.tex',
180+
'sMRIPrep Documentation',
181+
'The NiPreps Developers',
182+
'manual',
179183
),
180184
]
181185

@@ -184,7 +188,7 @@
184188

185189
# One entry per manual page. List of tuples
186190
# (source start file, name, description, authors, manual section).
187-
man_pages = [(master_doc, "smriprep", "sMRIPrep Documentation", [author], 1)]
191+
man_pages = [(master_doc, 'smriprep', 'sMRIPrep Documentation', [author], 1)]
188192

189193

190194
# -- Options for Texinfo output ----------------------------------------------
@@ -195,12 +199,12 @@
195199
texinfo_documents = [
196200
(
197201
master_doc,
198-
"smriprep",
199-
"sMRIPrep Documentation",
202+
'smriprep',
203+
'sMRIPrep Documentation',
200204
author,
201-
"sMRIPrep",
202-
"One line description of project.",
203-
"Miscellaneous",
205+
'sMRIPrep',
206+
'One line description of project.',
207+
'Miscellaneous',
204208
),
205209
]
206210

@@ -220,42 +224,42 @@
220224
# epub_uid = ''
221225

222226
# A list of files that should not be packed into the epub file.
223-
epub_exclude_files = ["search.html"]
227+
epub_exclude_files = ['search.html']
224228

225229

226230
# -- Extension configuration -------------------------------------------------
227231

228-
apidoc_module_dir = "../smriprep"
229-
apidoc_output_dir = "api"
232+
apidoc_module_dir = '../smriprep'
233+
apidoc_output_dir = 'api'
230234
apidoc_excluded_paths = [
231-
"conftest.py",
232-
"*/conftest.py",
233-
"*/tests/*",
234-
"tests/*",
235-
"data/*",
236-
"conf/*",
235+
'conftest.py',
236+
'*/conftest.py',
237+
'*/tests/*',
238+
'tests/*',
239+
'data/*',
240+
'conf/*',
237241
]
238242
apidoc_separate_modules = True
239-
apidoc_extra_args = ["--module-first", "-d 1", "-T"]
243+
apidoc_extra_args = ['--module-first', '-d 1', '-T']
240244

241245
# Options for github links
242246
# The following is used by sphinx.ext.linkcode to provide links to github
243247
linkcode_resolve = make_linkcode_resolve(
244-
"smriprep",
245-
"https://github.com/nipreps/smriprep/blob/{revision}/{package}/{path}#L{lineno}",
248+
'smriprep',
249+
'https://github.com/nipreps/smriprep/blob/{revision}/{package}/{path}#L{lineno}',
246250
)
247251

248252
# -- Options for intersphinx extension ---------------------------------------
249253
intersphinx_mapping = {
250-
"python": ("https://docs.python.org/3/", None),
251-
"numpy": ("https://numpy.org/doc/stable/", None),
252-
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
253-
"matplotlib": ("https://matplotlib.org/", None),
254-
"bids": ("https://bids-standard.github.io/pybids/", None),
255-
"nibabel": ("https://nipy.org/nibabel/", None),
256-
"nipype": ("https://nipype.readthedocs.io/en/latest/", None),
257-
"niworkflows": ("https://www.nipreps.org/niworkflows/", None),
258-
"templateflow": ("https://www.templateflow.org/python-client", None),
254+
'python': ('https://docs.python.org/3/', None),
255+
'numpy': ('https://numpy.org/doc/stable/', None),
256+
'scipy': ('https://docs.scipy.org/doc/scipy/', None),
257+
'matplotlib': ('https://matplotlib.org/', None),
258+
'bids': ('https://bids-standard.github.io/pybids/', None),
259+
'nibabel': ('https://nipy.org/nibabel/', None),
260+
'nipype': ('https://nipype.readthedocs.io/en/latest/', None),
261+
'niworkflows': ('https://www.nipreps.org/niworkflows/', None),
262+
'templateflow': ('https://www.templateflow.org/python-client', None),
259263
}
260264

261265
# -- Options for versioning extension ----------------------------------------

env.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ dependencies:
1010
# Intel Math Kernel Library for numpy
1111
- mkl=2023.2
1212
- mkl-service=2.4
13+
# ANTs is linked against libitk 5.3 but does not pin the version
14+
- libitk=5.3
1315
# Base scientific python stack; required by FSL, so pinned here
1416
- numpy=1.26
15-
- scipy=1.11
17+
- scipy=1.13
1618
- matplotlib=3.8
1719
- pandas=2.2
18-
- h5py=3.10
20+
- h5py=3.11
1921
# Dependencies compiled against numpy, best to stick with conda
20-
- scikit-image=0.22
22+
- scikit-image=0.23
2123
- scikit-learn=1.4
2224
# Utilities
2325
- graphviz=9.0
@@ -32,3 +34,5 @@ dependencies:
3234
- pip
3335
- pip:
3436
- -r requirements.txt
37+
variables:
38+
FSLOUTPUTTYPE: NIFTI_GZ

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ source = [
141141

142142
[tool.ruff]
143143
line-length = 99
144+
extend-exclude = [
145+
"wrapper/*.py",
146+
"docs/sphinxext/*",
147+
]
144148

145149
[tool.ruff.lint]
146150
extend-select = [
@@ -177,6 +181,7 @@ inline-quotes = "single"
177181

178182
[tool.ruff.lint.extend-per-file-ignores]
179183
"*/test_*.py" = ["S101"]
184+
"docs/conf.py" = ["A001"]
180185

181186
[tool.ruff.format]
182187
quote-style = "single"

0 commit comments

Comments
 (0)