Skip to content

Commit 0322ee3

Browse files
committed
docs update for UV
1 parent 698d3c6 commit 0322ee3

File tree

1 file changed

+100
-1
lines changed

1 file changed

+100
-1
lines changed

README.md

Lines changed: 100 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ SPDX-License-Identifier: MIT-0
1313
- [Quick Start](#quick-start)
1414
- [Processing Your First Document](#processing-your-first-document)
1515
- [Updating an Existing Deployment](#updating-an-existing-deployment)
16+
- [Dependency Management with UV](#dependency-management-with-uv)
17+
- [Quick Start with UV](#quick-start-with-uv)
18+
- [Working with Dependencies](#working-with-dependencies)
19+
- [Lambda Function Dependencies](#lambda-function-dependencies)
20+
- [Development Workflows](#development-workflows)
21+
- [Publishing and Deployment](#publishing-and-deployment)
1622
- [Detailed Documentation](#detailed-documentation)
1723
- [Core Documentation](#core-documentation)
1824
- [Processing Patterns](#processing-patterns)
@@ -99,7 +105,10 @@ After deployment, choose the processing method that fits your use case:
99105
For batch processing, automation, or evaluation workflows:
100106

101107
```bash
102-
# Install CLI
108+
# Install CLI (with UV - recommended)
109+
cd idp_cli && uv sync
110+
111+
# Or with pip
103112
cd idp_cli && pip install -e .
104113

105114
# Process documents
@@ -149,6 +158,96 @@ For testing, use these sample files:
149158

150159
For detailed deployment and testing instructions, see the [Deployment Guide](./docs/deployment.md).
151160

161+
## Dependency Management with UV
162+
163+
This project uses [UV](https://github.com/astral-sh/uv) for fast, reliable Python dependency management. UV provides deterministic builds, improved caching, and significantly faster installation times compared to traditional pip.
164+
165+
### Quick Start with UV
166+
167+
```bash
168+
# Install UV (if not already installed)
169+
curl -LsSf https://astral.sh/uv/install.sh | sh
170+
171+
# Install all dependencies
172+
uv sync
173+
174+
# Activate the virtual environment
175+
source .venv/bin/activate # On macOS/Linux
176+
# or
177+
.venv\Scripts\activate # On Windows
178+
```
179+
180+
### Working with Dependencies
181+
182+
The project uses a centralized dependency management system:
183+
184+
- **`pyproject.toml`** - Root project configuration with 20+ dependency groups for different Lambda functions
185+
- **`uv.lock`** - Lockfile with 234+ resolved packages for reproducible builds
186+
- **Dependency Groups** - Organized by Lambda function (e.g., `lambda-ocr`, `lambda-extraction`, `lambda-classification`)
187+
188+
#### Common Commands
189+
190+
```bash
191+
# Add a new dependency to a specific group
192+
uv add --group lambda-ocr boto3
193+
194+
# Update all dependencies
195+
uv lock --upgrade
196+
197+
# Install a specific dependency group
198+
uv sync --group lambda-ocr
199+
200+
# Build for deployment (used by SAM)
201+
uv pip install --project . --group lambda-extraction --target ./build
202+
```
203+
204+
### Lambda Function Dependencies
205+
206+
Each Lambda function uses a specific dependency group defined in `pyproject.toml`:
207+
208+
```toml
209+
[dependency-groups]
210+
lambda-ocr = ["boto3", "idp-common", "pillow", ...]
211+
lambda-extraction = ["boto3", "idp-common", "anthropic", ...]
212+
lambda-classification = ["boto3", "idp-common", "pydantic", ...]
213+
```
214+
215+
SAM automatically uses UV to build Lambda functions via Makefiles in each function directory. See [Lambda Dependency Groups](./docs/lambda-dependency-groups.md) for the complete dependency mapping.
216+
217+
### Development Workflows
218+
219+
```bash
220+
# For local development
221+
uv sync # Install all dependencies
222+
223+
# For notebook development
224+
uv sync --group notebooks # Install with Jupyter dependencies
225+
226+
# For CLI development
227+
cd idp_cli && uv sync # Install CLI dependencies
228+
229+
# For testing
230+
uv sync --group dev # Install with test dependencies
231+
pytest
232+
```
233+
234+
### Publishing and Deployment
235+
236+
The publish script automatically validates UV is installed:
237+
238+
```bash
239+
# Publish with parallel builds (faster with UV!)
240+
./publish.sh my-bucket prefix us-east-1 --max-workers 4
241+
242+
# UV enables safe parallel builds with built-in locking
243+
# Typical speedup: 4x faster than sequential builds
244+
```
245+
246+
For more details on the UV migration and dependency management, see:
247+
- [Setup Development Environment (macOS)](./docs/setup-development-env-macos.md)
248+
- [Setup Development Environment (Linux)](./docs/setup-development-env-linux.md)
249+
- [Setup Development Environment (WSL)](./docs/setup-development-env-WSL.md)
250+
- [Lambda Dependency Groups](./docs/lambda-dependency-groups.md)
152251

153252
## Detailed Documentation
154253

0 commit comments

Comments
 (0)