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

xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-rust.git


The following commit(s) were added to refs/heads/main by this push:
     new 9778fe6  Python: Use hatch for dependency management (#572)
9778fe6 is described below

commit 9778fe6e77ed7fe374718655214418e72983c4f0
Author: Sung Yun <[email protected]>
AuthorDate: Mon Aug 19 13:34:02 2024 -0400

    Python: Use hatch for dependency management (#572)
---
 .github/workflows/bindings_python_ci.yml |  6 +++---
 bindings/python/README.md                | 10 +++-------
 bindings/python/pyproject.toml           | 14 +++++++++++---
 3 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/.github/workflows/bindings_python_ci.yml 
b/.github/workflows/bindings_python_ci.yml
index 82f13e7..1f50a8e 100644
--- a/.github/workflows/bindings_python_ci.yml
+++ b/.github/workflows/bindings_python_ci.yml
@@ -78,6 +78,6 @@ jobs:
         shell: bash
         run: |
           set -e
-          pip install dist/pyiceberg_core-*.whl --force-reinstall
-          pip install pytest
-          pytest -v
+          pip install hatch==1.12.0
+          hatch run dev:pip install dist/pyiceberg_core-*.whl --force-reinstall
+          hatch run dev:test
\ No newline at end of file
diff --git a/bindings/python/README.md b/bindings/python/README.md
index 566a7bc..fe4300e 100644
--- a/bindings/python/README.md
+++ b/bindings/python/README.md
@@ -24,21 +24,17 @@ This project is used to build an iceberg-rust powered core 
for pyiceberg.
 ## Setup
 
 ```shell
-python -m venv venv
-source ./venv/bin/activate
- 
-pip install maturin
+pip install hatch==1.12.0
 ```
 
 ## Build
 
 ```shell
-maturin develop
+hatch run dev:develop
 ```
 
 ## Test
 
 ```shell
-maturin develop -E test
-pytest -v
+hatch run dev:test
 ```
\ No newline at end of file
diff --git a/bindings/python/pyproject.toml b/bindings/python/pyproject.toml
index 4a489ad..910cf50 100644
--- a/bindings/python/pyproject.toml
+++ b/bindings/python/pyproject.toml
@@ -31,9 +31,6 @@ classifiers = [
   "Programming Language :: Python :: 3.12",
 ]
 
-[project.optional-dependencies]
-test = ["pytest"]
-
 [tool.maturin]
 features = ["pyo3/extension-module"]
 python-source = "python"
@@ -41,3 +38,14 @@ module-name = "pyiceberg_core.pyiceberg_core_rust"
 
 [tool.ruff.lint]
 ignore = ["F403", "F405"]
+
+[tool.hatch.envs.dev]
+dependencies = [
+    "maturin>=1.0,<2.0",
+    "pytest>=8.3.2",
+]
+
+[tool.hatch.envs.dev.scripts]
+develop = "maturin develop"
+build = "maturin build --out dist --sdist"
+test = "pytest"

Reply via email to