Skip to content

Commit 1fe00d9

Browse files
authored
Merge branch 'master' into enh-project-datasettype
2 parents 02a8074 + 5a357dd commit 1fe00d9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+3248
-217
lines changed

.circleci/config.yml

Lines changed: 11 additions & 31 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,29 +23,19 @@ 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,
56-
linkchecker -t 1 --check-extern \
38+
uvx linkchecker -t 1 --check-extern \
5739
--ignore-url 'file:///.*' \
5840
--ignore-url 'https://bids-specification.readthedocs.io/en/stable/.*' \
5941
--ignore-url 'https://doi.org/.*' \
@@ -63,6 +45,7 @@ jobs:
6345
--ignore-url 'https://www.incf.org' \
6446
--ignore-url 'https://dicomlookup.com/dicomtags/.*' \
6547
--ignore-url 'https://www.instagram.com/bidsstandard/' \
48+
--ignore-url 'https://jsoneditoronline.org' \
6649
~/project/site/*html ~/project/site/*/*.html
6750
else
6851
echo "Release PR - do nothing"
@@ -75,20 +58,17 @@ jobs:
7558
# checkout code to default ~/project
7659
- checkout
7760
- run:
78-
name: install dependencies
61+
name: install uv
7962
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]
63+
curl -LsSf https://astral.sh/uv/install.sh | XDG_BIN_HOME=/usr/local/bin sh
8664
- run:
87-
name: install font that works with unicode emojis
88-
command: apt-get update && apt-get install -y fonts-symbola
65+
name: install dependencies
66+
command: |
67+
apt-get update && apt install -y fonts-symbola pandoc
8968
- run:
9069
name: generate pdf version docs
9170
command: |
71+
uv sync
9272
source .venv/bin/activate
9373
cd ~/project/pdf_build_src
9474
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"

.github/workflows/schemacode_ci.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,18 @@ jobs:
5757
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
5858
include:
5959
- os: macos-latest
60-
python-version: 3
60+
python-version: 3.13
6161
- os: windows-latest
62-
python-version: 3
62+
python-version: 3.13
6363
name: ${{ matrix.os }} with Python ${{ matrix.python-version }}
6464
steps:
6565
- uses: actions/checkout@v4
6666

67-
- name: "Set up Python"
68-
uses: actions/setup-python@v5
67+
- name: Set up Python ${{ matrix.python-version }} (uv)
68+
uses: astral-sh/setup-uv@v6
6969
with:
7070
python-version: ${{ matrix.python-version }}
71-
allow-prereleases: true
71+
activate-environment: true
7272

7373
- name: "Display Python version"
7474
run: python -c "import sys; print(sys.version)"
@@ -81,14 +81,19 @@ jobs:
8181

8282
- name: "Install package"
8383
run: |
84-
pip install $( ls dist/*.whl )[all]
84+
uv pip install $( ls dist/*.whl )[all]
8585
8686
- name: "Run tests"
8787
run: |
8888
python -m pytest -vs --doctest-modules -m "not validate_schema" \
8989
--cov-append --cov-report=xml --cov-report=term --cov=src/bidsschematools
9090
working-directory: tools/schemacode
9191

92+
- name: "Validate generated types"
93+
run: |
94+
uvx --with=. mypy tests
95+
working-directory: tools/schemacode
96+
9297
- name: Upload artifacts
9398
uses: actions/upload-artifact@v4
9499
with:
@@ -140,7 +145,7 @@ jobs:
140145
141146
- name: Run schema validation tests
142147
run: |
143-
python -m pytest -vs --doctest-modules -m "not validate_schema" \
148+
python -m pytest -vs --doctest-modules -m "validate_schema" \
144149
--cov-append --cov-report=xml --cov-report=term --cov=src/bidsschematools
145150
working-directory: tools/schemacode
146151

.gitignore

Lines changed: 1 addition & 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.
@@ -147,6 +144,7 @@ venv.bak/
147144

148145
# schema docs documentation
149146
tools/schemacode/build/*
147+
_build/
150148

151149
# mypy
152150
.mypy_cache/

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ci:
55
exclude: 'tools/schemacode/src/bidsschematools/tests/data/broken_dataset_description.json'
66
repos:
77
- repo: https://github.com/pre-commit/pre-commit-hooks
8-
rev: v5.0.0
8+
rev: v6.0.0
99
hooks:
1010
- id: trailing-whitespace
1111
- id: end-of-file-fixer
@@ -17,7 +17,7 @@ repos:
1717
- id: check-added-large-files
1818
- id: check-case-conflict
1919
- repo: https://github.com/python-jsonschema/check-jsonschema
20-
rev: 0.33.0
20+
rev: 0.33.2
2121
hooks:
2222
- id: check-dependabot
2323
- id: check-github-workflows
@@ -49,7 +49,7 @@ repos:
4949
- id: codespell
5050
args: ["--config=.codespellrc", "--dictionary=-", "--dictionary=.codespell_dict"]
5151
- repo: https://github.com/pre-commit/mirrors-mypy
52-
rev: v1.16.0
52+
rev: v1.17.1
5353
hooks:
5454
- id: mypy
5555
# Sync with project.optional-dependencies.typing
@@ -68,6 +68,6 @@ repos:
6868
args: ["tools/schemacode/src"]
6969
pass_filenames: false
7070
- repo: https://github.com/koalaman/shellcheck-precommit
71-
rev: v0.10.0
71+
rev: v0.11.0
7272
hooks:
7373
- id: shellcheck

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: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
"bidsschematools[expressions]",
22+
"sphinx>=7.2.2",
23+
"furo",
24+
"myst_parser",
25+
"myst-nb",
26+
"universal_pathlib",
27+
"fsspec[http]",
28+
]

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/appendices/contributors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Contributors
22

33
Legend (source:
4-
<https://allcontributors.org/docs/en/emoji-key>)
4+
<https://github.com/all-contributors/all-contributors/blob/master/docs/emoji-key.md>)
55

66
| **Emoji** | **Represents** |
77
| --------- | -------------------------------------------------------------------------------------- |

0 commit comments

Comments
 (0)