diff --git a/pyproject.toml b/pyproject.toml index 636b69f..11d2842 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,10 +5,23 @@ build-backend = "hatchling.build" [project] name = "docai" version = "0.0.0" -dynamic = ["dependencies"] +requires-python = ">=3.12,<3.14" +dependencies = [ + "rich>=14.2", + "typer>=0.20.0", + "langchain>=1.1", + "langchain-openai>=1.1", + "xdg-base-dirs>=6.0.2", + "in_place>=1.0.1", + "tree-sitter>=0.25.2", + "tree-sitter-python>=0.25.0", + "tree-sitter-c>=0.24.1", + "tree-sitter-cpp>=0.23.4", +] +dynamic = [] -[tool.hatch.dependencies] -path = "requirements.txt" +[project.scripts] +docai = "docai.cli:app" [tool.hatch.build.targets.wheel] packages = ["src/docai"] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 9bee7bf..0000000 --- a/requirements.txt +++ /dev/null @@ -1,10 +0,0 @@ -rich>=14.2 -typer>=0.20.0 -langchain>=1.1 -langchain-openai>=1.1 -xdg-base-dirs>=6.0.2 -in_place>=1.0.1 -tree-sitter>=0.25.2 -tree-sitter-python>=0.25.0 -tree-sitter-c>=0.24.1 -tree-sitter-cpp>=0.23.4 diff --git a/src/docai/__main__.py b/src/docai/__main__.py index b473375..c82d98f 100644 --- a/src/docai/__main__.py +++ b/src/docai/__main__.py @@ -1,11 +1,8 @@ import sys from pathlib import Path - # Add 'src/' to sys.path manually sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) -from docai.main import main -import typer - -typer.run(main) +from docai.cli import app +app() diff --git a/src/docai/main.py b/src/docai/cli.py similarity index 96% rename from src/docai/main.py rename to src/docai/cli.py index 5878cfc..42f24bb 100644 --- a/src/docai/main.py +++ b/src/docai/cli.py @@ -18,7 +18,9 @@ CONFIG_PATHS = [ Path().absolute() / "config.toml", ] +app = typer.Typer(help="DocAI - Generative Documentation") +@app.command() def main( files: list[Path], config: Path | None = typer.Option(None), @@ -79,4 +81,4 @@ def main( if __name__ == "__main__": - typer.run(main) + app()