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

Implement EnsureCredential #131

Open
mih opened this issue Nov 15, 2022 · 1 comment
Open

Implement EnsureCredential #131

mih opened this issue Nov 15, 2022 · 1 comment

Comments

@mih
Copy link
Member

mih commented Nov 15, 2022

suggested by #130 (comment)

@mih
Copy link
Member Author

mih commented Feb 18, 2023

This would also be a nice candidate to implement tests for Constraint.for_dataset()

mih added a commit to mih/datalad-next that referenced this issue Feb 24, 2023
This exposes a, so far dormant, feature of the `Constraint` class to
parameter validation: constraint tailoring for particular datasets.

`EnsureCommandParameterization` learned a `tailor_for_dataset` parameter
that can be used to identify which parameters' constraints should be
tailored for which `Dataset` instances. Tailoring will only be actually
done under the following conditions:

- the dataset-providing parameters need to evaluate to a
  DatasetParameter instance, typically via `EnsureDataset`
  (all regular conditions apply, e.g. a default `None` not being processed
  etc)
- the to-be-tailored parameter `Constraint` needs to implement its
  `for_dataset()` method to perform a tailoring.

A test with some custom-made constraints is included. At the moment,
no production-ready constraints do implement `for_dataset()`. However,
now that a consumer for that is available, it makes more sense to
address related issues, such as:

- datalad#193
- datalad#131

Closes datalad#200
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

No branches or pull requests

1 participant