|
2 | 2 |
|
3 | 3 | [Cadence](https://github.com/uber/cadence) is a distributed, scalable, durable, and highly available orchestration engine we developed at Uber Engineering to execute asynchronous long-running business logic in a scalable and resilient way. |
4 | 4 |
|
| 5 | +If you'd like to propose a new feature, first join the [CNCF Slack workspace](https://communityinviter.com/apps/cloud-native/cncf) in the **#cadence-users** channel to start a discussion. |
| 6 | + |
5 | 7 | `cadence-python-client` is the Python framework for authoring workflows and activities. |
6 | 8 |
|
7 | 9 | ## Disclaimer |
|
16 | 18 | ```bash |
17 | 19 | git clone https://github.com/cadence-workflow/cadence-python-client.git |
18 | 20 | cd cadence-python-client |
19 | | -uv venv |
20 | | -uv pip install -e ".[dev]" |
21 | 21 | ``` |
22 | 22 |
|
23 | | -For detailed setup instructions, development workflow, and contribution guidelines, see [CONTRIBUTING.md](CONTRIBUTING.md). |
| 23 | +## Development |
24 | 24 |
|
25 | | -## Contributing |
| 25 | +### Setup |
26 | 26 |
|
27 | | -We'd love your help in making Cadence great! Please review our [contribution guide](CONTRIBUTING.md). |
| 27 | +1. **Install protobuf (required):** |
| 28 | + ```bash |
| 29 | + # macOS |
| 30 | + brew install protobuf@29 |
28 | 31 |
|
29 | | -If you'd like to propose a new feature, first join the [CNCF Slack workspace](https://communityinviter.com/apps/cloud-native/cncf) in the **#cadence-users** channel to start a discussion. |
| 32 | + # Linux/Other |
| 33 | + # Install protobuf 29.x via your package manager |
| 34 | + ``` |
| 35 | + |
| 36 | +2. **Install uv (recommended):** |
| 37 | + ```bash |
| 38 | + # macOS |
| 39 | + brew install uv |
| 40 | + |
| 41 | + # Linux/Other |
| 42 | + curl -LsSf https://astral.sh/uv/install.sh | sh |
| 43 | + source $HOME/.local/bin/env # Add to your shell profile for persistence |
| 44 | + ``` |
| 45 | + |
| 46 | +3. **Create virtual environment and install dependencies:** |
| 47 | + ```bash |
| 48 | + uv venv |
| 49 | + uv pip install -e ".[dev]" |
| 50 | + ``` |
| 51 | + |
| 52 | + Or if you prefer traditional pip: |
| 53 | + ```bash |
| 54 | + python3.11 -m venv venv |
| 55 | + source venv/bin/activate # Windows: venv\Scripts\activate |
| 56 | + pip install -e ".[dev]" |
| 57 | + ``` |
30 | 58 |
|
31 | | -## Community |
| 59 | +### Generate Protobuf and gRPC Files |
32 | 60 |
|
33 | | -- [GitHub Issues](https://github.com/cadence-workflow/cadence-python-client/issues) |
34 | | - - Best for reporting bugs and feature requests |
35 | | -- [Stack Overflow](https://stackoverflow.com/questions/tagged/cadence-workflow) |
36 | | - - Best for Q&A and general discussion |
37 | | -- [Slack](https://communityinviter.com/apps/cloud-native/cncf) - Join **#cadence-users** channel on CNCF Slack |
38 | | - - Best for contributing/development discussion |
| 61 | +Run the generation script: |
| 62 | +```bash |
| 63 | +# Using uv (recommended) |
| 64 | +uv sync --extra dev |
| 65 | +uv run python scripts/generate_proto.py |
| 66 | + |
| 67 | +# Or using traditional Python |
| 68 | +python scripts/generate_proto.py |
| 69 | +``` |
| 70 | + |
| 71 | +This will: |
| 72 | +- Download protoc 29.1 binary |
| 73 | +- Install grpcio-tools if needed |
| 74 | +- Generate Python protobuf files in `cadence/api/v1/` |
| 75 | +- Generate gRPC service files in `cadence/api/v1/` |
| 76 | +- Create proper package structure with both protobuf and gRPC imports |
39 | 77 |
|
40 | | -## Documentation |
| 78 | +### Test |
41 | 79 |
|
42 | | -Visit [cadenceworkflow.io](https://cadenceworkflow.io) to learn more about Cadence. |
| 80 | +Verify the generated files work: |
| 81 | +```bash |
| 82 | +# Using uv (recommended) |
| 83 | +uv run python cadence/sample/simple_usage_example.py |
| 84 | +uv run python cadence/sample/grpc_usage_example.py |
| 85 | + |
| 86 | +# Or using traditional Python |
| 87 | +python cadence/sample/simple_usage_example.py |
| 88 | +python test_grpc_with_examples.py |
| 89 | +``` |
43 | 90 |
|
44 | | -- [Documentation](https://cadenceworkflow.io/docs/) |
45 | | -- [Main Cadence Repository](https://github.com/uber/cadence) |
46 | | -- [Cadence Samples](https://github.com/cadence-workflow/cadence-samples) |
| 91 | +### Development Script |
| 92 | + |
| 93 | +The project includes a development script that provides convenient commands for common tasks: |
| 94 | + |
| 95 | +```bash |
| 96 | +# Generate protobuf files |
| 97 | +uv run python scripts/dev.py protobuf |
| 98 | + |
| 99 | +# Run tests |
| 100 | +uv run python scripts/dev.py test |
| 101 | + |
| 102 | +# Run tests with coverage |
| 103 | +uv run python scripts/dev.py test-cov |
| 104 | + |
| 105 | +# Run linting |
| 106 | +uv run python scripts/dev.py lint |
| 107 | + |
| 108 | +# Format code |
| 109 | +uv run python scripts/dev.py format |
| 110 | + |
| 111 | +# Install in development mode |
| 112 | +uv run python scripts/dev.py install |
| 113 | + |
| 114 | +# Install with dev dependencies |
| 115 | +uv run python scripts/dev.py install-dev |
| 116 | + |
| 117 | +# Build package |
| 118 | +uv run python scripts/dev.py build |
| 119 | + |
| 120 | +# Clean build artifacts |
| 121 | +uv run python scripts/dev.py clean |
| 122 | + |
| 123 | +# Run all checks (lint + test) |
| 124 | +uv run python scripts/dev.py check |
| 125 | +``` |
47 | 126 |
|
48 | 127 | ## License |
49 | 128 |
|
|
0 commit comments