Skip to content

Commit b527298

Browse files
committed
Merge remote-tracking branch 'upstream/master' into bep038
2 parents 3c517b2 + b842180 commit b527298

File tree

103 files changed

+1278
-619
lines changed

Some content is hidden

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

103 files changed

+1278
-619
lines changed

.circleci/config.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ jobs:
5555
# failures for local file:/// -- yoh found no better way,
5656
linkchecker -t 1 --check-extern \
5757
--ignore-url 'file:///.*' \
58+
--ignore-url 'https://bids-specification.readthedocs.io/en/stable/.*' \
59+
--ignore-url 'https://doi.org/.*' \
5860
--ignore-url 'https://fonts.gstatic.com' \
59-
--ignore-url 'https://github.com/bids-standard/bids-specification/(pull|tree)/.*' \
6061
--ignore-url 'https://github.com/[^/]*' \
61-
--ignore-url 'https://doi.org/.*' \
62-
--ignore-url 'https://bids-specification.readthedocs.io/en/stable/.*' \
62+
--ignore-url 'https://github.com/bids-standard/bids-specification/(pull|tree)/.*' \
63+
--ignore-url 'https://www.incf.org' \
64+
--ignore-url 'https://dicomlookup.com/dicomtags/.*' \
6365
~/project/site/*html ~/project/site/*/*.html
6466
else
6567
echo "Release PR - do nothing"

.codespellrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[codespell]
2-
skip = *.js,*.svg,*.eps,.git,node_modules,env,venv,.mypy_cache,package-lock.json,CITATION.cff,tools/new_contributors.tsv,./tools/schemacode/docs/build
3-
ignore-words-list = fo,te,als,Acknowledgements,acknowledgements,weill,bu,winn,manuel
2+
skip = *.js,*.svg,*.eps,.git,node_modules,env,venv,.mypy_cache,package-lock.json,CITATION.cff,tools/new_contributors.tsv,./tools/schemacode/docs/build,venvs
3+
ignore-regex = \bHEP\b
4+
ignore-words-list = acknowledgements,als,bu,fo,te,weill,winn
45
builtin = clear,rare,en-GB_to_en-US
56
# this overloads default dictionaries and I have not yet figured out
67
# how to have multiple https://github.com/codespell-project/codespell/issues/2727

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ body:
1717
If not, please open an issue in the [bids-2-devel repository](https://github.com/bids-standard/bids-2-devel) instead.
1818
1919
- Is there already a group working on your idea?
20-
Check the [BIDS extension proposals](https://bids.neuroimaging.io/get_involved.html#extending-the-bids-specification)
20+
Check the [BIDS extension proposals](https://bids.neuroimaging.io/extensions/index.html)
2121
2222
- Will your idea potentially require a large effort?
2323
Read [BEP lead guidelines](https://docs.google.com/document/d/1pWmEEY-1-WuwBPNy5tDAxVJYQ9Een4hZJM06tQZg8X4/).

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ See the [CONTRIBUTING](https://github.com/bids-standard/bids-specification/blob/
77

88
- Please ensure your name is credited
99
on our [Contributors appendix](https://github.com/bids-standard/bids-specification/blob/master/src/appendices/contributors.md).
10-
To add your name, please edit our [Contributors wiki](https://github.com/bids-standard/bids-specification/wiki/Contributors)
10+
To add your name, please edit our [Recent Contributors wiki](https://github.com/bids-standard/bids-specification/wiki/Recent-Contributors)
1111
and add your name with the type of contribution.
1212
For assistance, please tag @bids-standard/maintainers.
1313

.github/workflows/publish_schema.yml

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- "master"
7+
- "maint/*"
78

89
concurrency:
910
group: ${{ github.workflow }}-${{ github.ref }}
@@ -34,13 +35,27 @@ jobs:
3435
- uses: actions/setup-python@v5
3536
with:
3637
python-version: 3
38+
- run: env
39+
- run: git status
40+
- name: Determine master/maintenance branch
41+
id: branch
42+
run: |
43+
if [[ "$GITHUB_REF_NAME" = "master" ]]; then
44+
echo "branch=jsr-dist" | tee -a $GITHUB_OUTPUT
45+
echo "mode=dev" | tee -a $GITHUB_OUTPUT
46+
else
47+
echo "branch=jsr-maint" | tee -a $GITHUB_OUTPUT
48+
echo "mode=maint" | tee -a $GITHUB_OUTPUT
49+
fi
3750
- name: Install bidsschematools
3851
run: |
3952
pip install --upgrade tools/schemacode
4053
git clean -fxd tools/schemacode
41-
- name: Checkout jsr-dist
54+
- name: Checkout ${{ steps.branch.outputs.branch }}
4255
run: |
43-
git checkout -t origin/jsr-dist
56+
git checkout -t origin/$JSR_BRANCH
57+
env:
58+
JSR_BRANCH: ${{ steps.branch.outputs.branch }}
4459
- name: Regenerate schema
4560
run: bst export > schema.json
4661
- name: Regenerate context types
@@ -54,36 +69,46 @@ jobs:
5469
bst export-metaschema > /tmp/schema.json
5570
npx --package=json-schema-to-typescript json2ts --unknownAny /tmp/schema.json > metaschema.ts
5671
- name: Determine next version
72+
id: version
5773
run: |
5874
BASE=$( jq -r .schema_version schema.json )
59-
if [[ "$BASE" =~ ^[0-9]*.[0-9]*.[0-9]*$ ]]; then
75+
if [[ "$BASE" =~ ^[0-9]*\.[0-9]*\.[0-9]*$ ]]; then
6076
# Release, so unconditionally update version
6177
VERSION=$BASE
6278
jq ".version = \"$VERSION\"" jsr.json > tmp.json && mv tmp.json jsr.json
63-
else
79+
echo release=true | tee -a $GITHUB_OUTPUT
80+
elif [[ "$BASE" =~ ^[0-9]*\.[0-9]*\.[0-9]*\.post[0-9]*$ ]]; then
81+
# Post-release, so replace .post with + for JSR semver
82+
VERSION=${BASE/.post/+}
83+
jq ".version = \"$VERSION\"" jsr.json > tmp.json && mv tmp.json jsr.json
84+
echo release=true | tee -a $GITHUB_OUTPUT
85+
elif [[ "$GITHUB_REF_NAME" = "master" ]]; then
6486
DENOVER=$( jq -r .version jsr.json )
6587
# Get the reference of the latest commit to touch the schema directory
66-
HASH=$( git log -n 1 --pretty=%h $REF -- src/schema )
88+
HASH=$( git log -n 1 --pretty=%h $GITHUB_REF -- src/schema )
6789
if [[ $DENOVER =~ ^"$BASE".[0-9] ]]; then
6890
PREFIX=${DENOVER%+*}
6991
let SERIAL=1+${PREFIX#$BASE.}
7092
else
7193
SERIAL=1
7294
fi
7395
VERSION="$BASE.$SERIAL+$HASH"
96+
echo release=true | tee -a $GITHUB_OUTPUT
97+
else
98+
echo release=false | tee -a $GITHUB_OUTPUT
7499
fi
75100
echo VERSION=$VERSION | tee -a $GITHUB_ENV
76-
env:
77-
REF: ${{ github.ref }}
78-
- name: Check for changes, set version and commit
101+
echo version=$VERSION | tee -a $GITHUB_OUTPUT
102+
- name: Bump version (${{ steps.version.outputs.version }}) if changed
103+
if: steps.version.outputs.release == 'true'
79104
run: |
80105
if ! git diff -s --exit-code; then
81106
jq ".version = \"$VERSION\"" jsr.json > tmp.json && mv tmp.json jsr.json
82107
git add jsr.json schema.json context.ts metaschema.ts
83-
git commit -m "Update schema JSR distribution"
108+
git commit -m "Update schema JSR distribution ($VERSION)"
84109
git push
85110
fi
86111
- name: Publish to JSR
87-
if: success()
112+
if: success() && steps.version.outputs.release == 'true'
88113
run: |
89114
npx jsr publish

.github/workflows/schemacode_ci.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ on:
44
push:
55
branches:
66
- "master"
7+
- "maint/*"
78
tags:
89
- "schema-*"
910
pull_request:
1011
branches:
12+
- "master"
13+
- "maint/*"
1114
- "*"
1215

1316
concurrency:
@@ -36,7 +39,9 @@ jobs:
3639
run: pip install --upgrade tools/schemacode[all]
3740
if: ${{ startsWith(github.ref, 'refs/tags/schema-') }}
3841
- name: "Build archive on tag"
39-
run: pytest tools/schemacode/bidsschematools -k make_archive
42+
run: |
43+
python -m pytest -k make_archive
44+
working-directory: tools/schemacode
4045
env:
4146
BIDSSCHEMATOOLS_RELEASE: 1
4247
if: ${{ startsWith(github.ref, 'refs/tags/schema-') }}
@@ -87,14 +92,15 @@ jobs:
8792
8893
- name: "Run tests"
8994
run: |
90-
python -m pytest -vs --pyargs bidsschematools -m "not validate_schema" \
91-
--cov-append --cov-report=xml --cov=bidsschematools --doctest-modules
95+
python -m pytest -vs --doctest-modules -m "not validate_schema" \
96+
--cov-append --cov-report=xml --cov-report=term --cov=src/bidsschematools
97+
working-directory: tools/schemacode
9298

9399
- name: Upload artifacts
94100
uses: actions/upload-artifact@v4
95101
with:
96102
name: unit_${{ matrix.os }}_${{ matrix.python-version }}
97-
path: coverage.xml
103+
path: tools/schemacode/coverage.xml
98104
if: success()
99105

100106
publish:
@@ -143,13 +149,16 @@ jobs:
143149
python -m pip install -e ./tools/schemacode[all]
144150
145151
- name: Run schema validation tests
146-
run: python -m pytest --pyargs bidsschematools -m "validate_schema" --cov-append --cov-report=xml --cov=bidsschematools
152+
run: |
153+
python -m pytest -vs --doctest-modules -m "not validate_schema" \
154+
--cov-append --cov-report=xml --cov-report=term --cov=src/bidsschematools
155+
working-directory: tools/schemacode
147156

148157
- name: Upload artifacts
149158
uses: actions/upload-artifact@v4
150159
with:
151160
name: schema_validation
152-
path: coverage.xml
161+
path: tools/schemacode/coverage.xml
153162
if: success()
154163

155164
upload_to_codecov:
@@ -164,7 +173,7 @@ jobs:
164173
uses: actions/download-artifact@v4
165174

166175
- name: Upload to CodeCov
167-
uses: codecov/codecov-action@v4
176+
uses: codecov/codecov-action@v5
168177
with:
169178
token: ${{ secrets.CODECOV_TOKEN }} # not required but might help API rate limits
170179
fail_ci_if_error: true

.pre-commit-config.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
ci:
44
skip: [shellcheck]
5-
exclude: 'tools/schemacode/bidsschematools/tests/data/broken_dataset_description.json'
5+
exclude: 'tools/schemacode/src/bidsschematools/tests/data/broken_dataset_description.json'
66
repos:
77
- repo: https://github.com/pre-commit/pre-commit-hooks
88
rev: v5.0.0
99
hooks:
1010
- id: trailing-whitespace
1111
- id: end-of-file-fixer
1212
- id: check-yaml
13+
args: [--unsafe]
1314
- id: check-json
1415
- id: check-toml
1516
- id: check-ast
1617
- id: check-added-large-files
1718
- id: check-case-conflict
1819
- repo: https://github.com/python-jsonschema/check-jsonschema
19-
rev: 0.29.4
20+
rev: 0.31.3
2021
hooks:
2122
- id: check-dependabot
2223
- id: check-github-workflows
@@ -26,7 +27,7 @@ repos:
2627
- id: check-readthedocs
2728
files: readthedocs.yml
2829
- repo: https://github.com/psf/black
29-
rev: 24.10.0
30+
rev: 25.1.0
3031
hooks:
3132
- id: black
3233
files: ^tools/(?!schemacode)
@@ -36,7 +37,7 @@ repos:
3637
files: tools/schemacode
3738
args: ["--config", "tools/schemacode/pyproject.toml", "--verbose"]
3839
- repo: https://github.com/pyCQA/isort
39-
rev: 5.13.2
40+
rev: 6.0.1
4041
hooks:
4142
- id: isort
4243
files: ^tools/(?!schemacode)
@@ -46,7 +47,7 @@ repos:
4647
files: tools/schemacode
4748
args: ["--settings-file", "tools/schemacode/pyproject.toml"]
4849
- repo: https://github.com/pyCQA/flake8
49-
rev: 7.1.1
50+
rev: 7.1.2
5051
hooks:
5152
- id: flake8
5253
args: [--config=tools/schemacode/.flake8]
@@ -68,12 +69,12 @@ repos:
6869
- id: pretty-format-toml
6970
args: [--autofix, --indent, '4', --no-sort]
7071
- repo: https://github.com/codespell-project/codespell
71-
rev: v2.3.0
72+
rev: v2.4.1
7273
hooks:
7374
- id: codespell
7475
args: ["--config=.codespellrc", "--dictionary=-", "--dictionary=.codespell_dict"]
7576
- repo: https://github.com/pre-commit/mirrors-mypy
76-
rev: v1.13.0
77+
rev: v1.15.0
7778
hooks:
7879
- id: mypy
7980
# Sync with project.optional-dependencies.typing
@@ -89,7 +90,7 @@ repos:
8990
- types-jsonschema
9091
- jsonschema
9192
- httpx
92-
args: ["tools/schemacode/bidsschematools"]
93+
args: ["tools/schemacode/src"]
9394
pass_filenames: false
9495
- repo: https://github.com/koalaman/shellcheck-precommit
9596
rev: v0.10.0

CODE_OF_CONDUCT.md

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

CONTRIBUTING.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ We hope that these guidelines are designed to make it as easy as possible to get
88
If you have any questions that aren't discussed below, please let us know
99
by [opening an issue](https://github.com/bids-standard/bids-specification/issues/new).
1010

11-
If you are not familiar with Git ansd GitHub,
12-
check our [generic contributing guidelines](https://bids-website.readthedocs.io/en/latest/collaboration/bids_github/CONTRIBUTING.html).
11+
If you are not familiar with Git and GitHub,
12+
check our [generic contributing guidelines](https://bids.neuroimaging.io/collaboration/bids_github/CONTRIBUTING.html).
1313

14-
If you want to contribute to the BIDS website,
14+
If you want to contribute to the BIDS specification,
1515
make sure you also read the instructions below.
1616

1717
## Table of contents
@@ -237,13 +237,10 @@ pip install -U pip
237237
pip install -r requirements.txt
238238
```
239239

240-
The first command ensures you are using an up to date version of `pip`,
240+
The first command ensures you are using an up-to-date version of `pip`,
241241
and the second command installs all dependencies.
242-
The third command ensures to install the BIDS schema code as an "editable" install,
243-
so that if you make changes to the schema files,
244-
these are automatically reflected in the sourcecode.
245242

246-
Note that if you need to work on the some of the Python code
243+
Note that if you need to work on some of the Python code
247244
that is used to render the specification,
248245
you will probably have to also run:
249246

0 commit comments

Comments
 (0)