Skip to content
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
9 changes: 4 additions & 5 deletions heudiconv/external/dlad.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

lgr = logging.getLogger(__name__)

MIN_VERSION = '0.12.4'
from ..info import MIN_DATALAD_VERSION as MIN_VERSION


def prepare_datalad(studydir, outdir, sid, session, seqinfo, dicoms, bids):
Expand Down Expand Up @@ -105,8 +105,7 @@ def add_to_datalad(topdir, studydir, msg, bids):
# Previously we did not have it as a submodule, and since no
# automagic migration is implemented, we just need to check first
# if any path under .heudiconv is already under git control
if any(x[0].startswith('.heudiconv/') for x in
ds.repo.repo.index.entries.keys()):
if any(x.startswith('.heudiconv/') for x in ds.repo.get_files()):
lgr.warning("%s has .heudiconv not as a submodule from previous"
" versions of heudiconv. No automagic migration is "
"yet provided", ds)
Expand All @@ -119,11 +118,11 @@ def add_to_datalad(topdir, studydir, msg, bids):
# we place all files under annex and then add
if create_file_if_missing(op.join(dsh_path, '.gitattributes'),
"""* annex.largefiles=anything"""):
ds.add('.heudiconv/.gitattributes',
ds.save('.heudiconv/.gitattributes',
to_git=True,
message="Added gitattributes to place all .heudiconv content"
" under annex")
ds.add('.', recursive=True, save=False,
ds.save('.', recursive=True
# not in effect! ?
#annex_add_opts=['--include-dotfiles']
)
Expand Down
2 changes: 1 addition & 1 deletion heudiconv/external/tests/test_dlad.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_mark_sensitive(tmpdir):
'g2': 'd1',
}
)
ds.add('.')
ds.save('.')
mark_sensitive(ds, 'f*')
all_meta = dict(ds.repo.get_metadata('.'))
target_rec = {'distribution-restrictions': ['sensitive']}
Expand Down
3 changes: 2 additions & 1 deletion heudiconv/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@
'inotify',
]

MIN_DATALAD_VERSION = '0.12.4'
EXTRA_REQUIRES = {
'tests': TESTS_REQUIRES,
'extras': [], # Requires patched version ATM ['dcmstack'],
'datalad': ['datalad >=0.12.3']
'datalad': ['datalad >=%s' % MIN_DATALAD_VERSION]
}

# Flatten the lists
Expand Down
2 changes: 1 addition & 1 deletion heudiconv/tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def test_prepare_for_datalad(tmpdir):
dummy_path = os.path.join(dsh_path, 'dummy.nii.gz')

create_file_if_missing(dummy_path, '')
ds.add(dummy_path, message="added a dummy file")
ds.save(dummy_path, message="added a dummy file")
# next call must not fail, should just issue a warning
add_to_datalad(str(tmpdir), studydir_, None, False)
ds.repo.is_under_annex(dummy_path)
Expand Down
4 changes: 4 additions & 0 deletions utils/test-compare-two-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ function run() {
shift
source $heudiconvdir/venvs/dev3/bin/activate
whichheudiconv=$(which heudiconv)
# to get "reproducible" dataset UUIDs (might be detremental if we had multiple datalad calls
# but since we use python API for datalad, should be Ok)
export DATALAD_SEED=1


if [ ! -e "$out" ]; then
# just do full conversion
Expand Down