-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
README + Github actions configuration
- Loading branch information
1 parent
6c4c79b
commit 0dcf0fa
Showing
4 changed files
with
242 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v*' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
linux: | ||
runs-on: ${{ matrix.platform.runner }} | ||
strategy: | ||
matrix: | ||
platform: | ||
- runner: ubuntu-latest | ||
target: x86_64 | ||
- runner: ubuntu-latest | ||
target: aarch64 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
- name: Build wheels | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
target: ${{ matrix.platform.target }} | ||
args: --release --out dist --find-interpreter | ||
sccache: 'true' | ||
manylinux: auto | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheels-linux-${{ matrix.platform.target }} | ||
path: dist | ||
|
||
musllinux: | ||
runs-on: ${{ matrix.platform.runner }} | ||
strategy: | ||
matrix: | ||
platform: | ||
- runner: ubuntu-latest | ||
target: x86_64 | ||
- runner: ubuntu-latest | ||
target: aarch64 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
- name: Build wheels | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
target: ${{ matrix.platform.target }} | ||
args: --release --out dist --find-interpreter | ||
sccache: 'true' | ||
manylinux: musllinux_1_2 | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheels-musllinux-${{ matrix.platform.target }} | ||
path: dist | ||
|
||
macos: | ||
runs-on: ${{ matrix.platform.runner }} | ||
strategy: | ||
matrix: | ||
platform: | ||
- runner: macos-12 | ||
target: x86_64 | ||
- runner: macos-14 | ||
target: aarch64 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
- name: Build wheels | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
target: ${{ matrix.platform.target }} | ||
args: --release --out dist --find-interpreter | ||
sccache: 'true' | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheels-macos-${{ matrix.platform.target }} | ||
path: dist | ||
|
||
sdist: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build sdist | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
command: sdist | ||
args: --out dist | ||
- name: Upload sdist | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheels-sdist | ||
path: dist | ||
|
||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
needs: [linux, musllinux, macos, sdist] | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
- name: Publish to PyPI | ||
uses: PyO3/maturin-action@v1 | ||
env: | ||
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | ||
with: | ||
command: upload | ||
args: --non-interactive --skip-existing wheels-*/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Test | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
linux: | ||
runs-on: ${{ matrix.platform.runner }} | ||
strategy: | ||
matrix: | ||
platform: | ||
- runner: ubuntu-latest | ||
target: x86_64 | ||
- runner: ubuntu-latest | ||
target: aarch64 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: extractions/setup-just@v2 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
- name: Build Rust module | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
command: dev -E test,lint | ||
- name: Verify | ||
run: just verify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,92 @@ | ||
## Python SDK for restate | ||
[![Documentation](https://img.shields.io/badge/doc-reference-blue)](https://docs.restate.dev) | ||
[![Examples](https://img.shields.io/badge/view-examples-blue)](https://github.com/restatedev/examples) | ||
[![Discord](https://img.shields.io/discord/1128210118216007792?logo=discord)](https://discord.gg/skW3AZ6uGd) | ||
[![Twitter](https://img.shields.io/twitter/follow/restatedev.svg?style=social&label=Follow)](https://twitter.com/intent/follow?screen_name=restatedev) | ||
|
||
# Python SDK for restate | ||
|
||
### Prerequisites | ||
* python 3 | ||
* pip | ||
* just | ||
> [!WARNING] | ||
> The Python SDK is currently in active development, and might break across releases. | ||
### Local development | ||
[Restate](https://restate.dev/) is a system for easily building resilient applications using *distributed durable async/await*. This repository contains the Restate SDK for writing services in **Python**. | ||
|
||
## Community | ||
|
||
* 🤗️ [Join our online community](https://discord.gg/skW3AZ6uGd) for help, sharing feedback and talking to the community. | ||
* 📖 [Check out our documentation](https://docs.restate.dev) to get quickly started! | ||
* 📣 [Follow us on Twitter](https://twitter.com/restatedev) for staying up to date. | ||
* 🙋 [Create a GitHub issue](https://github.com/restatedev/sdk-typescript/issues) for requesting a new feature or reporting a problem. | ||
* 🏠 [Visit our GitHub org](https://github.com/restatedev) for exploring other repositories. | ||
|
||
## Using the SDK | ||
|
||
To use this SDK, add the dependency to your project: | ||
|
||
```shell | ||
pip install restate_sdk | ||
``` | ||
|
||
* pip install -r requirements.txt | ||
* just build | ||
## Versions | ||
|
||
The Python SDK is currently in active development, and might break across releases. | ||
|
||
### Justfile commands | ||
* just clean | ||
* just verify | ||
* just build | ||
* just example | ||
The compatibility with Restate is described in the following table: | ||
|
||
### Dev | ||
| Restate Server\sdk-typescript | 0.0/0.1 | | ||
|-------------------------------|---------| | ||
| 1.0 | ✅ | | ||
|
||
#### Pre-requisites | ||
## Contributing | ||
|
||
We’re excited if you join the Restate community and start contributing! | ||
Whether it is feature requests, bug reports, ideas & feedback or PRs, we appreciate any and all contributions. | ||
We know that your time is precious and, therefore, deeply value any effort to contribute! | ||
|
||
### Local development | ||
|
||
* Python 3 | ||
* pip | ||
* just | ||
* PyEnv or VirtualEnv | ||
* [just](https://github.com/casey/just) | ||
* [Rust toolchain](https://rustup.rs/) | ||
|
||
Build the | ||
Setup your virtual environment using the tool of your choice, e.g. VirtualEnv: | ||
|
||
```shell | ||
python3 -m venv .venv | ||
source venv/bin/activate | ||
``` | ||
|
||
Install `maturin`: | ||
|
||
```shell | ||
pip install maturin | ||
``` | ||
|
||
Now build the Rust module and include opt-in additional dev dependencies: | ||
|
||
```shell | ||
maturin dev -E test,lint | ||
``` | ||
|
||
You usually need to build the Rust module only once, but you might need to rebuild it on pulls. | ||
|
||
For linting and testing: | ||
|
||
```shell | ||
just verify | ||
``` | ||
|
||
## Releasing the package | ||
|
||
Pull latest main: | ||
|
||
```shell | ||
git checkout main && git pull | ||
``` | ||
|
||
Update module version in `Cargo.toml`, commit it. Then push tag, e.g.: | ||
|
||
``` | ||
git tag -m "Release v0.1.0" v0.1.0 | ||
git push origin v0.1.0 | ||
``` |