Skip to content

Commit 0d66689

Browse files
authored
šŸ“¦ļø Restore bids-validator installation in containerized C-PAC images (#2120)
2 parents 32237e4 + 12cf540 commit 0d66689

File tree

6 files changed

+26
-8
lines changed

6 files changed

+26
-8
lines changed

ā€Ž.github/Dockerfiles/Ubuntu.jammy-non-free.Dockerfileā€Ž

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ FROM neurodebian:jammy-non-free
2929
LABEL org.opencontainers.image.description "NOT INTENDED FOR USE OTHER THAN AS A STAGE IMAGE IN A MULTI-STAGE BUILD \
3030
Ubuntu Jammy base image"
3131
LABEL org.opencontainers.image.source https://github.com/FCP-INDI/C-PAC
32-
ARG DEBIAN_FRONTEND=noninteractive
32+
ARG BIDS_VALIDATOR_VERSION=1.14.6 \
33+
DEBIAN_FRONTEND=noninteractive
3334
ENV TZ=America/New_York \
3435
PATH=$PATH:/.local/bin \
3536
PYTHONPATH=$PYTHONPATH:/.local/lib/python3.10/site-packages
@@ -61,7 +62,10 @@ RUN groupadd -r c-pac \
6162
&& echo $TZ > /etc/timezone \
6263
&& sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
6364
&& dpkg-reconfigure --frontend=noninteractive locales \
64-
&& update-locale LANG="en_US.UTF-8"
65+
&& update-locale LANG="en_US.UTF-8" \
66+
# # install bids-validator
67+
&& curl -fsSL https://raw.githubusercontent.com/tj/n/master/bin/n | bash -s lts \
68+
&& npm install -g "bids-validator@${BIDS_VALIDATOR_VERSION}"
6569

6670
COPY --from=c-pac_templates /cpac_templates /cpac_templates
6771
COPY --from=dcan-hcp /opt/dcan-tools/pipeline/global /opt/dcan-tools/pipeline/global

ā€ŽCHANGELOG.mdā€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2727
### Fixed
2828

2929
- A bug in which AWS S3 encryption was looked for in Nipype config instead of pipeline config (only affected uploading logs).
30+
- Restored `bids-validator` functionality.
3031

3132
### Removed
3233

ā€ŽCPAC/utils/tests/test_bids_utils.pyā€Ž

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
from logging import basicConfig, INFO
2020
import os
21+
from subprocess import run
2122

2223
import pytest
2324
import yaml
@@ -73,6 +74,11 @@ def _prefix_entities(paths, path):
7374
)
7475

7576

77+
def test_bids_validator() -> None:
78+
"""Test subprocess call to `bids-validator`."""
79+
run(["bids-validator", "--version"], check=True)
80+
81+
7682
@pytest.mark.parametrize("only_one_anat", [True, False])
7783
def test_create_cpac_data_config_only_one_anat(tmp_path, only_one_anat):
7884
"""Test 'only_one_anat' parameter of 'create_cpac_data_config' function."""

ā€ŽCPAC/utils/versioning/dependencies.pyā€Ž

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ def requirements() -> dict:
136136

137137
REPORTED = sorted_versions(
138138
{
139+
**cli_version(
140+
"bids-validator --version",
141+
dependency="bids-validator",
142+
in_result=False,
143+
formatting=first_line,
144+
),
139145
**cli_version("ldd --version", formatting=first_line),
140146
"Python": sys.version.replace("\n", " ").replace(" ", " "),
141147
**cli_version(

ā€Žpyproject.tomlā€Ž

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
# Copyright (C) 2024 C-PAC Developers
2-
2+
#
33
# This file is part of C-PAC.
4-
4+
#
55
# C-PAC is free software: you can redistribute it and/or modify it under
66
# the terms of the GNU Lesser General Public License as published by the
77
# Free Software Foundation, either version 3 of the License, or (at your
88
# option) any later version.
9-
9+
#
1010
# C-PAC is distributed in the hope that it will be useful, but WITHOUT
1111
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1212
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
1313
# License for more details.
14-
14+
#
1515
# You should have received a copy of the GNU Lesser General Public
1616
# License along with C-PAC. If not, see <https://www.gnu.org/licenses/>.
17+
1718
[build-system]
18-
requires = ["nipype", "numpy", "pyyaml", "setuptools", "voluptuous"]
19+
requires = ["nipype==1.8.6", "numpy==1.25.1", "pyyaml==6.0", "setuptools<60.0", "voluptuous==0.13.1"]
1920
build-backend = "setuptools.build_meta"

ā€Žrequirements.txtā€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ h5py==3.8.0
4545
importlib-metadata==6.8.0
4646
lxml==4.9.2
4747
pip==23.3
48-
setuptools==68.0.0
48+
setuptools<60.0
4949
urllib3==1.26.18
5050
wheel==0.40.0
5151
zipp==3.16.0

0 commit comments

Comments
Ā (0)