From 0279cc06fa04fdb366542257010219d38ff2cc80 Mon Sep 17 00:00:00 2001 From: ZdenekSrotyr Date: Thu, 9 Apr 2026 13:17:59 +0200 Subject: [PATCH] refactor: consolidate deps into pyproject.toml, remove requirements.txt - All dependencies now in pyproject.toml [project.dependencies] - Dev/test deps in [project.optional-dependencies] dev and [tool.uv] - Dockerfile uses uv pip install . from pyproject.toml - CI uses uv pip install ".[dev]" - Deleted requirements.txt and requirements-dev.txt - Updated README, CLAUDE.md install instructions - Enhanced .dockerignore (exclude tests, docs, infra from image) --- .dockerignore | 7 ++++++ .github/workflows/ci.yml | 2 +- .github/workflows/deploy.yml | 2 +- CLAUDE.md | 2 +- Dockerfile | 7 +++--- README.md | 2 +- pyproject.toml | 35 +++++++++++++++++++++--------- requirements-dev.txt | 4 ---- requirements.txt | 42 ------------------------------------ 9 files changed, 39 insertions(+), 64 deletions(-) delete mode 100644 requirements-dev.txt delete mode 100644 requirements.txt diff --git a/.dockerignore b/.dockerignore index 584f9b8..3c1e349 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,5 @@ .git +.github .venv venv __pycache__ @@ -13,5 +14,11 @@ build/ .pytest_cache .mypy_cache .claude/ +.idea node_modules/ +tests/ +docs/ +dev_docs/ +infra/ +server/ docs/ZS_PADAK_* diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efa7998..aa77dad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: uses: astral-sh/setup-uv@v5 - name: Install dependencies - run: uv pip install --system -r requirements-dev.txt + run: uv pip install --system ".[dev]" - name: Run tests run: pytest tests/ -v --tb=short diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7e8daec..071aa11 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -18,7 +18,7 @@ jobs: uses: astral-sh/setup-uv@v5 - name: Install dependencies - run: uv pip install --system -r requirements-dev.txt + run: uv pip install --system ".[dev]" - name: Run tests run: pytest tests/ -v --tb=short diff --git a/CLAUDE.md b/CLAUDE.md index 9bec317..b6497bb 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -123,7 +123,7 @@ Table definitions: DuckDB `table_registry` table in `system.duckdb`. ```bash # Setup python3 -m venv .venv && source .venv/bin/activate -uv pip install -r requirements.txt +uv pip install ".[dev]" # Run FastAPI locally uvicorn app.main:app --reload diff --git a/Dockerfile b/Dockerfile index 36a409c..d5656c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,13 +8,12 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv WORKDIR /app -# Copy dependency files first for layer caching -COPY requirements.txt . -RUN uv pip install --system --no-cache -r requirements.txt - # Copy application code COPY . . +# Install production dependencies from pyproject.toml +RUN uv pip install --system --no-cache . + # Default: run FastAPI server EXPOSE 8000 CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] diff --git a/README.md b/README.md index 19eb864..730f2fb 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ curl -X POST http://localhost:8000/api/sync/trigger python3 -m venv .venv && source .venv/bin/activate # Install dependencies -uv pip install -r requirements.txt +uv pip install ".[dev]" # Run FastAPI locally with hot reload uvicorn app.main:app --reload diff --git a/pyproject.toml b/pyproject.toml index 0e9c266..8efecf3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,10 @@ [project] -name = "data-analyst" +name = "agnes-the-ai-analyst" version = "2.0.0" -description = "AI Data Analyst — data distribution platform for AI analytical systems" -requires-python = ">=3.9" +description = "Agnes — AI Data Analyst platform for AI analytical systems" +requires-python = ">=3.11" license = "MIT" +readme = "README.md" dependencies = [ # Core database @@ -13,6 +14,7 @@ dependencies = [ "uvicorn[standard]>=0.32.0", "python-multipart>=0.0.9", "jinja2>=3.1.0", + "starlette>=0.41.0", # Authentication "PyJWT>=2.8.0", "itsdangerous>=2.1.0", @@ -37,19 +39,32 @@ dependencies = [ # Profiler visualizations "matplotlib>=3.8.0", "numpy>=1.24.0", - # Sample data generation +] + +[project.optional-dependencies] +dev = [ + "pytest>=9.0.0", + "pytest-timeout>=2.0.0", "faker>=24.0.0", + "anthropic>=0.30.0", + "openai>=1.30.0", ] [project.scripts] da = "cli.main:app" -[project.optional-dependencies] -dev = [ - "pytest>=7.0.0", - "pytest-mock>=3.0.0", -] - [build-system] requires = ["hatchling"] build-backend = "hatchling.build" + +[tool.hatch.build.targets.wheel] +packages = ["app", "src", "connectors", "cli", "services", "config"] + +[tool.uv] +dev-dependencies = [ + "pytest>=9.0.0", + "pytest-timeout>=2.0.0", + "faker>=24.0.0", + "anthropic>=0.30.0", + "openai>=1.30.0", +] diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 9298ea9..0000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,4 +0,0 @@ --r requirements.txt -faker>=24.0.0 -anthropic>=0.30.0 -openai>=1.30.0 diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 0c84628..0000000 --- a/requirements.txt +++ /dev/null @@ -1,42 +0,0 @@ -# Core database -duckdb>=0.9.0 - -# Web framework (FastAPI) -fastapi>=0.115.0 -uvicorn[standard]>=0.32.0 -python-multipart>=0.0.9 -jinja2>=3.1.0 - -# Authentication -PyJWT>=2.8.0 -itsdangerous>=2.1.0 -authlib>=1.3.0 -argon2-cffi>=23.1.0 - -# HTTP client -httpx>=0.27.0 - -# CLI -typer>=0.12.0 -rich>=13.0.0 - -# Configuration -python-dotenv>=1.0.0 -pyyaml>=6.0 - -# Data processing -pandas>=2.0.0 -pyarrow>=12.0.0 -pytz>=2024.1 - -# Data source connectors -kbcstorage>=0.9.0 -google-cloud-bigquery>=3.0.0 -google-cloud-bigquery-storage>=2.0.0 - -# Profiler visualizations -matplotlib>=3.8.0 -numpy>=1.24.0 - -# Testing -pytest-timeout>=2.0.0