File tree Expand file tree Collapse file tree 3 files changed +20
-6
lines changed Expand file tree Collapse file tree 3 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -119,12 +119,11 @@ class and related decorators.
119
119
# Decorators
120
120
from .decorators import step , _import_plugin_decorators
121
121
122
- # Config parsers
123
- from .plugins .pypi .parsers import (
124
- requirements_txt_parser ,
125
- pyproject_toml_parser ,
126
- conda_environment_yml_parser ,
127
- )
122
+
123
+ # Parsers (for configs) for now
124
+ from .plugins import _import_tl_plugins
125
+
126
+ _import_tl_plugins (globals ())
128
127
129
128
# this auto-generates decorator functions from Decorator objects
130
129
# in the top-level metaflow namespace
Original file line number Diff line number Diff line change @@ -198,6 +198,7 @@ def resolve_plugins(category, path_only=False):
198
198
list (x .commands )[0 ] if len (x .commands ) == 1 else "too many commands"
199
199
),
200
200
"runner_cli" : lambda x : x .name ,
201
+ "tl_plugin" : None ,
201
202
}
202
203
203
204
Original file line number Diff line number Diff line change 167
167
),
168
168
]
169
169
170
+ TL_PLUGINS_DESC = [
171
+ ("requirements_txt_parser" , ".pypi.parsers.requirements_txt_parser" ),
172
+ ("pyproject_toml_parser" , ".pypi.parsers.pyproject_toml_parser" ),
173
+ ("conda_environment_yml_parser" , ".pypi.parsers.conda_environment_yml_parser" ),
174
+ ]
175
+
170
176
process_plugins (globals ())
171
177
172
178
@@ -207,6 +213,8 @@ def get_runner_cli_path():
207
213
if sys .version_info >= (3 , 7 ):
208
214
DEPLOYER_IMPL_PROVIDERS = resolve_plugins ("deployer_impl_provider" )
209
215
216
+ TL_PLUGINS = resolve_plugins ("tl_plugin" )
217
+
210
218
from .cards .card_modules import MF_EXTERNAL_CARDS
211
219
212
220
# Cards; due to the way cards were designed, it is harder to make them fit
@@ -251,3 +259,9 @@ def get_runner_cli_path():
251
259
TestRefreshComponentCard ,
252
260
]
253
261
merge_lists (CARDS , MF_EXTERNAL_CARDS , "type" )
262
+
263
+
264
+ def _import_tl_plugins (globals_dict ):
265
+
266
+ for name , p in TL_PLUGINS .items ():
267
+ globals_dict [name ] = p
You can’t perform that action at this time.
0 commit comments