[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "engrams-mcp"
version = "1.1.0"
authors = [
    {name = "Scott McLeod", email = "contextportal@gmail.com"},
    {name = "Steve Brownlee", email = "steve@stevebrownlee.com"},
]
description = "A governance-aware, context-intelligent development platform built on MCP"
readme = "README.md"
license = {text = "Apache-2.0"}
requires-python = ">=3.10"
keywords = ["mcp", "context", "engrams", "knowledge-graph", "rag"]
classifiers = [
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "License :: OSI Approved :: Apache Software License",
    "Operating System :: OS Independent",
    "Development Status :: 4 - Beta",
    "Intended Audience :: Developers",
    "Topic :: Software Development :: Libraries :: Python Modules",
]

# Core dependencies updated for FastMCP
dependencies = [
    "fastapi>=0.120.0",
    "uvicorn[standard]>=0.38.0",
    "pydantic>=2.12.5",
    "fastmcp>=2.13.3",
    "mcp>=1.23.0",
    "sentence-transformers>=3.3.1",
    "chromadb>=1.3.5",
    "alembic>=1.17.2",
    "sqlalchemy>=2.0.0",
    "authlib>=1.6.5",
    "urllib3>=2.6.0",
    "filelock>=3.16.2",
]

[project.optional-dependencies]
dashboard = [
    "flask>=3.0",
    "httpx>=0.27",
]
dev = [
    "pytest>=7.0.0",
    "pytest-asyncio",
    "black",
    "isort",
    "flake8",
    "autoflake",
    "mypy",
]
test = [
    "pytest>=7.0.0",
    "pytest-asyncio",
    "pytest-cov",
]

[project.urls]
"Homepage" = "https://engrams.sh"
"Bug Reports" = "https://github.com/stevebrownlee/engrams/issues"
"Source" = "https://github.com/stevebrownlee/engrams"
"Documentation" = "https://engrams.sh/docs"

[project.scripts]
engrams = "engrams.cli:main"
engrams-mcp = "engrams.main:cli_entry_point"
engrams-init = "engrams.init_command:cli_entry_point"
# Backward-compatibility alias — prefer `engrams dashboard` instead
engrams-dashboard = "engrams.dashboard.app:main"

# Fixed package discovery for src layout
[tool.setuptools.packages.find]
where = ["src"]
include = ["engrams*"]

[tool.setuptools.package-data]
"engrams" = [
    "templates/**/*",
    "dashboard/static/**/*",
    "*.json",
    "*.yaml",
    "*.yml"
]

[tool.setuptools]
include-package-data = true

# Force mcp version to resolve conflict with fastmcp
[tool.uv]
override-dependencies = [
  "mcp>=1.23.0"
]
required-environments = [
  "sys_platform == 'darwin' and platform_machine == 'x86_64'"
]

# Black configuration
[tool.black]
line-length = 88
target-version = ['py310', 'py311', 'py312', 'py313']
include = '\.pyi?$'
extend-exclude = '''
/(
  # directories
  \.eggs
  | \.git
  | \.hg
  | \.mypy_cache
  | \.tox
  | \.venv
  | build
  | dist
)/
'''

# isort configuration
[tool.isort]
profile = "black"
multi_line_output = 3
line_length = 88
known_first_party = ["engrams"]

# pytest configuration
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = "-v --tb=short"
asyncio_mode = "auto"

# mypy configuration
[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true

[[tool.mypy.overrides]]
module = [
    "chromadb.*",
    "sentence_transformers.*",
    "fastmcp.*",
]
ignore_missing_imports = true
