Skip to content

Commit 559409d

Browse files
Prepare for PyPI publish: add metadata and publish workflow (#165)
Update pyproject.toml with PyPI metadata: - Added authors, keywords, classifiers - Added Documentation, Repository, and Issues URLs - Declared Python 3.10/3.11/3.12 support - Marked as Alpha status and typed package Update README.md: - Changed status from "MVP/experimental" to "Alpha" - Updated install instructions to use pip install durable-workflow - Removed stale PHP serialization caveat (resolved in #206) - Added Features section highlighting async, type-safety, polyglot support - Added Documentation section with links to docs site - Updated quickstart to show result output Add .github/workflows/publish.yml: - Builds package on version tags (v*) - Publishes to PyPI using trusted publishing - Supports TestPyPI for testing via workflow_dispatch - Includes dry-run option for build verification Package is ready for 0.1.0 release. CI passing (204 tests). Closes #165 (Phase 0 complete - PyPI publish ready) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent ff967f4 commit 559409d

3 files changed

Lines changed: 158 additions & 6 deletions

File tree

.github/workflows/publish.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
dry_run:
10+
description: 'Dry run (build only, no publish)'
11+
required: false
12+
type: boolean
13+
default: true
14+
15+
permissions:
16+
contents: read
17+
id-token: write # Required for PyPI trusted publishing
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: actions/setup-python@v5
26+
with:
27+
python-version: "3.12"
28+
29+
- name: Install build tools
30+
run: pip install build twine
31+
32+
- name: Build package
33+
run: python -m build
34+
35+
- name: Check package
36+
run: twine check dist/*
37+
38+
- name: Upload artifacts
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: dist
42+
path: dist/
43+
44+
publish:
45+
needs: build
46+
runs-on: ubuntu-latest
47+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
48+
environment:
49+
name: pypi
50+
url: https://pypi.org/p/durable-workflow
51+
steps:
52+
- uses: actions/download-artifact@v4
53+
with:
54+
name: dist
55+
path: dist/
56+
57+
- name: Publish to PyPI
58+
uses: pypa/gh-action-pypi-publish@release/v1
59+
with:
60+
print-hash: true
61+
62+
publish-test:
63+
needs: build
64+
runs-on: ubuntu-latest
65+
if: github.event_name == 'workflow_dispatch' && !inputs.dry_run
66+
environment:
67+
name: testpypi
68+
url: https://test.pypi.org/p/durable-workflow
69+
steps:
70+
- uses: actions/download-artifact@v4
71+
with:
72+
name: dist
73+
path: dist/
74+
75+
- name: Publish to TestPyPI
76+
uses: pypa/gh-action-pypi-publish@release/v1
77+
with:
78+
repository-url: https://test.pypi.org/legacy/
79+
print-hash: true

README.md

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@
22

33
A Python SDK for the [Durable Workflow server](https://github.com/durable-workflow/server). Speaks the server's language-neutral HTTP/JSON worker protocol — no PHP runtime required.
44

5-
Status: **MVP / experimental**. Supports starting workflows, registering a worker, polling workflow + activity tasks, and completing them with `schedule_activity` and `complete_workflow` commands. Signals/queries/updates/timers/child workflows are not yet implemented.
5+
Status: **Alpha**. Supports starting workflows, registering workers, polling workflow + activity tasks, schedules, signals, and completing workflows. Queries, updates, timers, and child workflows are planned.
66

77
## Install
88

9+
```bash
10+
pip install durable-workflow
911
```
10-
pip install -e .
12+
13+
Or for development:
14+
15+
```bash
16+
pip install -e '.[dev]'
1117
```
1218

1319
## Quickstart
@@ -40,11 +46,54 @@ async def main():
4046
input=["world"],
4147
)
4248
await worker.run_until(workflow_id="greet-1")
43-
print(await client.get_result(handle))
49+
result = await client.get_result(handle)
50+
print(result) # "hello, world"
4451
```
4552

46-
## Protocol
53+
## Features
54+
55+
- **Async-first**: Built on `httpx` and `asyncio`
56+
- **Type-safe**: Full type hints, passes `mypy --strict`
57+
- **Polyglot**: Works alongside PHP workers on the same task queue
58+
- **HTTP/JSON protocol**: No gRPC, no protobuf dependencies
59+
- **Codec envelopes**: Proper `{codec: "json", blob: "..."}` serialization for cross-language workflows
60+
61+
## Documentation
62+
63+
Full documentation is available at [durable-workflow.github.io/docs/2.0/sdks/python/](https://durable-workflow.github.io/docs/2.0/sdks/python/):
64+
65+
- [Quickstart](https://durable-workflow.github.io/docs/2.0/sdks/python/quickstart)
66+
- [Client API](https://durable-workflow.github.io/docs/2.0/sdks/python/client)
67+
- [Workflow Authoring](https://durable-workflow.github.io/docs/2.0/sdks/python/workflows)
68+
- [Activity Authoring](https://durable-workflow.github.io/docs/2.0/sdks/python/activities)
69+
- [Worker Configuration](https://durable-workflow.github.io/docs/2.0/sdks/python/workers)
70+
- [Error Handling](https://durable-workflow.github.io/docs/2.0/sdks/python/errors)
71+
- [Schedules (Cron)](https://durable-workflow.github.io/docs/2.0/sdks/python/schedules)
72+
73+
## Requirements
74+
75+
- Python ≥ 3.10
76+
- A running [Durable Workflow server](https://github.com/durable-workflow/server)
77+
78+
## Development
79+
80+
```bash
81+
# Install dev dependencies
82+
pip install -e '.[dev]'
83+
84+
# Run tests
85+
pytest
86+
87+
# Run integration tests (requires Docker)
88+
pytest -m integration
89+
90+
# Type check
91+
mypy src/durable_workflow/
92+
93+
# Lint
94+
ruff check src/ tests/
95+
```
4796

48-
The SDK implements [the server's HTTP protocol](https://github.com/durable-workflow/server#getting-started-end-to-end-workflow) directly using `httpx`. No gRPC, no protobuf, no PHP.
97+
## License
4998

50-
Known caveats (tracked upstream): the server currently PHP-`serialize()`s workflow start inputs and activity arguments. See [issues].
99+
MIT

pyproject.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,27 @@ description = "Python SDK for the Durable Workflow server (language-neutral HTTP
99
readme = "README.md"
1010
requires-python = ">=3.10"
1111
license = { text = "MIT" }
12+
authors = [
13+
{ name = "Durable Workflow Contributors" },
14+
]
15+
keywords = [
16+
"workflow",
17+
"durable",
18+
"orchestration",
19+
"temporal",
20+
"saga",
21+
]
22+
classifiers = [
23+
"Development Status :: 3 - Alpha",
24+
"Intended Audience :: Developers",
25+
"License :: OSI Approved :: MIT License",
26+
"Programming Language :: Python :: 3",
27+
"Programming Language :: Python :: 3.10",
28+
"Programming Language :: Python :: 3.11",
29+
"Programming Language :: Python :: 3.12",
30+
"Topic :: Software Development :: Libraries :: Python Modules",
31+
"Typing :: Typed",
32+
]
1233
dependencies = [
1334
"httpx>=0.27",
1435
]
@@ -23,6 +44,9 @@ dev = [
2344

2445
[project.urls]
2546
Homepage = "https://github.com/durable-workflow/sdk-python"
47+
Documentation = "https://durable-workflow.github.io/docs/2.0/sdks/python/"
48+
Repository = "https://github.com/durable-workflow/sdk-python"
49+
Issues = "https://github.com/zorporation/durable-workflow/issues"
2650

2751
[tool.setuptools.packages.find]
2852
where = ["src"]

0 commit comments

Comments
 (0)