Skip to content

Commit

Permalink
chore: manage deps with maturin (#1611)
Browse files Browse the repository at this point in the history
* chore: manage deps with maturin

Signed-off-by: Chojan Shang <[email protected]>

* chore(ci): try to make the workflow work

Signed-off-by: Chojan Shang <[email protected]>

* ci: build with pip and maturin

Signed-off-by: Chojan Shang <[email protected]>

---------

Signed-off-by: Chojan Shang <[email protected]>
  • Loading branch information
PsiACE authored Mar 15, 2023
1 parent a2db495 commit 8f2ffa8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/bindings_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,13 @@ jobs:
with:
python-version: '3.11'
- uses: Swatinem/rust-cache@v2
- uses: PyO3/maturin-action@v1
with:
manylinux: off
working-directory: "bindings/python"
command: build
args: --release --sdist -o dist
- name: Build with maturin
working-directory: "bindings/python"
run: |
python -m pip install -e .[test]
- name: Run pytest
working-directory: "bindings/python"
run: |
set -e
python -m pip install dist/opendal-*.whl
python -m pip install -r test_requirements.txt
python -m pytest
linux:
Expand Down
16 changes: 8 additions & 8 deletions bindings/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,10 @@ asyncio.run(main())

## Development

Install `maturin`:

```shell
pip install maturin
```

Setup virtualenv:

```shell
virtualenv venv
python -m venv venv
```

Activate venv:
Expand All @@ -52,6 +46,12 @@ Activate venv:
source venv/bin/activate
````

Install `maturin`:

```shell
pip install maturin[patchelf]
```

Build bindings:

```shell
Expand All @@ -61,6 +61,6 @@ maturin develop
Running some tests:

```shell
pip install -r test_requirements.txt
maturin develop -E test
pytest
```
3 changes: 3 additions & 0 deletions bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ name = "opendal"
readme = "README.md"
requires-python = ">=3.7"

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

[project.urls]
Documentation = "https://docs.rs/opendal/"
Homepage = "https://opendal.databend.rs/"
Expand Down
2 changes: 0 additions & 2 deletions bindings/python/test_requirements.txt

This file was deleted.

0 comments on commit 8f2ffa8

Please sign in to comment.