Skip to content

Commit c2ae5ea

Browse files
authored
Set up pyproject.toml and Add Python project setup with protobuf generation (#5)
1 parent 0d84fc9 commit c2ae5ea

39 files changed

+5363
-1
lines changed

.gitignore

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Logs
59+
*.log
60+
61+
# Environments
62+
.env
63+
.venv
64+
env/
65+
venv/
66+
ENV/
67+
env.bak/
68+
venv.bak/
69+
70+
# mypy
71+
.mypy_cache/
72+
.dmypy.json
73+
dmypy.json
74+
75+
# Pyre type checker
76+
.pyre/
77+
78+
# pytype static type analyzer
79+
.pytype/
80+
81+
# Cython debug symbols
82+
cython_debug/
83+
84+
# PyCharm
85+
.idea/
86+
*.iml
87+
*.ipr
88+
*.iws
89+
90+
# VS Code
91+
.vscode/
92+
93+
# macOS
94+
.DS_Store
95+
96+
# Windows
97+
Thumbs.db
98+
ehthumbs.db
99+
Desktop.ini
100+
101+
# Project specific
102+
.temp_gen/
103+
*.pb.py
104+
*.pb.pyi
105+
106+
# bin
107+
.bin/

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,53 @@ git clone https://github.com/cadence-workflow/cadence-python-client.git
1818
cd cadence-python-client
1919
```
2020

21+
## Development
22+
23+
### Setup
24+
25+
1. **Create virtual environment:**
26+
```bash
27+
python3 -m venv venv
28+
source venv/bin/activate # Windows: venv\Scripts\activate
29+
```
30+
31+
2. **Install dependencies:**
32+
```bash
33+
pip install -r requirements.txt
34+
```
35+
36+
### Generate Protobuf Files
37+
38+
Run the generation script:
39+
```bash
40+
python scripts/generate_protobuf_final.py
41+
```
42+
43+
This will:
44+
- Download protoc 29.1 binary
45+
- Generate Python files in `cadence/api/v1/`
46+
- Create proper package structure
47+
48+
### Test
49+
50+
Verify the generated files work:
51+
```bash
52+
python cadence/sample/simple_usage_example.py
53+
```
54+
55+
### Usage
56+
57+
```python
58+
from cadence.api.v1 import workflow, common, domain
59+
60+
# Create objects
61+
wf_exec = common.WorkflowExecution()
62+
wf_exec.workflow_id = "my-workflow"
63+
64+
# Use enums
65+
status = workflow.WORKFLOW_EXECUTION_CLOSE_STATUS_COMPLETED
66+
```
67+
2168
## License
2269

2370
Apache 2.0 License, please see [LICENSE](LICENSE) for details.

cadence/api/__init__.py

Whitespace-only changes.

cadence/api/v1/__init__.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Auto-generated __init__.py file
2+
# Import all generated protobuf modules
3+
from . import common_pb2
4+
from . import decision_pb2
5+
from . import domain_pb2
6+
from . import error_pb2
7+
from . import history_pb2
8+
from . import query_pb2
9+
from . import service_domain_pb2
10+
from . import service_meta_pb2
11+
from . import service_visibility_pb2
12+
from . import service_worker_pb2
13+
from . import service_workflow_pb2
14+
from . import tasklist_pb2
15+
from . import visibility_pb2
16+
from . import workflow_pb2
17+
18+
# Create cleaner aliases for easier imports
19+
common = common_pb2
20+
decision = decision_pb2
21+
domain = domain_pb2
22+
error = error_pb2
23+
history = history_pb2
24+
query = query_pb2
25+
service_domain = service_domain_pb2
26+
service_meta = service_meta_pb2
27+
service_visibility = service_visibility_pb2
28+
service_worker = service_worker_pb2
29+
service_workflow = service_workflow_pb2
30+
tasklist = tasklist_pb2
31+
visibility = visibility_pb2
32+
workflow = workflow_pb2
33+
34+
# Only expose clean module names (no _pb2)
35+
__all__ = [
36+
'common',
37+
'decision',
38+
'domain',
39+
'error',
40+
'history',
41+
'query',
42+
'service_domain',
43+
'service_meta',
44+
'service_visibility',
45+
'service_worker',
46+
'service_workflow',
47+
'tasklist',
48+
'visibility',
49+
'workflow',
50+
]

cadence/api/v1/common_pb2.py

Lines changed: 90 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)