This is an automated email from the ASF dual-hosted git repository. skrawcz pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/hamilton.git
commit b5c908132f95d3bde0751d4445137654498a3f15 Author: Stefan Krawczyk <[email protected]> AuthorDate: Tue Feb 24 18:39:48 2026 -0800 Address Dev-iL PR review: consolidate dependencies to pyproject.toml Implements items 3, 4, 5, 6 from Dev-iL's PR #1488 review: 3. Transition fully to pyproject.toml (ui/backend): - Removed ui/backend/server/requirements.txt (redundant) - All dependencies already defined in pyproject.toml - Updated sf-hamilton → apache-hamilton for consistency 4. Add [project.scripts] for Django commands (ui/backend): - Added hamilton-ui entry point for cleaner CLI usage - Usage: `uv run hamilton-ui migrate`, `uv run hamilton-ui runserver` - Exposes manage.py main() function as CLI command 5. Use [dependency-groups] for test deps (ui/sdk): - Converted [project.optional-dependencies] → [dependency-groups] - Modern uv-native approach for development dependencies - Usage: `uv sync --group test` 6. Document psycopg requirements (ui/backend/Dockerfile.backend): - Added detailed comment explaining libpq-dev dependencies - Clarified psycopg2-binary vs psycopg v3 requirements - libpq-dev provides forward compatibility and better error messages Benefits: - Single source of truth for dependencies (pyproject.toml only) - Modern dependency group management with uv - Cleaner CLI interface for Django commands - Better documentation of build requirements Addresses review comments from @Dev-iL in PR #1488 --- ui/backend/Dockerfile.backend | 8 ++++++++ ui/backend/pyproject.toml | 7 ++++++- ui/backend/server/requirements.txt | 15 --------------- ui/sdk/pyproject.toml | 28 ++++++++++++++-------------- 4 files changed, 28 insertions(+), 30 deletions(-) diff --git a/ui/backend/Dockerfile.backend b/ui/backend/Dockerfile.backend index a1d6b063..82a33591 100644 --- a/ui/backend/Dockerfile.backend +++ b/ui/backend/Dockerfile.backend @@ -34,6 +34,14 @@ ENV PYTHONDONTWRITEBYTECODE=1 \ WORKDIR /code # Install system dependencies for psycopg2-binary and other compiled packages +# Note: psycopg2-binary includes precompiled PostgreSQL adapter, so libpq-dev +# is technically optional. However, we include it for: +# - Compatibility if switching to psycopg2 (non-binary) in the future +# - Development dependencies that might need PostgreSQL client libraries +# - Better error messages if PostgreSQL connection issues occur +# +# For psycopg v3 (modern replacement), this would still be needed for compilation. +# Current dependencies use psycopg2-binary for Django PostgreSQL support. RUN apt-get update && apt-get install -y \ gcc \ libc-dev \ diff --git a/ui/backend/pyproject.toml b/ui/backend/pyproject.toml index 84852f6b..3b6eefff 100644 --- a/ui/backend/pyproject.toml +++ b/ui/backend/pyproject.toml @@ -56,10 +56,15 @@ dependencies = [ "psycopg2-binary", "pydantic>=2.0.0", "requests>=2.32.0", - "sf-hamilton>=1.58.0", + "apache-hamilton>=1.58.0", "typer", ] +[project.scripts] +# Django management commands for cleaner CLI usage with uv +# Usage: uv run hamilton-ui +hamilton-ui = "hamilton_ui.server.manage:main" + [project.urls] homepage = "https://www.tryhamilton.dev/" documentation = "https://hamilton.apache.org/" diff --git a/ui/backend/server/requirements.txt b/ui/backend/server/requirements.txt deleted file mode 100644 index db6ccf8c..00000000 --- a/ui/backend/server/requirements.txt +++ /dev/null @@ -1,15 +0,0 @@ -aiofiles -aiohttp>=3.13.0 -click -colorlog -ddtrace>=2.21.0 -Django>=4.2.0 -django-extensions -django-ninja>=1.1.0 -loguru -passlib -psycopg2-binary -pydantic>=2.0.0 -requests>=2.32.0 -sf-hamilton>=1.58.0 -typer diff --git a/ui/sdk/pyproject.toml b/ui/sdk/pyproject.toml index b6f40239..8c07ed03 100644 --- a/ui/sdk/pyproject.toml +++ b/ui/sdk/pyproject.toml @@ -55,20 +55,6 @@ dependencies = [ "sqlglot", ] -[project.optional-dependencies] -test = [ - "ibis-framework", - "langchain_core", - "numpy", - "polars", - "pyarrow", - "pyarrow_hotfix", - "pydantic", - "pyspark", - "pytest", - "ray; python_version < '3.14'", -] - [project.urls] homepage = "https://www.tryhamilton.dev/" documentation = "https://hamilton.apache.org/" @@ -100,3 +86,17 @@ exclude = [ ".pytest_cache/**", ".venv/**", ] + +[dependency-groups] +test = [ + "ibis-framework", + "langchain_core", + "numpy", + "polars", + "pyarrow", + "pyarrow_hotfix", + "pydantic", + "pyspark", + "pytest", + "ray; python_version < '3.14'", +]
