Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Finalize migration of reporting interfaces #71

Merged
merged 6 commits into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading