datalad / datalad-container

DataLad extension for containerized environments
http://datalad.org
Other
11 stars 17 forks source link

Replace custom configuration definition with standard approach #244

Closed mih closed 1 year ago

mih commented 1 year ago

Since v0.16 datalad provides a register_config() helper for extensions to inject their own configuration into the central registry.

This changeset replaces the previous custom implementation with this standard approach. It has not consequences re user behavior.

An additional benefit is that this configuration is now also user-accessible, including a basic documentation:

>>> import datalad_container
>>> from datalad.api import configuration
>>> configuration('dump', 'datalad.containers.location')
# Container location
# path within the dataset where to store containers
# Value constraint: str
datalad.containers.location=.datalad/environments
[{'action': 'dump_configuration',
  'refds': '/home/mih/hacking/datalad/container',
  'name': 'datalad.containers.location',
  'value': '.datalad/environments',
  'purpose': 'Container location',
  'description': 'path within the dataset where to store containers',
  'value_type': constraint:str,
  'path': '/home/mih/hacking/datalad/container',
  'status': 'ok'}]

Closes #239

codeclimate[bot] commented 1 year ago

Code Climate has analyzed commit 8ca639ee and detected 0 issues on this pull request.

View more on Code Climate.

codecov[bot] commented 1 year ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (450b9a8) 94.74% compared to head (8ca639e) 94.74%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #244 +/- ## ======================================= Coverage 94.74% 94.74% ======================================= Files 25 24 -1 Lines 1104 1104 ======================================= Hits 1046 1046 Misses 58 58 ``` | [Files](https://app.codecov.io/gh/datalad/datalad-container/pull/244?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad) | Coverage Δ | | |---|---|---| | [datalad\_container/\_\_init\_\_.py](https://app.codecov.io/gh/datalad/datalad-container/pull/244?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9jb250YWluZXIvX19pbml0X18ucHk=) | `100.00% <100.00%> (ø)` | | | [datalad\_container/containers\_add.py](https://app.codecov.io/gh/datalad/datalad-container/pull/244?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9jb250YWluZXIvY29udGFpbmVyc19hZGQucHk=) | `89.74% <ø> (-0.07%)` | :arrow_down: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.