Skip to content

chore(hg-llm): use uv instead poetry#226

Merged
imbajin merged 18 commits intoapache:mainfrom
cgwer:main
May 22, 2025
Merged

chore(hg-llm): use uv instead poetry#226
imbajin merged 18 commits intoapache:mainfrom
cgwer:main

Conversation

@cgwer
Copy link
Copy Markdown
Contributor

@cgwer cgwer commented May 11, 2025

1 Description

This PR migrates the dependency management in the hugegraph-llm project from Poetry to uv. uv is a high-performance Python package manager written in Rust that provides 10-100x performance improvement over Poetry.

2 Key Changes

  • Dependency Management: Removed [tool.poetry.dependencies] section and replaced it with the standard [project.dependencies] format in pyproject.toml.
  • Package Index Configuration: Added [tool.uv] section to configure PyPI sources, including multiple mirror repositories in pyproject.toml.
  • Removed Files: Deleted the poetry.lock lockfile and setup.py (as it's no longer needed with uv configuration).

3 Detailed Setup Instructions

To set up the development environment with uv:

  1. Install the uv tool:

    curl -LsSf https://astral.sh/uv/install.sh | sh
  2. Create a virtual environment in the incubator-hugegraph-ai/hugegraph-llm directory:

    cd incubator-hugegraph-ai/hugegraph-llm
    uv venv   # The name .venv can be customized
  3. Activate the virtual environment (if the activation script isn't executable, add execute permission):

    source .venv/bin/activate
  4. Install dependencies in development mode:

    uv pip install -e .

This change does not affect project functionality and only optimizes the dependency management and build process.

More information about Hatch build can be referred to Hatch

More information about uv can be referred to uv

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label May 11, 2025
@github-actions github-actions Bot added the llm label May 11, 2025
@dosubot dosubot Bot added the dependencies Pull requests that update a dependency file label May 11, 2025
Comment on lines +66 to +70
[project.urls]
Homepage = "https://hugegraph.apache.org/"
Repository = "https://github.com/apache/incubator-hugegraph-ai"
Documentation = "https://hugegraph.apache.org/docs/quickstart/hugegraph-ai/"
"Bug Tracker" = "https://github.com/apache/incubator-hugegraph-ai/issues"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

seems duplicate with L33~36?

Comment thread .gitignore Outdated
*.out
*.zip
*.tar.gz
hugegraph-llm/pyproject.toml
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why ignore it it git?

Comment on lines +74 to +75
requires = ["hatchling"]
build-backend = "hatchling.build"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

any context for it?

@cgwer cgwer changed the title uv(llm) chore(hg-llm): use uv instead poetry May 12, 2025
@cgwer cgwer requested a review from imbajin May 12, 2025 10:24
@imbajin imbajin linked an issue May 17, 2025 that may be closed by this pull request
Comment thread hugegraph-llm/README.md Outdated
Comment on lines +46 to +47
uv venv llm1
source llm1/bin/activate
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
uv venv llm1
source llm1/bin/activate
uv venv && source .venv/bin/activate

Comment thread hugegraph-llm/README.md Outdated
6. Start the gradio interactive demo of **Graph RAG**, you can run with the following command and open http://127.0.0.1:8001 after starting
```bash
python -m hugegraph_llm.demo.rag_demo.app # same as "poetry run xxx"
python3 src/hugegraph_llm/demo/rag_demo/app.py # same as "poetry run xxx"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why we need change here?

include = [
"src/hugegraph_llm",
"README.md",
"LICENSE",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LICENSE & NOTICE?

Copy link
Copy Markdown
Member

@imbajin imbajin left a comment

Choose a reason for hiding this comment

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

THX, next step is python-client & the whole project

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 22, 2025
@imbajin imbajin merged commit 122b124 into apache:main May 22, 2025
10 checks passed
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 lgtm This PR has been approved by a maintainer llm size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants