lfx-nightly 0.1.11.dev7__py3-none-any.whl → 0.1.12.dev0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lfx/custom/validate.py +45 -19
- {lfx_nightly-0.1.11.dev7.dist-info → lfx_nightly-0.1.12.dev0.dist-info}/METADATA +2 -1
- {lfx_nightly-0.1.11.dev7.dist-info → lfx_nightly-0.1.12.dev0.dist-info}/RECORD +5 -5
- {lfx_nightly-0.1.11.dev7.dist-info → lfx_nightly-0.1.12.dev0.dist-info}/WHEEL +0 -0
- {lfx_nightly-0.1.11.dev7.dist-info → lfx_nightly-0.1.12.dev0.dist-info}/entry_points.txt +0 -0
lfx/custom/validate.py
CHANGED
@@ -298,6 +298,28 @@ def create_type_ignore_class():
|
|
298
298
|
return TypeIgnore
|
299
299
|
|
300
300
|
|
301
|
+
def _import_module_with_warnings(module_name):
|
302
|
+
"""Import module with appropriate warning suppression."""
|
303
|
+
if "langchain" in module_name:
|
304
|
+
with warnings.catch_warnings():
|
305
|
+
warnings.simplefilter("ignore", LangChainDeprecationWarning)
|
306
|
+
return importlib.import_module(module_name)
|
307
|
+
else:
|
308
|
+
return importlib.import_module(module_name)
|
309
|
+
|
310
|
+
|
311
|
+
def _handle_module_attributes(imported_module, node, module_name, exec_globals):
|
312
|
+
"""Handle importing specific attributes from a module."""
|
313
|
+
for alias in node.names:
|
314
|
+
try:
|
315
|
+
# First try getting it as an attribute
|
316
|
+
exec_globals[alias.name] = getattr(imported_module, alias.name)
|
317
|
+
except AttributeError:
|
318
|
+
# If that fails, try importing the full module path
|
319
|
+
full_module_path = f"{module_name}.{alias.name}"
|
320
|
+
exec_globals[alias.name] = importlib.import_module(full_module_path)
|
321
|
+
|
322
|
+
|
301
323
|
def prepare_global_scope(module):
|
302
324
|
"""Prepares the global scope with necessary imports from the provided code module.
|
303
325
|
|
@@ -334,27 +356,31 @@ def prepare_global_scope(module):
|
|
334
356
|
raise ModuleNotFoundError(msg) from e
|
335
357
|
|
336
358
|
for node in import_froms:
|
337
|
-
|
338
|
-
module_name = node.module
|
339
|
-
# Apply warning suppression only when needed
|
340
|
-
if "langchain" in module_name:
|
341
|
-
with warnings.catch_warnings():
|
342
|
-
warnings.simplefilter("ignore", LangChainDeprecationWarning)
|
343
|
-
imported_module = importlib.import_module(module_name)
|
344
|
-
else:
|
345
|
-
imported_module = importlib.import_module(module_name)
|
359
|
+
module_names_to_try = [node.module]
|
346
360
|
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
361
|
+
# If original module starts with langflow, also try lfx equivalent
|
362
|
+
if node.module and node.module.startswith("langflow."):
|
363
|
+
lfx_module_name = node.module.replace("langflow.", "lfx.", 1)
|
364
|
+
module_names_to_try.append(lfx_module_name)
|
365
|
+
|
366
|
+
success = False
|
367
|
+
last_error = None
|
368
|
+
|
369
|
+
for module_name in module_names_to_try:
|
370
|
+
try:
|
371
|
+
imported_module = _import_module_with_warnings(module_name)
|
372
|
+
_handle_module_attributes(imported_module, node, module_name, exec_globals)
|
373
|
+
|
374
|
+
success = True
|
375
|
+
break
|
376
|
+
|
377
|
+
except ModuleNotFoundError as e:
|
378
|
+
last_error = e
|
379
|
+
continue
|
380
|
+
|
381
|
+
if not success:
|
356
382
|
msg = f"Module {node.module} not found. Please install it and try again"
|
357
|
-
raise ModuleNotFoundError(msg) from
|
383
|
+
raise ModuleNotFoundError(msg) from last_error
|
358
384
|
|
359
385
|
if definitions:
|
360
386
|
combined_module = ast.Module(body=definitions, type_ignores=[])
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: lfx-nightly
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.12.dev0
|
4
4
|
Summary: Langflow Executor - A lightweight CLI tool for executing and serving Langflow AI flows
|
5
5
|
Author-email: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
|
6
6
|
Requires-Python: <3.14,>=3.10
|
@@ -16,6 +16,7 @@ Requires-Dist: fastapi>=0.115.13
|
|
16
16
|
Requires-Dist: httpx[http2]>=0.24.0
|
17
17
|
Requires-Dist: json-repair>=0.30.3
|
18
18
|
Requires-Dist: langchain-core>=0.3.66
|
19
|
+
Requires-Dist: loguru>=0.7.3
|
19
20
|
Requires-Dist: nanoid>=2.0.0
|
20
21
|
Requires-Dist: networkx>=3.4.2
|
21
22
|
Requires-Dist: orjson>=3.10.15
|
@@ -536,7 +536,7 @@ lfx/custom/eval.py,sha256=6iekrFA2xHopjorhU06Je5cksgq9KWCHjr_84ehC58c,378
|
|
536
536
|
lfx/custom/schema.py,sha256=WwHe0TnNauyiaC17-bKSyEb8K7KJxBtkB32OSbxiICY,678
|
537
537
|
lfx/custom/tree_visitor.py,sha256=sa4j8VTwksN8ejTE9fnnH1TpD6OnnTtlg2KemiI-eQA,601
|
538
538
|
lfx/custom/utils.py,sha256=eFZcNHvpUhb1Fx6Kbvna2wS0coN3Iub8CW0MvrpstMM,35958
|
539
|
-
lfx/custom/validate.py,sha256=
|
539
|
+
lfx/custom/validate.py,sha256=d5bZTeYK64P2mOMPEJgbvgvtBxZ5P7XFuXCNof3dXPg,17074
|
540
540
|
lfx/custom/code_parser/__init__.py,sha256=qIwZQdEp1z7ldn0z-GY44wmwRaywN3L6VPoPt6lqx1k,62
|
541
541
|
lfx/custom/code_parser/code_parser.py,sha256=QAqsp4QF607319dClK60BsaiwZLV55n0xeGR-DthSoE,14280
|
542
542
|
lfx/custom/custom_component/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -693,7 +693,7 @@ lfx/utils/schemas.py,sha256=NbOtVQBrn4d0BAu-0H_eCTZI2CXkKZlRY37XCSmuJwc,3865
|
|
693
693
|
lfx/utils/util.py,sha256=xGR32XDRr_TtruhjnXfI7lEWmk-vgywHAy3kz5SBowc,15725
|
694
694
|
lfx/utils/util_strings.py,sha256=nU_IcdphNaj6bAPbjeL-c1cInQPfTBit8mp5Y57lwQk,1686
|
695
695
|
lfx/utils/version.py,sha256=cHpbO0OJD2JQAvVaTH_6ibYeFbHJV0QDHs_YXXZ-bT8,671
|
696
|
-
lfx_nightly-0.1.
|
697
|
-
lfx_nightly-0.1.
|
698
|
-
lfx_nightly-0.1.
|
699
|
-
lfx_nightly-0.1.
|
696
|
+
lfx_nightly-0.1.12.dev0.dist-info/METADATA,sha256=2-HWdV_bpI8ChwlifgmnuZ7U8rEfbmdeaszShAytmIw,8000
|
697
|
+
lfx_nightly-0.1.12.dev0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
698
|
+
lfx_nightly-0.1.12.dev0.dist-info/entry_points.txt,sha256=1724p3RHDQRT2CKx_QRzEIa7sFuSVO0Ux70YfXfoMT4,42
|
699
|
+
lfx_nightly-0.1.12.dev0.dist-info/RECORD,,
|
File without changes
|
File without changes
|