[project]
name = "aiservice"
version = "0.0.1"
description = ""
authors = [{ name = "CodeFlash Inc.", email = "contact@codeflash.ai" }]
requires-python = ">=3.12.1,<4"
readme = "README.md"
classifiers = ["Private :: Do Not Upload"]
dependencies = [
    "django>=5.0.6,<6",
    "django-ninja>=1.3.0,<2",
    "pydantic>=2.9.0",
    "python-dotenv>=1.0.1,<2",
    "dj-database-url>=2.2.0,<3",
    "psycopg[binary,pool]>=3.1.8,<4",
    "gunicorn>=22.0.0,<23",
    "uvicorn>=0.32.0,<0.33",
    "libcst>=1.5.0,<2",
    "posthog>=3.5.0,<4",
    "gitpython>=3.1.43,<4",
    "ruff>=0.7.0",
    "openai[aiohttp]>=1.52.2,<2",
    "isort>=7.0.0",
    "sentry-sdk[django]>=2.35.0",
    "stamina>=25.1.0",
    "jedi>=0.19.2",
    "anthropic[bedrock]>=0.75.0",
    "wcwidth>=0.2.15",
    "tree-sitter>=0.25.2",
    "tree-sitter-javascript>=0.25.0",
    "tree-sitter-typescript>=0.23.2",
    "tree-sitter-java>=0.23.5",
    "jinja2>=3.1.0",
]

[project.urls]
Homepage = "https://codeflash.ai"

[dependency-groups]
dev = [
    "ipython>=8.12.0,<9",
    "mypy>=1.13",
    "types-Pygments>=2.18",
    "types-colorama>=0.4.15",
    "types-setuptools>=75.2",
    "types-gevent>=24.11.0.20241230,<25",
    "types-pexpect>=4.9.0.20241208,<5",
    "pytest-asyncio>=1.1.0",
    "pytest>=8.4.2",
    "pytest-django>=4.11.1",
    "ty>=0.0.8",
    "prek>=0.2.25",
    "coverage>=7.13.1",
]

[tool.hatch.build.targets.sdist]
exclude = [
    "experiments/*",
    "tests/*",
    "docs/*",
    "scripts/*",
    "*.pyc",
    "*.pyo",
    "*.pyd",
    "__pycache__",
    "*.so",
    "*.dylib",
    "*.dll",
    "*.exe",
    "*.log",
    "*.tmp",
    ".env",
    ".env.*",
    "*.pem",
    "*.key",
    "secrets.*",
    "config.yaml",
    "config.json",
    ".git",
    ".gitignore",
    ".gitattributes",
    ".github",
    "Dockerfile",
    "docker-compose.yml",
    "*.md",
    "*.txt",
    "*.csv",
    "*.db",
    "*.sqlite3",
    "*.pdf",
    "*.docx",
    "*.xlsx",
    "*.pptx",
    "*.iml",
    ".idea",
    ".vscode",
    ".DS_Store",
    "Thumbs.db",
    "venv",
    "env",
]

[tool.hatch.build.targets.wheel]
exclude = [
    "experiments/*",
    "tests/*",
    "docs/*",
    "scripts/*",
    "*.pyc",
    "*.pyo",
    "*.pyd",
    "__pycache__",
    "*.so",
    "*.dylib",
    "*.dll",
    "*.exe",
    "*.log",
    "*.tmp",
    ".env",
    ".env.*",
    "*.pem",
    "*.key",
    "secrets.*",
    "config.yaml",
    "config.json",
    ".git",
    ".gitignore",
    ".gitattributes",
    ".github",
    "Dockerfile",
    "docker-compose.yml",
    "*.md",
    "*.txt",
    "*.csv",
    "*.db",
    "*.sqlite3",
    "*.pdf",
    "*.docx",
    "*.xlsx",
    "*.pptx",
    "*.iml",
    ".idea",
    ".vscode",
    ".DS_Store",
    "Thumbs.db",
    "venv",
    "env",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.mypy]
show_error_code_links = true
pretty = true
show_absolute_path = true
show_error_context = true
show_error_end = true
strict = true
warn_unreachable = true
install_types = true
plugins = ["pydantic.mypy"]
warn_unused_ignores = false

[[tool.mypy.overrides]]
module = ["jedi", "jedi.api.classes", "inquirer", "inquirer.themes"]
ignore_missing_imports = true

[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true

[tool.ruff.lint]
select = ["ALL"]
ignore = [
    "C901",
    "D100",
    "D101",
    "D102",
    "D103",
    "D104",
    "D105",
    "D107",
    "D203",  # incompatible with D211
    "D213",  # incompatible with D212
    "S101",
    "S603",
    "S607",
    "COM812",
    "FIX002",
    "PLR0912",
    "PLR0913",
    "PLR0915",
    "TD002",
    "TD003",
    "TD004",
    "N802",
    "PLR2004", # magic value (replace with variable warning)
    "TRY003",
    "N801",
    "EM101", # Exception must not use a string literal, assign to variable first"
    "TRY301", #  Abstract `raise` to an inner function
    "LOG015",
    "T201",
    "E501",
    "ERA001",
]

[tool.ruff.lint.flake8-type-checking]
strict = true
runtime-evaluated-base-classes = ["pydantic.BaseModel", "ninja.Schema", "typing.TypedDict"]
runtime-evaluated-decorators = [
    "pydantic.validate_call",
    "pydantic.dataclasses.dataclass",
    "ninja.NinjaAPI.get",
    "ninja.NinjaAPI.post",
    "ninja.NinjaAPI.put",
    "ninja.NinjaAPI.patch",
    "ninja.NinjaAPI.delete",
]
# Keep LLM as runtime import - used in function signatures that may be introspected
exempt-modules = ["typing", "aiservice.llm"]

[tool.ruff.lint.pep8-naming]
classmethod-decorators = [
    # Allow Pydantic's `@validator` decorator to trigger class method treatment.
    "pydantic.validator",
]

[tool.ruff.lint.isort]
split-on-trailing-comma = false

[tool.ruff]
line-length = 120
fix = true
show-fixes = true
exclude = ["core/languages/python/testgen/tests", "core/languages/python/testgen/sqlalchemy"]

[tool.ruff.format]
docstring-code-format = true
skip-magic-trailing-comma = true

[tool.ty.rules]
no-matching-overload = "ignore"

[tool.ty.src]
exclude = ["tests/"]

[tool.codeflash]
module-root = "."
tests-root = "tests"
test-framework = "pytest"
ignore-paths = []
