mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
Fix type checking + lint
This commit is contained in:
@@ -39,7 +39,7 @@ def parse_toml(content):
|
|||||||
return simple_toml_parser(content)
|
return simple_toml_parser(content)
|
||||||
|
|
||||||
|
|
||||||
def get_git_remote_url() -> str:
|
def get_git_remote_url() -> str | None:
|
||||||
"""Get the Git repository's remote URL."""
|
"""Get the Git repository's remote URL."""
|
||||||
try:
|
try:
|
||||||
# Run the git remote -v command
|
# Run the git remote -v command
|
||||||
@@ -63,6 +63,8 @@ def get_git_remote_url() -> str:
|
|||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
console.print("Git command not found. Make sure Git is installed and in your PATH.", style="bold red")
|
console.print("Git command not found. Make sure Git is installed and in your PATH.", style="bold red")
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
def get_project_name(pyproject_path: str = "pyproject.toml"):
|
def get_project_name(pyproject_path: str = "pyproject.toml"):
|
||||||
"""Get the project name from the pyproject.toml file."""
|
"""Get the project name from the pyproject.toml file."""
|
||||||
@@ -83,7 +85,7 @@ def get_project_name(pyproject_path: str = "pyproject.toml"):
|
|||||||
print(f"Error: {pyproject_path} not found.")
|
print(f"Error: {pyproject_path} not found.")
|
||||||
except KeyError:
|
except KeyError:
|
||||||
print(f"Error: {pyproject_path} is not a valid pyproject.toml file.")
|
print(f"Error: {pyproject_path} is not a valid pyproject.toml file.")
|
||||||
except tomllib.TOMLDecodeError if sys.version_info >= (3, 11) else Exception as e:
|
except tomllib.TOMLDecodeError if sys.version_info >= (3, 11) else Exception as e: # type: ignore
|
||||||
print(
|
print(
|
||||||
f"Error: {pyproject_path} is not a valid TOML file."
|
f"Error: {pyproject_path} is not a valid TOML file."
|
||||||
if sys.version_info >= (3, 11)
|
if sys.version_info >= (3, 11)
|
||||||
|
|||||||
Reference in New Issue
Block a user