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: create: assure cfg_proc is list #3761

Merged
merged 1 commit into from
Oct 10, 2019
Merged

ENH: create: assure cfg_proc is list #3761

merged 1 commit into from
Oct 10, 2019

Conversation

adswa
Copy link
Member

@adswa adswa commented Oct 10, 2019

This uses assure_list to ensure that cfg_proc is a list. Else, something like this happens when using the Python API and cfp_proc='<proc_name>'

create(path='/tmp/t8', cfg_proc='text2git')                                                     
[INFO   ] Creating a new annex repo at /tmp/t8 
[WARNING] Cannot find procedure with name 'cfg_t' [run_procedure(cfg_t)]                                

Else, a Python call such as dl.create('path/to/ds', cfg_proc='text2git') fails with 'Cannot find procedure with name 'cfg_t'.'
@adswa
Copy link
Member Author

adswa commented Oct 10, 2019

One Appveyor job fails, but it does so because
"Build execution time has reached the maximum allowed time for your plan (60 minutes)."

Copy link
Member

@mih mih left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx!

@mih mih merged commit 23112f5 into datalad:master Oct 10, 2019
@adswa adswa deleted the cfg_proc branch October 10, 2019 11:41
@@ -206,6 +209,9 @@ def __call__(
# we know that we need to create a dataset at `path`
assert(path is not None)

# assure cfg_proc is a list (relevant if used via Python API)
cfg_proc = assure_list(cfg_proc)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess in the long run we should implement generic assure_list for any arg which has action='append',

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

although, it should not be just assure_list but rather allow having default None to discriminate between "nothing was specified" and "empty list was specified".
Then change below removing or [] would need to be reverted.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, automatically handling action='append' arguments seems like a good idea.

If backwards-compatibility weren't a concern, I'd prefer to get rid of all the atom -> list argument conversion that happens when using datalad's python api. But that ship has sailed (and I don't think others share my view).

@@ -206,6 +209,9 @@ def __call__(
# we know that we need to create a dataset at `path`
assert(path is not None)

# assure cfg_proc is a list (relevant if used via Python API)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh no, the misnamed function has infected your comment :] You're not trying to ease this list's mind or give it confidence about something. You're forcibly casting it to a list. Ensure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants