Skip to content

Commit

Permalink
Merge pull request #71 from nipreps/enh/54-migrating-reportlet-interf…
Browse files Browse the repository at this point in the history
…aces-2

ENH: Finalize migration of reporting interfaces
  • Loading branch information
effigies authored Oct 5, 2024
2 parents 6404af3 + cc88653 commit 67b5f0c
Show file tree
Hide file tree
Showing 14 changed files with 1,464 additions and 38 deletions.
49 changes: 47 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,31 @@ jobs:
- TEMPLATEFLOW_HOME: /tmp/templateflow
steps:
- checkout
- run:
name: Install uv
command: pip install uv

- run:
name: Install package
command: pip install .[test]

- run:
name: Git config - pacify datalad
command: |
git config --global user.name 'NiPreps Bot'
git config --global user.email '[email protected]'
- restore_cache:
keys:
- apt-v0
paths:
- /var/lib/apt

- run:
name: Install texlive
name: Install texlive and git-annex
command: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends dvipng texlive texlive-latex-extra cm-super
sudo apt-get install -y --no-install-recommends dvipng texlive texlive-latex-extra cm-super git-annex
- save_cache:
key: apt-v0
Expand All @@ -48,12 +58,47 @@ jobs:
command: |
python -c "from templateflow.api import get; get('Fischer344', desc=None, suffix='T2w')"
python -c "from templateflow.api import get; get('MNI152NLin6Asym', resolution=2, desc='LR', suffix='T1w')"
python -c "from templateflow.api import get; get('OASIS30ANTs', resolution=1, desc=None, suffix='T1w')"
python -c "from templateflow.api import get; get('OASIS30ANTs', resolution=1, desc='brain', suffix='mask')"
python -c "from templateflow.api import get; get('OASIS30ANTs', resolution=1, label='brain', suffix='probseg')"
python -c "from templateflow.api import get; get('OASIS30ANTs', resolution=1, desc='BrainCerebellumRegistration', suffix='mask')"
python -c "from templateflow.api import get; get('OASIS30ANTs', resolution=1, desc='4', suffix='dseg')"
python -c "from templateflow.api import get; get('fsLR', density='32k', hemi=['R', 'L'], suffix='inflated', extension='surf.gii')"
- save_cache:
key: tf-v0
paths:
- /tmp/templateflow

- restore_cache:
keys:
- data-v1-{{ .Branch }}-
- data-v1-master-
- data-v1-
- run:
name: Get test data from ds000003
command: |
mkdir -p /tmp/data
pushd /tmp/data
if [[ ! -d ds000003 ]]; then
uvx --with=datalad-osf datalad install -r https://github.com/nipreps-data/ds000003.git
fi
uvx --with=datalad-osf datalad update -r --merge -d ds000003/
uvx --with=datalad-osf datalad get -J 2 -r -d ds000003/ ds000003/*
popd
- save_cache:
key: data-v1-{{ .Branch }}-{{ epoch }}
paths:
- /tmp/data/ds000003

- run:
name: Store FreeSurfer license file
command: |
mkdir -p /tmp/fslicense
cd /tmp/fslicense
echo "cHJpbnRmICJrcnp5c3p0b2YuZ29yZ29sZXdza2lAZ21haWwuY29tXG41MTcyXG4gKkN2dW12RVYzelRmZ1xuRlM1Si8yYzFhZ2c0RVxuIiA+IGxpY2Vuc2UudHh0Cg==" | base64 -d | sh
- run:
name: Run unit tests
no_output_timeout: 2h
Expand Down
13 changes: 9 additions & 4 deletions nireports/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
os.environ["NO_ET"] = "1"

_datadir = (Path(__file__).parent / "tests" / "data").absolute()
niprepsdev_path = os.getenv("TEST_DATA_HOME", str(Path.home() / ".cache" / "nipreps-dev"))
niprepsdev_path = Path(os.getenv("TEST_DATA_HOME", Path.home() / ".cache" / "nipreps-dev"))
test_output_dir = os.getenv("TEST_OUTPUT_DIR")
test_workdir = os.getenv("TEST_WORK_DIR")

Expand All @@ -58,8 +58,8 @@ def expand_namespace(doctest_namespace):
doctest_namespace["os"] = os
doctest_namespace["pytest"] = pytest
doctest_namespace["Path"] = Path
doctest_namespace["testdata_path"] = _datadir
doctest_namespace["niprepsdev_path"] = niprepsdev_path
doctest_namespace["test_data_package"] = _datadir
doctest_namespace["test_data_home"] = niprepsdev_path

doctest_namespace["os"] = os
doctest_namespace["Path"] = Path
Expand All @@ -79,10 +79,15 @@ def expand_namespace(doctest_namespace):


@pytest.fixture
def testdata_path():
def test_data_package():
return _datadir


@pytest.fixture
def test_data_home():
return niprepsdev_path


@pytest.fixture
def workdir():
return None if test_workdir is None else Path(test_workdir)
Expand Down
Loading

0 comments on commit 67b5f0c

Please sign in to comment.