Skip to content

chore: unify all modules with uv#287

Merged
imbajin merged 76 commits intoapache:mainfrom
hugegraph:feat/centralize-uv-management
Jul 21, 2025
Merged

chore: unify all modules with uv#287
imbajin merged 76 commits intoapache:mainfrom
hugegraph:feat/centralize-uv-management

Conversation

@imbajin
Copy link
Member

@imbajin imbajin commented Jul 18, 2025

Walkthrough

本次更新主要集中在项目的依赖管理、构建配置、文档和开发流程规范化。核心变更包括引入统一的根级 pyproject.tomluv 工具进行依赖管理,移除各子模块依赖中的版本约束,标准化构建系统为 hatchling,并对各 README 文档和 CI 工作流进行了重构和简化。

Changes

文件/路径分组 变更摘要
.gitignore 新增 uv.lock 忽略项及相关注释,新增 .pre-commit-config.yaml 忽略。
README.md, hugegraph-llm/README.md, vermeer-python-client/README.md 重写与重构文档,聚焦模块简介、开发环境搭建流程,移除详细用例与旧示例,更新示例代码和客户端初始化参数。
pyproject.toml 新增根级构建与依赖配置,定义 workspace、可选依赖组、构建系统等。
hugegraph-llm/pyproject.toml, hugegraph-ml/pyproject.toml, hugegraph-python-client/pyproject.toml, vermeer-python-client/pyproject.toml 统一构建系统为 hatchling,移除依赖版本约束,调整元数据与依赖分组,修改本地包引用方式。
.github/workflows/hugegraph-python-client.yml, .github/workflows/pylint.yml CI 流程改为使用 uv syncuv run 统一环境与命令执行,简化步骤,移除手动虚拟环境激活。
docker/.dockerignore 新增 .dockerignore 文件,定义构建时忽略的文件和目录列表。
docker/Dockerfile.llm 优化 Dockerfile,统一复制源代码,调整虚拟环境路径,使用 uv sync --extra ai 安装依赖,更新环境变量。
docker/Dockerfile.nk 替换 Poetry 为 uv 工具管理环境,统一复制源代码,调整依赖安装流程,保留 Nuitka 编译步骤。

Sequence Diagram(s)

sequenceDiagram
    participant 开发者
    participant 代码仓库
    participant CI
    participant uv工具
    participant hatchling

    开发者->>代码仓库: 提交/拉取代码
    CI->>uv工具: uv sync --extra [模块] --extra dev
    uv工具->>CI: 安装依赖并管理虚拟环境
    CI->>uv工具: uv run pytest / uv run python 脚本
    uv工具->>CI: 在隔离环境中执行命令
    CI->>hatchling: 构建 wheel/sdist
    hatchling->>CI: 生成构建产物
Loading

yanchaomei and others added 30 commits March 5, 2025 17:29
This workflow will be triggered when a pull request is opened. It will then post a comment "@codecov-ai-reviewer review" to help with automated AI code reviews.

It will use the `peter-evans/create-or-update-comment` action to create the comment.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Refactors package management to use a root `pyproject.toml` with uv.
This provides a unified way to manage dependencies for all submodules
(hugegraph-llm, hugegraph-ml, hugegraph-python-client, vermeer-python-client).

Key changes:
- Introduced a root `pyproject.toml` defining a uv workspace and optional
  dependencies (extras) for each submodule (e.g., `.[llm]`, `.[ml]`).
- `hugegraph-llm` and `hugegraph-ml` now use the root `pyproject.toml` for
  uv index configuration.
- `vermeer-python-client` transitioned from `setup.py/requirements.txt` to
  a `pyproject.toml` file, consistent with other submodules.
- Updated the root `README.md` with instructions for the new uv-based
  development setup, including how to install all or specific submodule
  dependencies.

This change aims to improve your developer experience by simplifying
environment setup and dependency management.

Note: I attempted to directly test dependency resolution using `uv pip compile` but could not complete it due to limitations in the execution environment. The configuration is based on uv best practices and my manual verification of the generated files.
Co-authored-by: codecov-ai[bot] <156709835+codecov-ai[bot]@users.noreply.github.com>
Merge pull request #22 from returnToInnocence/pr20
returnToInnocence and others added 8 commits July 19, 2025 22:28
docs(hg-llm): merge readme & revert test
- Move version constraints to root constraint-dependencies
- Simplify optional-dependencies structure
- Configure hugegraph-ml and vermeer-python-client as optional local dependencies via [tool.uv.sources]
- Remove ml/vermeer from workspace members while keeping them available via --extra
- Inline common dependencies directly into each submodule for clarity
- Remove complex dependency grouping in favor of direct package references
- Update test_config.py to use centralized UV runner
- Update test_ollama_client.py to use centralized UV runner
- Update test_nltk_helper.py to use centralized UV runner
- Update test_info_extract.py to use centralized UV runner
- Improve test infrastructure consistency and maintainability
- Unified Python version requirement to >=3.10 for all subprojects
- Simplified dependency declarations by removing version constraints
  (let root constraint-dependencies manage versions uniformly)
- Standardized project.urls format to use lowercase keys consistently
- Cleaned up comments and removed duplicate maintainers fields

This improves configuration consistency and simplifies dependency management.
@imbajin imbajin force-pushed the feat/centralize-uv-management branch from 5e692f3 to de37d40 Compare July 20, 2025 03:59
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Jul 20, 2025
imbajin and others added 6 commits July 20, 2025 22:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…hugegraph-ai into feat/centralize-uv-management
Replaced inconsistent 'Bug Tracker' and 'bug tracker' keys with 'bug_tracker' in all pyproject.toml files. Updated dependency groups in the root pyproject.toml to use explicit package names instead of extras, added a changelog URL, and adjusted build targets and comments for clarity and future improvements.
Added TODO notes to Black and Pylint workflows for future replacement with ruff & mypy. Simplified PYTHONPATH export in hugegraph-python-client workflow. Removed virtual environment troubleshooting note from README. Excluded MANIFEST.in from pyproject.toml package includes. Deleted requirements.txt from hugegraph-llm as package management is now handled by uv.
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Jul 21, 2025
Standardized installation and environment setup instructions across all module README files to use `uv sync` for dependency management and virtual environment creation. Added notes about workspace membership, clarified activation steps, and improved example usage consistency. Enhanced documentation for development, contributing, and related projects.
@imbajin imbajin force-pushed the feat/centralize-uv-management branch from a88d828 to c834809 Compare July 21, 2025 06:57
@imbajin imbajin requested a review from Copilot July 21, 2025 09:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR unifies dependency management across all modules using uv as the package manager and introduces a workspace-based architecture. The changes standardize the build system to use hatchling, remove version constraints from individual modules (delegating them to root-level constraints), and update documentation and CI workflows to use uv commands.

Key changes include:

  • Introduction of root-level pyproject.toml with workspace configuration and centralized dependency constraints
  • Migration from setuptools to hatchling build backend across all modules
  • Removal of version pins from individual module dependencies, relying on root-level constraints
  • Updated CI workflows to use uv sync and uv run commands

Reviewed Changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
pyproject.toml New root-level workspace configuration with centralized dependency constraints
vermeer-python-client/pyproject.toml Migrated to hatchling, removed version constraints, updated build configuration
hugegraph-python-client/pyproject.toml Migrated to hatchling, removed version constraints, simplified dependencies
hugegraph-ml/pyproject.toml Updated dependencies without version constraints, adjusted Python requirement
hugegraph-llm/pyproject.toml Removed version constraints, cleaned up dependencies structure
docker/Dockerfile.llm Updated to use uv instead of manual pip installations
docker/Dockerfile.nk Replaced poetry with uv for dependency management
.github/workflows/*.yml Updated CI to use uv sync and uv run commands
Comments suppressed due to low confidence (2)

hugegraph-ml/pyproject.toml:39

  • The dependency name has changed from 'category_encoders' to 'category-encoders' (with hyphen). This inconsistency could cause import issues. Should be 'category-encoders' to match the original.
    "category-encoders",

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@imbajin imbajin merged commit 6fbf164 into apache:main Jul 21, 2025
10 checks passed
@imbajin imbajin deleted the feat/centralize-uv-management branch July 28, 2025 06:57
@imbajin imbajin mentioned this pull request Aug 6, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file llm ml python-client size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants