Spaces:
Running
Running
Install requirements.txt before running scripts.
Browse files
lynxkite-core/src/lynxkite/core/ops.py
CHANGED
@@ -344,17 +344,17 @@ def load_user_scripts(workspace: str):
|
|
344 |
assert path.is_relative_to(cwd), "Provided workspace path is invalid"
|
345 |
for p in path.parents:
|
346 |
print("checking user scripts in", p)
|
347 |
-
for f in p.glob("*.py"):
|
348 |
-
try:
|
349 |
-
run_user_script(f)
|
350 |
-
except Exception:
|
351 |
-
traceback.print_exc()
|
352 |
req = p / "requirements.txt"
|
353 |
if req.exists():
|
354 |
try:
|
355 |
install_requirements(req)
|
356 |
except Exception:
|
357 |
traceback.print_exc()
|
|
|
|
|
|
|
|
|
|
|
358 |
if p == cwd:
|
359 |
break
|
360 |
|
|
|
344 |
assert path.is_relative_to(cwd), "Provided workspace path is invalid"
|
345 |
for p in path.parents:
|
346 |
print("checking user scripts in", p)
|
|
|
|
|
|
|
|
|
|
|
347 |
req = p / "requirements.txt"
|
348 |
if req.exists():
|
349 |
try:
|
350 |
install_requirements(req)
|
351 |
except Exception:
|
352 |
traceback.print_exc()
|
353 |
+
for f in p.glob("*.py"):
|
354 |
+
try:
|
355 |
+
run_user_script(f)
|
356 |
+
except Exception:
|
357 |
+
traceback.print_exc()
|
358 |
if p == cwd:
|
359 |
break
|
360 |
|