Migrate to uv (#52)

* uvx migrate-to-uv

* uv migration

* Fix hatch build

* Fixup

* uv run

* Add tab completion to devcontainer uv

Co-authored-by: Simon Emms <simon@simonemms.com>

* Revert "Add tab completion to devcontainer uv"

This reverts commit a3b7bdd84b.

---------

Co-authored-by: Simon Emms <simon@simonemms.com>
This commit is contained in:
Dan Davison
2025-07-30 13:37:42 -04:00
committed by GitHub
parent 4ed4efbe83
commit 68ac9c40eb
14 changed files with 2518 additions and 3309 deletions

View File

@@ -22,8 +22,6 @@ We've provided a Makefile to simplify the setup and running of the application.
```bash
# Initial setup
make setup # Creates virtual environment and installs dependencies
make setup-venv # Creates virtual environment only
make install # Installs all dependencies
# Running the application
make run-worker # Starts the Temporal worker
@@ -159,24 +157,22 @@ Default urls:
**Python Backend**
Requires [Poetry](https://python-poetry.org/) to manage dependencies.
Requires [`uv`](https://docs.astral.sh/uv/) to manage dependencies.
1. `python -m venv venv`
1. Install uv: `curl -LsSf https://astral.sh/uv/install.sh | sh`
2. `source venv/bin/activate`
3. `poetry install`
2. `uv sync`
Run the following commands in separate terminal windows:
1. Start the Temporal worker:
```bash
poetry run python scripts/run_worker.py
uv run scripts/run_worker.py
```
2. Start the API server:
```bash
poetry run uvicorn api.main:app --reload
uv run uvicorn api.main:app --reload
```
Access the API at `/docs` to see the available endpoints.
@@ -261,7 +257,7 @@ NOTE: This goal was developed for an on-stage demo and has failure (and its reso
Required to search and book trains!
```bash
poetry run python thirdparty/train_api.py
uv run thirdparty/train_api.py
# example url
# http://localhost:8080/api/search?from=london&to=liverpool&outbound_time=2025-04-18T09:00:00&inbound_time=2025-04-20T09:00:00
@@ -273,7 +269,7 @@ poetry run python thirdparty/train_api.py
These are Python activities that fail (raise NotImplemented) to show how Temporal handles a failure. You can run these activities with.
```bash
poetry run python scripts/run_legacy_worker.py
uv run scripts/run_legacy_worker.py
```
The activity will fail and be retried infinitely. To rescue the activity (and its corresponding workflows), kill the worker and run the .NET one in the section below.
@@ -328,8 +324,8 @@ For more details, check out [adding goals and tools guide](./adding-goals-and-to
[ ] Select an LLM and add your API key to `.env` <br />
[ ] (Optional) set your starting goal and goal category in `.env` <br />
[ ] (Optional) configure your Temporal Cloud settings in `.env` <br />
[ ] `poetry run python scripts/run_worker.py` <br />
[ ] `poetry run uvicorn api.main:app --reload` <br />
[ ] `uv run scripts/run_worker.py` <br />
[ ] `uv run uvicorn api.main:app --reload` <br />
[ ] `cd frontend`, `npm install`, `npx vite` <br />
[ ] Access the UI at `http://localhost:5173` <br />