Skip to content

Commit

Permalink
Merge pull request #2983 from yarikoptic/bf-2982
Browse files Browse the repository at this point in the history
BF+TST: do not pass "dataset" kwarg into a bound .get call
  • Loading branch information
yarikoptic committed Nov 7, 2018
2 parents 82aef44 + 148b23b commit 6c98cec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ bet we will fix some bugs and make a world even a better place.

### Fixes

?
- [install]: be able to install recursively into a dataset ([#2982])

### Enhancements and new features

Expand Down Expand Up @@ -944,3 +944,4 @@ publishing
[#2917]: https://github.com/datalad/datalad/issues/2917
[#2921]: https://github.com/datalad/datalad/issues/2921
[#2922]: https://github.com/datalad/datalad/issues/2922
[#2982]: https://github.com/datalad/datalad/issues/2982
4 changes: 4 additions & 0 deletions datalad/distribution/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,10 @@ def __call__(

# Now, recursive calls:
if recursive or get_data:
# dataset argument must not be passed inside since we use bound .get
# It is ok to do "inplace" as long as we still return right
# after the loop ends
common_kwargs.pop('dataset', '')
for r in destination_dataset.get(
curdir,
description=description,
Expand Down
6 changes: 6 additions & 0 deletions datalad/distribution/tests/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,12 @@ def test_install_recursive(src, path_nr, path_r):
# no unfulfilled subdatasets:
ok_(top_ds.subdatasets(recursive=True, fulfilled=False) == [])

# check if we can install recursively into a dataset
# https://github.com/datalad/datalad/issues/2982
subds = ds.install('recursive-in-ds', source=src, recursive=True)
ok_(subds.is_installed())
for subsub in subds.subdatasets(recursive=True, result_xfm='datasets'):
ok_(subsub.is_installed())

@with_testrepos('submodule_annex', flavors=['local'])
@with_tempfile(mkdir=True)
Expand Down

0 comments on commit 6c98cec

Please sign in to comment.