You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hugegraph.apache.org by ji...@apache.org on 2026/09/24 08:49:45 UTC

(hugegraph-ai) branch cx-python-release created (now c270bb03)

This is an automated email from the ASF dual-hosted git repository.

imbajin pushed a change to branch cx-python-release
in repository https://gitbox.apache.org/repos/asf/hugegraph-ai.git


      at c270bb03 fix: rename client distribution to hugegraph-python

This branch includes the following new commits:

     new c270bb03 fix: rename client distribution to hugegraph-python

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(hugegraph-ai) 01/01: fix: rename client distribution to hugegraph-python

Posted by ji...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

imbajin pushed a commit to branch cx-python-release
in repository https://gitbox.apache.org/repos/asf/hugegraph-ai.git

commit c270bb03c499253d74254c4f9232fa0cb61ed685
Author: imbajin <ji...@apache.org>
AuthorDate: Thu Sep 24 16:48:16 2026 +0800

    fix: rename client distribution to hugegraph-python
    
    - rename the distribution while preserving pyhugegraph imports
    - align workspace and downstream dependency source keys
    - clarify installation docs and client install guidance
    - assert installed distribution contracts in existing CI tests
---
 README.md                                          |  2 +-
 hugegraph-llm/pyproject.toml                       |  4 +--
 hugegraph-ml/pyproject.toml                        |  4 +--
 hugegraph-python-client/README.md                  | 11 ++++----
 hugegraph-python-client/pyproject.toml             |  2 +-
 .../src/pyhugegraph/example/hugegraph_test.py      |  2 +-
 .../src/tests/test_distribution.py                 | 29 ++++++++++++++++++++++
 pyproject.toml                                     |  8 +++---
 8 files changed, 45 insertions(+), 17 deletions(-)

diff --git a/README.md b/README.md
index c348af1a..01864245 100644
--- a/README.md
+++ b/README.md
@@ -112,7 +112,7 @@ Graph machine learning with 20+ implemented algorithms:
 
 ### [hugegraph-python-client](./hugegraph-python-client)
 
-Python client for HugeGraph operations:
+Python client for HugeGraph operations, distributed as `hugegraph-python` (`uv pip install hugegraph-python`) and imported as `pyhugegraph`:
 
 - **Schema Management**: Define vertex/edge labels and properties
 - **CRUD Operations**: Create, read, update, delete graph data
diff --git a/hugegraph-llm/pyproject.toml b/hugegraph-llm/pyproject.toml
index e351f325..65e6a935 100644
--- a/hugegraph-llm/pyproject.toml
+++ b/hugegraph-llm/pyproject.toml
@@ -62,7 +62,7 @@ dependencies = [
     "pydantic-settings",
     "apscheduler",
     "litellm",
-    "hugegraph-python-client",
+    "hugegraph-python",
     "pycgraph==3.2.2",
 ]
 
@@ -97,7 +97,7 @@ include = [
 allow-direct-references = true
 
 [tool.uv.sources]
-hugegraph-python-client = { workspace = true }
+hugegraph-python = { workspace = true }
 pycgraph = { git = "https://github.com/ChunelFeng/CGraph.git", subdirectory = "python", tag = "v3.2.2", marker = "platform_machine == 'aarch64'" }
 
 [tool.ruff]
diff --git a/hugegraph-ml/pyproject.toml b/hugegraph-ml/pyproject.toml
index e8e83aa8..4831cae0 100644
--- a/hugegraph-ml/pyproject.toml
+++ b/hugegraph-ml/pyproject.toml
@@ -42,7 +42,7 @@ dependencies = [
     "packaging",
     "torchdata",
     "PyYAML",
-    "hugegraph-python-client",
+    "hugegraph-python",
     # Common data dependencies managed by root
     "numpy",
     "pandas",
@@ -68,4 +68,4 @@ include = [
 allow-direct-references = true
 
 [tool.uv.sources]
-hugegraph-python-client = { path = "../hugegraph-python-client", editable = true }
+hugegraph-python = { path = "../hugegraph-python-client", editable = true }
diff --git a/hugegraph-python-client/README.md b/hugegraph-python-client/README.md
index 525f35d9..a26b1265 100644
--- a/hugegraph-python-client/README.md
+++ b/hugegraph-python-client/README.md
@@ -1,6 +1,6 @@
 # hugegraph-python-client
 
-The `hugegraph-python-client` is a Python client/SDK for HugeGraph Database.
+The `hugegraph-python-client` module provides the `hugegraph-python` Python client/SDK for HugeGraph Database. The distribution name is `hugegraph-python`; the import name remains `pyhugegraph`.
 
 It is used to define graph structures, perform CRUD operations on graph data, manage schemas, and execute Gremlin queries. Both the `hugegraph-llm` and `hugegraph-ml` modules depend on this foundational library.
 
@@ -8,12 +8,11 @@ It is used to define graph structures, perform CRUD operations on graph data, ma
 
 ### Install the released package (Stable)
 
-To install the `hugegraph-python-client`, you can use uv/pip or source code building:
+To install the released `hugegraph-python` distribution:
 
 ```bash
 # uv is optional, you can use pip directly
-uv pip install hugegraph-python # Note: may not the latest version, recommend to install from source
-# WIP: we will use 'hugegraph-python-client' as the package name soon
+uv pip install hugegraph-python
 ```
 
 ### Install from Source (Latest Code)
@@ -22,10 +21,10 @@ To install from the source, clone the repository and install the required depend
 
 ```bash
 git clone https://github.com/apache/hugegraph-ai.git
-cd hugegraph-ai/hugegraph-python-client
+cd hugegraph-ai
 
 # Use uv sync to install dependencies (workspace member)
-uv sync  # Automatically creates .venv and installs dependencies
+uv sync --extra python-client  # Installs hugegraph-python from hugegraph-python-client/
 source .venv/bin/activate  # Activate once - all commands below assume this environment
 ```
 
diff --git a/hugegraph-python-client/pyproject.toml b/hugegraph-python-client/pyproject.toml
index 2c847090..8b49f309 100644
--- a/hugegraph-python-client/pyproject.toml
+++ b/hugegraph-python-client/pyproject.toml
@@ -16,7 +16,7 @@
 # under the License.
 
 [project]
-name = "hugegraph-python-client"
+name = "hugegraph-python"
 version = "1.7.0"
 description = "A Python SDK for Apache HugeGraph Database."
 authors = [
diff --git a/hugegraph-python-client/src/pyhugegraph/example/hugegraph_test.py b/hugegraph-python-client/src/pyhugegraph/example/hugegraph_test.py
index dc9c1862..5776458a 100644
--- a/hugegraph-python-client/src/pyhugegraph/example/hugegraph_test.py
+++ b/hugegraph-python-client/src/pyhugegraph/example/hugegraph_test.py
@@ -31,7 +31,7 @@ class HugeGraph:
             from pyhugegraph.client import PyHugeClient
         except ImportError:
             raise ValueError(
-                "Please install HugeGraph Python client first: `pip3 install hugegraph-python-client`"
+                "Please install HugeGraph Python client first: `uv pip install hugegraph-python`"
             ) from ImportError
 
         self.username = username
diff --git a/hugegraph-python-client/src/tests/test_distribution.py b/hugegraph-python-client/src/tests/test_distribution.py
new file mode 100644
index 00000000..9e42943d
--- /dev/null
+++ b/hugegraph-python-client/src/tests/test_distribution.py
@@ -0,0 +1,29 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from importlib.metadata import distribution
+
+import pytest
+from pyhugegraph.client import PyHugeClient
+
+pytestmark = pytest.mark.contract
+
+
+def test_distribution_preserves_import_contract():
+    installed = distribution("hugegraph-python")
+    assert installed.metadata["Name"] == "hugegraph-python"
+    assert PyHugeClient.__module__ == "pyhugegraph.client"
diff --git a/pyproject.toml b/pyproject.toml
index 43ff9cbc..96da2500 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -37,7 +37,7 @@ dependencies = [
 [project.optional-dependencies]
 llm = ["hugegraph-llm"]
 ml = ["hugegraph-ml"]
-python-client = ["hugegraph-python-client"]
+python-client = ["hugegraph-python"]
 vermeer = ["vermeer-python-client"]
 dev = [
     "pytest~=8.0.0",
@@ -50,8 +50,8 @@ dev = [
     "pre-commit>=3.5.0",
 ]
 
-nk-llm = ["hugegraph-llm", "hugegraph-python-client", "nuitka"]
-all = ["hugegraph-python-client", "hugegraph-llm", "hugegraph-ml", "vermeer-python-client"]
+nk-llm = ["hugegraph-llm", "hugegraph-python", "nuitka"]
+all = ["hugegraph-python", "hugegraph-llm", "hugegraph-ml", "vermeer-python-client"]
 
 [project.urls]
 homepage = "https://hugegraph.apache.org/"
@@ -86,7 +86,7 @@ include = ["*/src", "README.md", "LICENSE", "NOTICE"]
 
 [tool.uv.sources]
 hugegraph-llm = { workspace = true }
-hugegraph-python-client = { workspace = true }
+hugegraph-python = { workspace = true }
 hugegraph-ml = { path = "hugegraph-ml", editable = true }
 vermeer-python-client = { path = "vermeer-python-client", editable = true }