Skip to content

Commit 94c70e7

Browse files
authored
Merge branch 'bids-standard:master' into master
2 parents 4124c1c + cc32779 commit 94c70e7

File tree

11 files changed

+2133
-264
lines changed

11 files changed

+2133
-264
lines changed

.github/dependabot.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ updates:
66
- package-ecosystem: "github-actions"
77
directory: "/"
88
schedule:
9-
interval: "monthly"
9+
interval: "quarterly"
1010
labels:
1111
- "exclude-from-changelog"
1212
groups:
@@ -18,7 +18,18 @@ updates:
1818
- package-ecosystem: "uv"
1919
directory: "/"
2020
schedule:
21-
interval: "monthly"
21+
interval: "quarterly"
22+
labels:
23+
- "exclude-from-changelog"
24+
groups:
25+
build-dependencies:
26+
patterns: ["*"]
27+
cooldown:
28+
default-days: 14
29+
- package-ecosystem: "uv"
30+
directory: "tools/schemacode"
31+
schedule:
32+
interval: "quarterly"
2233
labels:
2334
- "exclude-from-changelog"
2435
groups:
@@ -29,7 +40,7 @@ updates:
2940
- package-ecosystem: "npm"
3041
directory: "/"
3142
schedule:
32-
interval: "monthly"
43+
interval: "quarterly"
3344
labels:
3445
- "exclude-from-changelog"
3546
groups:
@@ -41,7 +52,7 @@ updates:
4152
target-branch: jsr-maint
4253
directory: "/"
4354
schedule:
44-
interval: "monthly"
55+
interval: "quarterly"
4556
labels:
4657
- "exclude-from-changelog"
4758
- "schema-code"
Lines changed: 77 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "schemacode_ci"
1+
name: bst
22

33
on:
44
push:
@@ -21,6 +21,13 @@ defaults:
2121
run:
2222
shell: bash
2323

24+
# Force tox and pytest to use color
25+
env:
26+
FORCE_COLOR: true
27+
28+
permissions:
29+
contents: read
30+
2431
jobs:
2532
build:
2633
name: Build & verify package
@@ -37,7 +44,7 @@ jobs:
3744
if: ${{ startsWith(github.ref, 'refs/tags/schema-') }}
3845
- name: "Build archive on tag"
3946
run: |
40-
uv run --extra=tests pytest -k make_archive
47+
uv run --group=tests pytest -k make_archive
4148
working-directory: tools/schemacode
4249
env:
4350
BIDSSCHEMATOOLS_RELEASE: 1
@@ -47,128 +54,112 @@ jobs:
4754
path: tools/schemacode
4855
attest-build-provenance-github: ${{ github.event_name != 'pull_request' }}
4956

50-
test:
57+
tox:
5158
runs-on: ${{ matrix.os }}
52-
needs: [build]
5359
strategy:
5460
fail-fast: false
5561
matrix:
56-
os: ["ubuntu-latest"]
57-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
62+
os: [ubuntu-latest]
63+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
64+
dependencies: [latest]
5865
include:
5966
- os: macos-latest
60-
python-version: 3.13
67+
python-version: '3.14'
68+
dependencies: latest
6169
- os: windows-latest
62-
python-version: 3.13
63-
name: ${{ matrix.os }} with Python ${{ matrix.python-version }}
70+
python-version: '3.14'
71+
dependencies: latest
72+
- os: ubuntu-latest
73+
python-version: '3.10'
74+
dependencies: min
6475
steps:
6576
- uses: actions/checkout@v6
77+
with:
78+
submodules: recursive
6679

6780
- name: Set up Python ${{ matrix.python-version }} (uv)
6881
uses: astral-sh/setup-uv@v7
6982
with:
7083
python-version: ${{ matrix.python-version }}
7184
activate-environment: true
7285

73-
- name: "Display Python version"
86+
- name: Display Python version
7487
run: python -c "import sys; print(sys.version)"
7588

76-
- name: "Fetch packages"
77-
uses: actions/download-artifact@v7
78-
with:
79-
name: Packages
80-
path: dist
89+
- name: Install tox
90+
run: uv tool install -v tox --with=tox-uv --with=tox-gh-actions
8191

82-
- name: "Install package"
83-
run: |
84-
uv pip install $( ls dist/*.whl )[all]
92+
- name: Show tox config
93+
run: tox c
94+
working-directory: tools/schemacode
8595

86-
- name: "Run tests"
87-
run: |
88-
python -m pytest -vs --doctest-modules -m "not validate_schema" \
89-
--cov-append --cov-report=xml --cov-report=term --cov=src/bidsschematools
96+
- name: Setup test suite
97+
run: tox run -vv --notest
9098
working-directory: tools/schemacode
9199

92-
- name: "Validate generated types"
93-
run: |
94-
uvx --with=. mypy tests
100+
- name: Run test suite
101+
run: tox -v --skip-pkg-install --exit-and-dump-after 1200
95102
working-directory: tools/schemacode
96103

97-
- name: Upload artifacts
98-
uses: actions/upload-artifact@v6
104+
- uses: codecov/codecov-action@v5
105+
if: ${{ always() }}
99106
with:
100-
name: unit_${{ matrix.os }}_${{ matrix.python-version }}
101-
path: tools/schemacode/coverage.xml
102-
if: success()
107+
files: tools/schemacode/cov.xml
108+
token: ${{ secrets.CODECOV_TOKEN }}
109+
110+
- name: Upload pytest test results
111+
uses: actions/upload-artifact@v7
112+
with:
113+
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.dependencies }}-${{ matrix.architecture }}
114+
path: tools/schemacode/test-results.xml
115+
if: ${{ always() }}
116+
117+
checks:
118+
runs-on: 'ubuntu-slim'
119+
continue-on-error: true
120+
strategy:
121+
matrix:
122+
check: ['typecheck']
123+
124+
steps:
125+
- uses: actions/checkout@v6
126+
- name: Setup uv and Python
127+
uses: astral-sh/setup-uv@v7
128+
with:
129+
python-version: 3
130+
activate-environment: true
131+
- name: Display Python version
132+
run: python -c "import sys; print(sys.version)"
133+
- name: Install tox
134+
run: uv tool install -v tox --with=tox-uv-bare --with=tox-gh-actions
135+
- name: Show tox config (this call)
136+
run: tox c -e ${{ matrix.check }}
137+
working-directory: tools/schemacode
138+
- name: Setup check environment
139+
run: tox -vv --notest -e ${{ matrix.check }}
140+
working-directory: tools/schemacode
141+
- name: Run check
142+
run: tox -e ${{ matrix.check }}
143+
working-directory: tools/schemacode
103144

104145
publish:
105-
name: Publish Python Package
106-
if: github.event_name == 'push'
107146
runs-on: ubuntu-latest
108-
needs: [test]
147+
environment: "Package deployment"
148+
needs: [build, tox]
109149
permissions:
110150
attestations: write
111151
id-token: write
112-
152+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
113153
steps:
114-
- name: Download packages built by build-and-inspect-python-package
115-
uses: actions/download-artifact@v7
154+
- uses: actions/download-artifact@v7
116155
with:
117-
name: Packages
118-
path: dist
156+
name: dist
157+
path: dist/
119158
- name: "Test PyPI upload"
120159
uses: pypa/gh-action-pypi-publish@release/v1
121160
with:
122-
user: __token__
123-
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
124161
repository-url: https://test.pypi.org/legacy/
125162
skip-existing: true
126163
- name: "Upload to PyPI (on tags)"
127164
if: startsWith(github.ref, 'refs/tags/schema-')
128165
uses: pypa/gh-action-pypi-publish@release/v1
129-
130-
validate_schema:
131-
runs-on: ubuntu-latest
132-
name: Validate schema
133-
steps:
134-
- uses: actions/checkout@v6
135-
136-
- name: Set Up Python environment
137-
uses: actions/setup-python@v6
138-
with:
139-
python-version: "3.11"
140-
141-
- name: Install the schemacode package
142-
run: |
143-
python -m pip install --progress-bar off --upgrade pip setuptools wheel
144-
python -m pip install -e ./tools/schemacode[all]
145-
146-
- name: Run schema validation tests
147-
run: |
148-
python -m pytest -vs --doctest-modules -m "validate_schema" \
149-
--cov-append --cov-report=xml --cov-report=term --cov=src/bidsschematools
150-
working-directory: tools/schemacode
151-
152-
- name: Upload artifacts
153-
uses: actions/upload-artifact@v6
154-
with:
155-
name: schema_validation
156-
path: tools/schemacode/coverage.xml
157-
if: success()
158-
159-
upload_to_codecov:
160-
runs-on: "ubuntu-latest"
161-
name: Upload coverage
162-
needs: [test, validate_schema]
163-
steps:
164-
- name: Checkout
165-
uses: actions/checkout@v6
166-
167-
- name: Download artifacts
168-
uses: actions/download-artifact@v7
169-
170-
- name: Upload to CodeCov
171-
uses: codecov/codecov-action@v5
172-
with:
173-
token: ${{ secrets.CODECOV_TOKEN }} # not required but might help API rate limits
174-
fail_ci_if_error: true

.pre-commit-config.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ ci:
44
skip: [shellcheck]
55
autoupdate_schedule: monthly
66

7-
exclude: 'tools/schemacode/src/bidsschematools/tests/data/broken_dataset_description.json'
8-
7+
exclude: 'broken_dataset_description.json|uv.lock'
98
repos:
109
- repo: https://github.com/pre-commit/pre-commit-hooks
1110
rev: v6.0.0

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"remark-lint-no-trailing-spaces": "^4.0.3",
1212
"remark-preset-lint-markdown-style-guide": "^6.0.1",
1313
"remark-preset-lint-recommended": "^7.0.1",
14-
"prettier": "^3.8.0",
14+
"prettier": "^3.8.1",
1515
"all-contributors-cli": "^6.26.1"
1616
}
1717
}

0 commit comments

Comments
 (0)