|
13 | 13 | from collections import OrderedDict |
14 | 14 | from copy import deepcopy |
15 | 15 | import logging as log |
| 16 | +from typing import Optional |
16 | 17 |
|
17 | 18 | from cfbs.index import Index |
18 | 19 | from cfbs.pretty import pretty, TOP_LEVEL_KEYS, MODULE_KEYS |
19 | 20 | from cfbs.utils import CFBSValidationError, read_json, CFBSExitError |
20 | 21 |
|
21 | 22 |
|
22 | | -def _construct_provided_module(name, data, url, commit, added_by="cfbs add"): |
| 23 | +def _construct_provided_module(name, data, url, commit, added_by): |
23 | 24 | # At this point the @commit part should be removed from url so: |
24 | 25 | # either url should not have an @, |
25 | 26 | # or the @ should be for [email protected] |
@@ -47,7 +48,8 @@ def _construct_provided_module(name, data, url, commit, added_by="cfbs add"): |
47 | 48 | "missing required key 'steps' in module definition: %s" % pretty(data) |
48 | 49 | ) |
49 | 50 | module["steps"] = data["steps"] |
50 | | - module["added_by"] = added_by |
| 51 | + if added_by is not None: |
| 52 | + module["added_by"] = added_by |
51 | 53 | return module |
52 | 54 |
|
53 | 55 |
|
@@ -172,7 +174,7 @@ def __getitem__(self, key): |
172 | 174 | def __contains__(self, key): |
173 | 175 | return key in self._data |
174 | 176 |
|
175 | | - def get_provides(self, added_by="cfbs add"): |
| 177 | + def get_provides(self, added_by: Optional[str]): |
176 | 178 | modules = OrderedDict() |
177 | 179 | assert self._data is not None |
178 | 180 | if "provides" not in self._data: |
|
0 commit comments