Skip to content

Commit

Permalink
Issue 238: Fix the automated python bindings publish workflow. (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
shrids authored Mar 10, 2021
1 parent 04d34ea commit 6355497
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
override: true
components: rustfmt, clippy
- name: Install maturin and tox
run: pip install maturin virtualenv tox
run: pip install 'maturin==0.8.3' virtualenv tox
- name: Test with tox
run: tox -c bindings/tox.ini
- name: Upload Pravega standalone logs
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/tagPublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ jobs:
components: rustfmt, clippy
- run: rustup set default-host ${{ matrix.platform.rust-target }}
- name: install maturin
run: pip install maturin
run: pip install 'maturin==0.8.3'
- name: build wheel
id: build_wheel
run: python -u .github/workflows/build_wheel.py
- name: build source
id: build_source
run: python -u .github/workflows/build_source.py
- name: Publish to TestPyPI
- name: Publish to pypi
env:
# the username and the repository needs to be changed before release.
TWINE_USERNAME: ${{ secrets.test_pypi_username }}
TWINE_PASSWORD: ${{ secrets.test_pypi_password }}
TWINE_REPOSITORY: testpypi
TWINE_USERNAME: ${{ secrets.pypi_user_name }}
TWINE_PASSWORD: ${{ secrets.pypi_password }}
TWINE_REPOSITORY: pypi
run: |
pip install -U twine
python -m twine upload --skip-existing target/wheels/*
2 changes: 1 addition & 1 deletion bindings/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ authors = ["Pravega Community"]
classifier = ["Development Status :: 5 - Production/Stable", "License :: OSI Approved :: Apache Software License",
"Programming Language :: Rust", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9",]
requires-python = ">= 3.8"
project-url = {"Homepage"= "https://pravega.github.io/pravega-client-rust/"}
project-url = ["Homepage, https://pravega.github.io/pravega-client-rust/"]

[lib]
name = "pravega_client"
Expand Down
6 changes: 3 additions & 3 deletions bindings/PythonBinding.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
## Steps to generate language bindings for Pravega:
## Steps to generate python bindings for Pravega:

*Pre-requisites*
- Python 3.8 and up.

1. Ensure `cargo build` works fine.
2. There are two ways of running generating bindings. This describes the steps where maturin is manually installed.
- Manually install [maturin](https://github.com/PyO3/maturin) via `pip install maturin`
- `maturin build --release --no-sdist --strip` This command auto detects the python interpreter and uses it. To
- `maturin build --release --no-sdist --strip --manylinux off` This command auto detects the python interpreter and uses it. To
specify a specific interpreter using `--interpreter` option.
- `maturin sdist` to generate the source distribution.
3. Steps to generate bindings using a docker approach.
- `docker run --rm -v --release --no-sdist --strip`
- `docker run --rm -v --release --no-sdist --strip --manylinux off`
4. After the bindings are generated by either 2 or 3 the next step is publish the artifacts.
- The artifacts can be published via [twine](https://github.com/pypa/twine)
- `pip install twine`
Expand Down
10 changes: 2 additions & 8 deletions bindings/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,8 @@ visit https://pravega.github.io/pravega-client-rust/Python/PythonBindings.html

## Usage

You can either download binaries from the [latest release](https://github.com/pravega/pravega-client-rust/releases/latest) or install it with pip:

The client library can be installed using pip.
```shell
pip install -i https://test.pypi.org/simple/ pravega

or

pip install pravega
```


The users can also choose to generate the bindings using the commands specified at [PythonBinding](./PythonBinding.md) .
2 changes: 1 addition & 1 deletion bindings/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[build-system]
requires = ["maturin"]
requires = ["maturin==0.8.3"]
build-backend = "maturin"

0 comments on commit 6355497

Please sign in to comment.