Skip to content

Commit 871d4ef

Browse files
committed
Add pre-commit config
1 parent 9ccdfaa commit 871d4ef

File tree

4 files changed

+31
-12
lines changed

4 files changed

+31
-12
lines changed

.pre-commit-config.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.3.0
4+
hooks:
5+
- id: ruff
6+
args: [--fix]
7+
- id: ruff-format
8+
- repo: https://github.com/pre-commit/mirrors-mypy
9+
rev: v1.8.0
10+
hooks:
11+
- id: mypy

agentstack/generation/files.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ConfigFile(BaseModel):
3636
The default model to use when generating agent configurations.
3737
"""
3838

39-
framework: Optional[str] = DEFAULT_FRAMEWORK
39+
framework: str = DEFAULT_FRAMEWORK
4040
tools: list[str] = []
4141
telemetry_opt_out: Optional[bool] = None
4242
default_model: Optional[str] = None

agentstack/utils.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
from typing import Optional
2-
3-
import os
4-
import sys
1+
from typing import Optional, Union
2+
from importlib.abc import Traversable
3+
import os, sys
54
import json
65
import re
76
from importlib.metadata import version
@@ -31,7 +30,7 @@ def verify_agentstack_project(path: Optional[str] = None):
3130
sys.exit(1)
3231

3332

34-
def get_package_path() -> Path:
33+
def get_package_path() -> Union[Path, Traversable]:
3534
"""This is the Path where agentstack is installed."""
3635
if sys.version_info <= (3, 9):
3736
return Path(sys.modules['agentstack'].__path__[0])
@@ -56,7 +55,7 @@ def get_framework(path: Optional[str] = None) -> str:
5655
sys.exit(1)
5756

5857

59-
def get_telemetry_opt_out(path: Optional[str] = None) -> str:
58+
def get_telemetry_opt_out(path: Optional[str] = None) -> bool:
6059
from agentstack.generation import ConfigFile
6160

6261
try:

pyproject.toml

+14-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ readme = "README.md"
1414
requires-python = ">=3.10"
1515

1616
dependencies = [
17-
"agentops>=0.3.18",
17+
"agentops>=0.3.19",
1818
"typer>=0.12.5",
1919
"inquirer>=3.4.0",
2020
"art>=6.3",
@@ -24,17 +24,19 @@ dependencies = [
2424
"psutil==5.9.8",
2525
"astor==0.8.1",
2626
"pydantic>=2.10",
27-
"packaging>=23.2",
27+
"packaging==23.2",
2828
"requests>=2.32",
2929
"appdirs>=1.4.4"
3030
]
3131

3232
[project.optional-dependencies]
3333
dev = [
34-
"ruff",
34+
"mypy>=1.13.0",
35+
"pre-commit>=4.0.1",
36+
"ruff>=0.8.2",
3537
]
3638
test = [
37-
"tox>=4.23.2",
39+
"tox",
3840
]
3941
crewai = [
4042
"crewai==0.83.0",
@@ -66,4 +68,11 @@ exclude = [
6668
]
6769

6870
[tool.ruff.format]
69-
quote-style = "preserve"
71+
quote-style = "preserve"
72+
73+
[tool.mypy]
74+
exclude = [
75+
"templates/.*" # cookiecutter paths are not compatible
76+
]
77+
ignore_missing_imports = true
78+

0 commit comments

Comments
 (0)