Skip to content

change dependency management in favor of pyproject.toml and uv #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 27 additions & 6 deletions README.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readme says python scripts/generate_protobuf_final.py but we only have scripts/generate_protobuf.py Running the script shows a bunch of files deleted. Is the new script checked-in?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got error

  ✗ Failed to generate files for cadence/api/v1/common.proto: Command '['/Users/shengs/code/me/cadence-python-client/.bin/protoc-29.1', '--python_out=/Users/shengs/code/me/cadence-python-client/cadence', '--pyi_out=/Users/shengs/code/me/cadence-python-client/cadence', '--proto_path=/Users/shengs/code/me/cadence-python-client/.temp_proto', '--proto_path=/opt/homebrew/include', '/Users/shengs/code/me/cadence-python-client/.temp_proto/cadence/api/v1/common.proto']' returned non-zero exit status 1.
  stderr: google/protobuf/duration.proto: File not found.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing that out, it should be generate_proto.py

Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,43 @@ cd cadence-python-client

### Setup

1. **Create virtual environment:**
1. **Install protobuf (required):**
```bash
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# macOS
brew install protobuf@29

# Linux/Other
# Install protobuf 29.x via your package manager
```

2. **Install uv (recommended):**
```bash
# macOS
brew install uv

# Linux/Other
curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env # Add to your shell profile for persistence
```

2. **Install dependencies:**
3. **Create virtual environment and install dependencies:**
```bash
pip install -r requirements.txt
uv venv
uv pip install -e ".[dev]"
```

Or if you prefer traditional pip:
```bash
python3.11 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -e ".[dev]"
```

### Generate Protobuf Files

Run the generation script:
```bash
python scripts/generate_protobuf_final.py
python scripts/generate_proto.py
```

This will:
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Distributed Computing",
]
requires-python = ">=3.11,<3.12"
requires-python = ">=3.11,<3.14"
dependencies = [
"grpcio>=1.50.0",
"grpcio-tools>=1.50.0",
"protobuf==5.29.1",
"thriftpy2>=0.4.0",
"six>=1.16.0",
"typing-extensions>=4.0.0",
]

Expand Down
15 changes: 0 additions & 15 deletions requirements.txt

This file was deleted.