Skip to content

Commit ce941e2

Browse files
authored
Merge branch 'master' into fix/acquisitionduration
2 parents d461a12 + 460ad10 commit ce941e2

File tree

27 files changed

+1256
-146
lines changed

27 files changed

+1256
-146
lines changed

.circleci/config.yml

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,14 @@ version: 2.1
22
jobs:
33
build_docs:
44
docker:
5-
- image: cimg/python:3.12-node
5+
- image: cimg/python:3.12
66
steps:
77
# checkout code to default ~/project
88
- checkout
9-
- run:
10-
name: install dependencies
11-
command: |
12-
python -m venv env
13-
source env/bin/activate
14-
python -m pip install --upgrade pip
15-
pip install -r requirements.txt
169
- run:
1710
name: generate docs
1811
command: |
19-
source env/bin/activate
20-
mkdocs build --clean --strict --verbose
12+
uv run mkdocs build --clean --strict --verbose
2113
- persist_to_workspace:
2214
# the mkdocs build outputs are in ~/project/site
2315
root: ~/project
@@ -31,26 +23,16 @@ jobs:
3123
docker:
3224
- image: cimg/python:3.12
3325
steps:
34-
# checkout code to default ~/project
3526
- checkout
3627
- attach_workspace:
37-
# mkdocs build outputs will be in ~/project/site
3828
at: ~/project
39-
- run:
40-
name: install linkchecker
41-
command: |
42-
python -m venv env
43-
source env/bin/activate
44-
python -m pip install --upgrade pip
45-
python -m pip install linkchecker
4629
- run:
4730
name: check links
4831
command: |
49-
source env/bin/activate
5032
git status
5133
if (! git log -1 --pretty=oneline | grep REL:) ; then
5234
chmod a+rX -R ~
53-
linkchecker -t 1 ~/project/site/
35+
uvx linkchecker -t 1 ~/project/site/
5436
# check external separately by pointing to all *html so no
5537
# failures for local file:/// -- yoh found no better way,
5638
linkchecker -t 1 --check-extern \
@@ -75,20 +57,17 @@ jobs:
7557
# checkout code to default ~/project
7658
- checkout
7759
- run:
78-
name: install dependencies
60+
name: install uv
7961
command: |
80-
apt-get update && apt install -y python3-pip python3-venv pandoc
81-
python3 -m venv .venv
82-
source .venv/bin/activate
83-
python3 -m pip install --upgrade pip
84-
python3 -m pip install -r ~/project/requirements.txt
85-
python3 -m pip install ~/project/tools/schemacode/[render]
62+
curl -LsSf https://astral.sh/uv/install.sh | XDG_BIN_HOME=/usr/local/bin sh
8663
- run:
87-
name: install font that works with unicode emojis
88-
command: apt-get update && apt-get install -y fonts-symbola
64+
name: install dependencies
65+
command: |
66+
apt-get update && apt install -y fonts-symbola pandoc
8967
- run:
9068
name: generate pdf version docs
9169
command: |
70+
uv sync
9271
source .venv/bin/activate
9372
cd ~/project/pdf_build_src
9473
bash build_pdf.sh

.github/dependabot.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
# Documentation
22
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
33
version: 2
4+
enable-beta-ecosystems: true
45
updates:
56
- package-ecosystem: "github-actions"
67
directory: "/"
78
schedule:
8-
interval: "weekly"
9+
interval: "monthly"
10+
labels:
11+
- "exclude-from-changelog"
12+
groups:
13+
actions-infrastructure:
14+
patterns:
15+
- "actions/*"
16+
- package-ecosystem: "uv"
17+
directory: "/"
18+
schedule:
19+
interval: "monthly"
920
labels:
1021
- "exclude-from-changelog"

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ share/python-wheels/
4545
*.egg
4646
MANIFEST
4747

48-
# Poetry requirements / packaging
49-
/pyproject.toml
50-
5148
# PyInstaller
5249
# Usually these files are written by a python script from a template
5350
# before PyInstaller builds the exe, so as to inject date/other infos into it.

CONTRIBUTING.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,18 @@ cd bids-specification
196196

197197
Enter all commands below from the command line prompt located at the root of the local version of the specification.
198198

199-
### 3. Install MkDocs, the Material theme and the required extensions
199+
### 3. Prepare your virtual environment
200+
201+
The simplest way to prepare a Python environment for building the specification is
202+
with [uv](https://docs.astral.sh/uv/).
203+
204+
```bash
205+
uv sync
206+
```
207+
208+
(If you use `uv run` in the next section, this will be run implicitly.)
209+
210+
<details><summary>Expand for detailed instructions that do not use `uv`.</summary>
200211

201212
In the following links, you can find more information about
202213

@@ -252,13 +263,17 @@ This installs the `bidsschemacode` package in "editable" mode,
252263
so that any changes you make to the code will be reflected when you use it,
253264
such as when you build the documentation locally.
254265

266+
</details>
267+
255268
### 4. Ready to build!
256269

257-
Using the terminal (command line) please enter `mkdocs serve`.
270+
Using the terminal (command line) please enter `uv run mkdocs serve`.
258271
This will allow you to see a local version of the specification.
259272
The local address will be `http://127.0.0.1:8000`.
260273
You may enter that into your browser and this will bring up the specification!
261274

275+
(If you are not using `uv`, activate your environment and then run `mkdocs serve`.)
276+
262277
## Fixing Markdown style errors
263278

264279
We use a linter called [Remarkjs](https://github.com/remarkjs/remark-lint) to

pyproject.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[project]
2+
name = "bids-specification"
3+
requires-python = ">=3.11"
4+
dependencies = [
5+
"bidsschematools[render]",
6+
"mkdocs>=1.1.0",
7+
"mkdocs-material>=5.4",
8+
"pymdown-extensions>=7.0.0",
9+
"mkdocs-branchcustomization-plugin~=0.1.3",
10+
"mkdocs-macros-plugin",
11+
"mkdocs-redirects",
12+
"numpy",
13+
]
14+
dynamic = ["version"]
15+
16+
[tool.uv.sources]
17+
bidsschematools = { path = "tools/schemacode", editable = true }
18+
19+
[dependency-groups]
20+
doc = [
21+
"sphinx>=7.2.2",
22+
"furo",
23+
"myst_parser",
24+
"bidsschematools[expressions]",
25+
]

readthedocs.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,22 @@ build:
55
tools:
66
python: latest
77
jobs:
8-
# The *_create_environment and post_install steps replace RTD's virtual environment
8+
# The *create_environment steps replace RTD's virtual environment
99
# steps with uv, a much faster alternative to virtualenv+pip.
10-
pre_create_environment:
10+
create_environment:
1111
# Install jq and uv
1212
- asdf plugin add jq https://github.com/lsanwick/asdf-jq.git
1313
- asdf plugin add uv https://github.com/asdf-community/asdf-uv.git
1414
- asdf install jq latest
1515
- asdf install uv latest
1616
- asdf global jq latest
1717
- asdf global uv latest
18-
# Turn `python -m virtualenv` into `python -c pass`
19-
- truncate --size 0 $( dirname $( uv python find ) )/../lib/python3*/site-packages/virtualenv/__main__.py
20-
post_create_environment:
21-
- uv venv $READTHEDOCS_VIRTUALENV_PATH
22-
# Turn `python -m pip` into `python -c pass`
23-
- truncate --size 0 $( ls -d $READTHEDOCS_VIRTUALENV_PATH/lib/python3* )/site-packages/pip.py
24-
# post_install replaces the top-level {python: {install: [{requirements: requirements.txt}]}}
25-
post_install:
26-
# Use a cache dir in the same mount to halve the install time
27-
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install --cache-dir $READTHEDOCS_VIRTUALENV_PATH/../../uv_cache -r requirements.txt
18+
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv venv
19+
install:
20+
- >
21+
VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH
22+
UV_CACHE_DIR=$READTHEDOCS_VIRTUALENV_PATH/../../uv_cache
23+
uv sync --active --locked
2824
# Normal pre-build step to inject schema.json into the source directory
2925
# so schema.json is hosted alongside the specification documents
3026
pre_build:

requirements.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/metaschema.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,7 @@
595595
},
596596
"required": ["level"],
597597
"additionalProperties": false
598-
},
599-
{ "type": "string", "pattern": "recommended.*" }
598+
}
600599
]
601600
},
602601
"issue": {

src/modality-specific-files/magnetic-resonance-imaging-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ A guide for using macros can be found at
161161
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
162162
-->
163163
{{ MACROS___make_sidecar_table([
164-
"mri.MRIB0FieldIdentifier",
164+
"fmap.MRIFieldmapB0FieldIdentifier",
165165
"mri.MRIEchoPlanarImagingAndB0FieldSource",
166166
])
167167
}}

src/schema/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ references (the cases in which they are used will be presented later):
167167
(which are in turn references to individual values), and the references inside `GeneticLevel.anyOf` indicate that there may be a single
168168
such value or a list of values.
169169

170-
1. In [`rules.files.deriv.preprocessed_data`](./rules/files/deriv/preprocessed_data.yaml):
170+
1. In [`rules.files.deriv.preprocessed_data`][preprocessed_data]:
171171
```YAML
172172
anat_nonparametric_common:
173173
$ref: rules.files.raw.anat.nonparametric
@@ -1071,4 +1071,5 @@ ensuring consistency across the entire schema directory. Validation of the schem
10711071
incorporated into the CI, so any changes that are inconsistent will be flagged before
10721072
inclusion.
10731073

1074+
[preprocessed_data]: https://github.com/bids-standard/bids-specification/tree/master/src/schema/rules/files/deriv/preprocessed_data.yaml
10741075
[tabular files]: https://bids-specification.readthedocs.io/en/stable/common-principles.html#tabular-files

0 commit comments

Comments
 (0)