Skip to content
Open
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
12 changes: 6 additions & 6 deletions .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"allow": [
"WebSearch",
"WebFetch(domain:docs.temporal.io)",
"Bash(rye run pytest:*)",
"Bash(rye run lint:*)",
"Bash(rye run typecheck:*)",
"Bash(rye run sync:*)",
"Bash(rye run build:*)"
"Bash(uv run pytest:*)",
"Bash(uv run ruff:*)",
"Bash(uv run pyright:*)",
"Bash(uv sync:*)",
"Bash(uv build:*)"
],
"deny": [],
"ask": []
}
}
}
18 changes: 9 additions & 9 deletions .cursor/rules/00_repo_tooling.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ globs: "**/*"
alwaysApply: true
---

Use Rye for Python dependency management and workflows. Prefer these commands:
Use uv for Python dependency management and workflows. Prefer these commands:

- Setup env: `./scripts/bootstrap` or `rye sync --all-features` [[Use Rye in this repo]]
- Run tests: `rye run pytest` or `./scripts/test`
- Run a specific test: `rye run pytest path/to/test_file.py::TestClass::test_method -v`
- Format: `rye run format` or `./scripts/format`
- Lint: `rye run lint` or `./scripts/lint`
- Type check: `rye run typecheck` (runs pyright and mypy)
- Build: `rye build`
- Setup env: `./scripts/bootstrap` or `uv sync --all-groups`
- Run tests: `uv run pytest` or `./scripts/test`
- Run a specific test: `uv run pytest path/to/test_file.py::TestClass::test_method -v`
- Format: `uv run ruff format` or `./scripts/format`
- Lint: `uv run ruff check .` or `./scripts/lint`
- Type check: `uv run pyright`
- Build: `uv build`

Environment requirements:

Expand All @@ -21,4 +21,4 @@ Environment requirements:

Notes:

- Only use `uv` inside of tutorial folders which have their own virtualenv (managed by a tutorial specific pyproject.toml inside the relevant tutorial folder). Otherwise use rye at the top level.
- Tutorial folders have their own virtualenv (managed by a tutorial specific pyproject.toml inside the relevant tutorial folder). Use `uv run` within those folders.
14 changes: 7 additions & 7 deletions .cursor/rules/05_permissions_and_tools.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ When invoking external tools or the terminal, follow these constraints:

- Web search is allowed when needed for docs and references
- Prefer fetching docs from `docs.temporal.io` when researching Temporal topics
- Allowed bash commands should go through Rye workflows:
- `rye run pytest:*`
- `rye run lint:*`
- `rye run typecheck:*`
- `rye run sync:*`
- `rye run build:*`
- Allowed bash commands should go through uv workflows:
- `uv run pytest`
- `uv run ruff check .`
- `uv run pyright`
- `uv sync`
- `uv build`

Default to Rye; only use other tools when explicitly required by the codebase.
Default to uv; only use other tools when explicitly required by the codebase.
4 changes: 2 additions & 2 deletions .cursor/rules/50_tests_and_mocking.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ alwaysApply: true

Testing:

- Run tests with `rye run pytest` or `./scripts/test`
- To run a specific test: `rye run pytest path/to/test_file.py::TestClass::test_method -v`
- Run tests with `uv run pytest` or `./scripts/test`
- To run a specific test: `uv run pytest path/to/test_file.py::TestClass::test_method -v`
- A mock server is automatically started for tests on port 4010

When writing tests:
Expand Down
6 changes: 3 additions & 3 deletions .cursor/rules/60_style_lint_typecheck.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ alwaysApply: true

Standards:

- Format code via `rye run format` or `./scripts/format`
- Lint via `rye run lint` or `./scripts/lint`
- Type check via `rye run typecheck` (pyright + mypy)
- Format code via `uv run ruff format` or `./scripts/format`
- Lint via `uv run ruff check .` or `./scripts/lint`
- Type check via `uv run pyright`

Guidance:

Expand Down
3 changes: 1 addition & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}

USER vscode

RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.44.0" RYE_INSTALL_OPTION="--yes" bash
ENV PATH=/home/vscode/.rye/shims:$PATH
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/

RUN echo "[[ -d .venv ]] && source .venv/bin/activate || export PATH=\$PATH" >> /home/vscode/.bashrc
9 changes: 3 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,18 @@
"context": ".."
},

"postStartCommand": "rye sync --all-features",
"postStartCommand": "uv sync --all-groups",

"customizations": {
"vscode": {
"extensions": [
"ms-python.python"
],
"settings": {
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"python.pythonPath": ".venv/bin/python",
"python.defaultInterpreterPath": ".venv/bin/python",
"python.typeChecking": "basic",
"terminal.integrated.env.linux": {
"PATH": "/home/vscode/.rye/shims:${env:PATH}"
}
"python.typeChecking": "basic"
}
}
},
Expand Down
33 changes: 9 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,11 @@ jobs:
steps:
- uses: actions/checkout@v6

- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install dependencies
run: rye sync --all-features
run: uv sync --all-groups

- name: Run lints
run: ./scripts/lint
Expand All @@ -46,19 +41,14 @@ jobs:
steps:
- uses: actions/checkout@v6

- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install dependencies
run: rye sync --all-features
run: uv sync --all-groups

- name: Run build
run: rye build
run: uv build

- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/agentex-sdk-python'
Expand All @@ -83,13 +73,8 @@ jobs:
steps:
- uses: actions/checkout@v6

- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Bootstrap
run: ./scripts/bootstrap
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,8 @@ jobs:
steps:
- uses: actions/checkout@v6

- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: "0.44.0"
RYE_INSTALL_OPTION: "--yes"
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Publish to PyPI
run: |
Expand Down
2 changes: 0 additions & 2 deletions Brewfile

This file was deleted.

28 changes: 14 additions & 14 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
## Development Commands

### Package Management in the top level repo
- Use `rye` for dependency management (preferred)
- Use `uv` for dependency management
- Run `./scripts/bootstrap` to set up the environment
- Or use `rye sync --all-features` directly
- Or use `uv sync --all-groups` directly

Special note: the individual tutorials maintain their own tutorial specific virtualenv using `uv`. So when testing/running tutorials, you `uv run` instead of `rye run`. Everything else is similar.
Special note: the individual tutorials maintain their own tutorial specific virtualenv using `uv`. So when testing/running tutorials, you `uv run` instead of the top-level scripts. Everything else is similar.

#### Testing
- Run tests: `rye run pytest` or `./scripts/test`
- Run specific test: `rye run pytest path/to/test_file.py::TestClass::test_method -v`
- Run tests: `uv run pytest` or `./scripts/test`
- Run specific test: `uv run pytest path/to/test_file.py::TestClass::test_method -v`
- Mock server is automatically started for tests, runs on port 4010

#### Linting and Formatting
- Format code: `rye run format` or `./scripts/format`
* The repository is still in flux, so running format might accidentally change files that aren't part of your scope of changes. So always run `run rye format` with additional arguments to constrain the formatting to the files that you are modifying.
- Lint code: `rye run lint` or `./scripts/lint`
- Type check: `rye run typecheck` (runs both pyright and mypy)
- Format code: `uv run ruff format` or `./scripts/format`
* The repository is still in flux, so running format might accidentally change files that aren't part of your scope of changes. So always run `uv run ruff format` with additional arguments to constrain the formatting to the files that you are modifying.
- Lint code: `uv run ruff check .` or `./scripts/lint`
- Type check: `uv run pyright`

### Building and Running
- Build package: `rye build`
- Build package: `uv build`



### CLI Commands
The package provides the `agentex` CLI with these main commands:
- `agentex agents` - Get, list, run, build, and deploy agents
- `agentex tasks` - Get, list, and delete tasks
- `agentex tasks` - Get, list, and delete tasks
- `agentex secrets` - Sync, get, list, and delete secrets
- `agentex uv` - UV wrapper with AgentEx-specific enhancements
- `agentex init` - Initialize new agent projects
Expand Down Expand Up @@ -80,7 +80,7 @@ Most SDK code is auto-generated. Manual changes are preserved in:

### Key Dependencies
- `temporalio` - Temporal workflow engine
- `typer` - CLI framework
- `typer` - CLI framework
- `pydantic` - Data validation
- `httpx` - HTTP client
- `fastapi` - Web framework
Expand All @@ -89,5 +89,5 @@ Most SDK code is auto-generated. Manual changes are preserved in:

### Environment Requirements
- Python 3.12+ required
- Uses Rye for dependency management
- Supports both sync and async client patterns
- Uses uv for dependency management
- Supports both sync and async client patterns
28 changes: 13 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
## Setting up the environment

### With Rye
### With uv

We use [Rye](https://rye.astral.sh/) to manage dependencies because it will automatically provision a Python environment with the expected Python version. To set it up, run:
We use [uv](https://docs.astral.sh/uv/) to manage dependencies because it will automatically provision a Python environment with the expected Python version. To set it up, run:

```sh
$ ./scripts/bootstrap
```

Or [install Rye manually](https://rye.astral.sh/guide/installation/) and run:
Or [install uv](https://docs.astral.sh/uv/getting-started/installation/) and run:

```sh
$ rye sync --all-features
$ uv sync --all-groups
```

You can then run scripts using `rye run python script.py` or by activating the virtual environment:
You can then run scripts using `uv run python script.py` or by activating the virtual environment:

```sh
# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
$ source .venv/bin/activate

# now you can omit the `rye run` prefix
# now you can omit the `uv run` prefix
$ python script.py
```

### Without Rye
### Without uv

Alternatively if you don't want to install `Rye`, you can stick with the standard `pip` setup by ensuring you have the Python version specified in `.python-version`, create a virtual environment however you desire and then install dependencies using this command:
Alternatively if you don't want to install `uv`, you can stick with the standard `pip` setup by ensuring you have the Python version specified in `.python-version`, create a virtual environment however you desire and then install dependencies using this command:

```sh
$ pip install -r requirements-dev.lock
$ pip install -e ".[dev]"
```

## Modifying/Adding code
Expand All @@ -45,7 +45,7 @@ All files in the `examples/` directory are not modified by the generator and can
```py
# add an example to examples/<your-example>.py

#!/usr/bin/env -S rye run python
#!/usr/bin/env -S uv run python
```

Expand All @@ -57,7 +57,7 @@ $ ./examples/<your-example>.py

## Using the repository from source

If youd like to use the repository from source, you can either install from git or link to a cloned repository:
If you'd like to use the repository from source, you can either install from git or link to a cloned repository:

To install via git:

Expand All @@ -72,7 +72,7 @@ Building this package will create two files in the `dist/` directory, a `.tar.gz
To create a distributable version of the library, all you have to do is run this command:

```sh
$ rye build
$ uv build
# or
$ python -m build
```
Expand All @@ -98,8 +98,7 @@ $ ./scripts/test

## Linting and formatting

This repository uses [ruff](https://github.com/astral-sh/ruff) and
[black](https://github.com/psf/black) to format the code in the repository.
This repository uses [ruff](https://github.com/astral-sh/ruff) to format and lint the code in the repository.

To lint:

Expand Down Expand Up @@ -130,4 +129,3 @@ the environment.
## 🤖 **Vibe Coding Setup**

This repository is setup with some pre-canned prompts for [Claude Code](https://docs.anthropic.com/en/docs/claude-code) as well as [Cursor](https://cursor.com/).

4 changes: 2 additions & 2 deletions bin/publish-pypi
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

set -eux
mkdir -p dist
rye build --clean
rye publish --yes --token=$PYPI_TOKEN
uv build --clean
uv publish --token $PYPI_TOKEN
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ subagents = {

```bash
# Install
rye sync --all-features
uv sync --all-groups

# Configure
export ANTHROPIC_API_KEY="your-key"
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorials/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ uv run python hello_acp.py

```bash
# Format tutorial code (always scope to specific files you're modifying)
rye run format examples/tutorials/00_sync/000_hello_acp/
uv run ruff format examples/tutorials/00_sync/000_hello_acp/

# Run all async tutorial tests
cd examples/tutorials
Expand Down
Loading
Loading