Commit c0163e5
feat: Python UV workflow (aws#756)
* feat: Python UV workflow
Core Features:
* Intelligent handling of pyproject.toml with automatic uv.lock detection
* Multi-format support: pyproject.toml, requirements.txt, and requirements-*.txt variants
* Lock file optimization: Automatic uv.lock usage for reproducible builds when available
* Platform targeting: Lambda-compatible builds for x86_64 and ARM64 architectures
* Python version control: Precise Python version targeting via UV's --python flags
UV Functionality:
* `uv sync --python X.Y` for lock-based builds (pyproject.toml + uv.lock)
* `uv lock && uv export` workflow for pyproject.toml without lock files
* `uv pip install --python-version X.Y --python-platform` for requirements.txt
* Proper virtual environment handling and site-packages extraction
Documentation:
* Complete DESIGN.md with architecture overview and usage patterns
* Accurate API documentation reflecting constructor + method call pattern
* Smart dispatch logic clearly explained with examples
* Updated to match actual implementation (no outdated references)
Compatibility:
* Compatible with existing Lambda Builders interface
* Supports standard build parameters (source_dir, artifacts_dir, scratch_dir)
* Runtime parameter properly extracted and used for Python version targeting
* Architecture parameter mapped to UV platform specifications
* tests: additional functional tests for python_uv
* fix(): address comments
* fix: address comments - round 2
* fix(additional tests cases): python-uv
* chore(README.md): update with python uv support
* fix: have lock file builds run in cwd
* fix: misc pr feedback
* cd: setup uv for unit tests
* nit: format
* test: remove hardcoded pathsep
---------
Co-authored-by: Roger Zhang <roger.zhang.cs@gmail.com>
Co-authored-by: Reed Hamilton <reedham@amazon.com>
Co-authored-by: vicheey <181402101+vicheey@users.noreply.github.com>1 parent 14dbe36 commit c0163e5
29 files changed
Lines changed: 3004 additions & 5 deletions
File tree
- .github/workflows
- aws_lambda_builders/workflows
- python_uv
- tests
- functional/workflows/python_uv
- integration/workflows/python_uv
- testdata
- unit/workflows/python_uv
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | | - | |
| 48 | + | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| 79 | + | |
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
| |||
248 | 251 | | |
249 | 252 | | |
250 | 253 | | |
251 | | - | |
252 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
253 | 285 | | |
254 | 286 | | |
255 | 287 | | |
| |||
274 | 306 | | |
275 | 307 | | |
276 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
277 | 314 | | |
278 | | - | |
| 315 | + | |
279 | 316 | | |
280 | 317 | | |
281 | 318 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
0 commit comments