|
101 | 101 | "config_section": "package_manager_repos", |
102 | 102 | "accepted_configs": ["package_manager_repo.yaml", unified_config], |
103 | 103 | "singular": "package manager", |
| 104 | + "aliases": ["pkg", "package"], |
104 | 105 | }, |
105 | 106 | ObjectTypes.workflow_managers: { |
106 | 107 | "file_name": "workflow_manager.py", |
|
109 | 110 | "config_section": "workflow_manager_repos", |
110 | 111 | "accepted_configs": ["workflow_manager_repo.yaml", unified_config], |
111 | 112 | "singular": "workflow manager", |
| 113 | + "aliases": ["workflow"], |
112 | 114 | }, |
113 | 115 | ObjectTypes.systems: { |
114 | 116 | "file_name": "system.py", |
|
133 | 135 | "config_section": "base_class_repos", |
134 | 136 | "accepted_configs": ["base_class_repo.yaml", unified_config], |
135 | 137 | "singular": "base class", |
| 138 | + "aliases": ["base"], |
136 | 139 | }, |
137 | 140 | ObjectTypes.base_applications: { |
138 | 141 | "file_name": "base_application.py", |
|
157 | 160 | "config_section": "base_package_manager_repos", |
158 | 161 | "accepted_configs": ["base_package_manager_repo.yaml", unified_config], |
159 | 162 | "singular": "base package manager", |
| 163 | + "aliases": ["base_pkg"], |
160 | 164 | }, |
161 | 165 | ObjectTypes.base_workflow_managers: { |
162 | 166 | "file_name": "base_workflow_manager.py", |
|
165 | 169 | "config_section": "base_workflow_manager_repos", |
166 | 170 | "accepted_configs": ["base_workflow_manager_repo.yaml", unified_config], |
167 | 171 | "singular": "base workflow manager", |
| 172 | + "aliases": ["base_workflow"], |
168 | 173 | }, |
169 | 174 | ObjectTypes.base_systems: { |
170 | 175 | "file_name": "base_system.py", |
@@ -209,19 +214,18 @@ def _normalize_type_key(key): |
209 | 214 | return str(key).lower().replace("-", "_").replace(" ", "_") |
210 | 215 |
|
211 | 216 |
|
212 | | -_TYPE_ALIASES = { |
213 | | - "pkg": ObjectTypes.package_managers, |
214 | | - "package": ObjectTypes.package_managers, |
215 | | - "packages": ObjectTypes.package_managers, |
216 | | - "base_pkg": ObjectTypes.base_package_managers, |
217 | | - "workflow": ObjectTypes.workflow_managers, |
218 | | - "workflows": ObjectTypes.workflow_managers, |
219 | | - "base": ObjectTypes.base_classes, |
220 | | -} |
| 217 | +_TYPE_ALIASES = {} |
221 | 218 |
|
222 | 219 | for _obj in ObjectTypes: |
223 | 220 | _tdef = type_definitions.get(_obj, {}) |
224 | | - for _val in (_obj.name, _tdef.get("singular"), _tdef.get("abbrev"), _tdef.get("dir_name")): |
| 221 | + _candidates = [ |
| 222 | + _obj.name, |
| 223 | + _tdef.get("singular"), |
| 224 | + _tdef.get("abbrev"), |
| 225 | + _tdef.get("dir_name"), |
| 226 | + *_tdef.get("aliases", []), |
| 227 | + ] |
| 228 | + for _val in _candidates: |
225 | 229 | if isinstance(_val, str): |
226 | 230 | for _v in (_val, f"{_val}s"): |
227 | 231 | _norm = _normalize_type_key(_v) |
|
0 commit comments