mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 15:48:29 +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 os
|
||||
import sys
|
||||
|
||||
import click
|
||||
@@ -14,14 +14,17 @@ def plot_flow() -> None:
|
||||
try:
|
||||
if os.path.exists(main_file_path):
|
||||
spec = importlib.util.spec_from_file_location("main", main_file_path)
|
||||
main = importlib.util.module_from_spec(spec)
|
||||
sys.modules["main"] = main
|
||||
spec.loader.exec_module(main)
|
||||
|
||||
if hasattr(main, "plot"):
|
||||
main.plot()
|
||||
if spec is not None and spec.loader is not None:
|
||||
main = importlib.util.module_from_spec(spec)
|
||||
sys.modules["main"] = main
|
||||
spec.loader.exec_module(main)
|
||||
|
||||
if hasattr(main, "plot"):
|
||||
main.plot()
|
||||
else:
|
||||
click.echo("Error: No plot function found in main.py", err=True)
|
||||
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:
|
||||
click.echo("Error: Could not find main.py in the current directory", err=True)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
|
||||
from crewai.crew import Crew
|
||||
from crewai.agent import Agent
|
||||
from crewai.crew import Crew
|
||||
|
||||
|
||||
def test_crew_plot_method_not_implemented():
|
||||
|
||||
Reference in New Issue
Block a user