Skip to content

Commit

Permalink
Python: Use hatch for dependency management (apache#572)
Browse files Browse the repository at this point in the history
  • Loading branch information
sungwy authored Aug 19, 2024
1 parent a4894f9 commit 9778fe6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/bindings_python_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 3 additions & 7 deletions bindings/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
14 changes: 11 additions & 3 deletions bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,21 @@ classifiers = [
"Programming Language :: Python :: 3.12",
]

[project.optional-dependencies]
test = ["pytest"]

[tool.maturin]
features = ["pyo3/extension-module"]
python-source = "python"
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"

0 comments on commit 9778fe6

Please sign in to comment.