mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
Fix lint and type-checker issues
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import os
|
|
||||||
import importlib.util
|
import importlib.util
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import click
|
import click
|
||||||
@@ -14,14 +14,17 @@ def plot_flow() -> None:
|
|||||||
try:
|
try:
|
||||||
if os.path.exists(main_file_path):
|
if os.path.exists(main_file_path):
|
||||||
spec = importlib.util.spec_from_file_location("main", main_file_path)
|
spec = importlib.util.spec_from_file_location("main", main_file_path)
|
||||||
main = importlib.util.module_from_spec(spec)
|
if spec is not None and spec.loader is not None:
|
||||||
sys.modules["main"] = main
|
main = importlib.util.module_from_spec(spec)
|
||||||
spec.loader.exec_module(main)
|
sys.modules["main"] = main
|
||||||
|
spec.loader.exec_module(main)
|
||||||
if hasattr(main, "plot"):
|
|
||||||
main.plot()
|
if hasattr(main, "plot"):
|
||||||
|
main.plot()
|
||||||
|
else:
|
||||||
|
click.echo("Error: No plot function found in main.py", err=True)
|
||||||
else:
|
else:
|
||||||
click.echo("Error: No plot function found in main.py", err=True)
|
click.echo("Error: Could not load main.py module", err=True)
|
||||||
else:
|
else:
|
||||||
click.echo("Error: Could not find main.py in the current directory", err=True)
|
click.echo("Error: Could not find main.py in the current directory", err=True)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from crewai.crew import Crew
|
|
||||||
from crewai.agent import Agent
|
from crewai.agent import Agent
|
||||||
|
from crewai.crew import Crew
|
||||||
|
|
||||||
|
|
||||||
def test_crew_plot_method_not_implemented():
|
def test_crew_plot_method_not_implemented():
|
||||||
|
|||||||
Reference in New Issue
Block a user