Commit 5bc95fa
fix: python-uv cached build copies dependencies to the build dir
`sam build --cached` (incremental build) invokes the python-uv workflow
with a `dependencies_dir` set. Two bugs made that path fail with
`CopyDependencies - [Errno 2] No such file or directory`:
1. `PythonUvWorkflow._setup_build_actions` constructed `CopyDependenciesAction`
with `artifact_dir` and `destination_dir` swapped. Dependencies are
installed into `dependencies_dir`, so that is the source of the copy and
`artifacts_dir` the destination; as written the action listed the
not-yet-created artifacts directory and never populated it.
2. `UvRunner.install_requirements` passed `--target` through verbatim. UV runs
with `cwd` set to the project directory, so the relative
`.aws-sam/deps/<uuid>` dependencies dir was created under the source
directory instead of the build root. Resolve `--target` to an absolute
path before invoking UV.
Adds regression coverage: workflow unit test asserts the
`CopyDependenciesAction` source/artifact/dest dirs; packager unit test
asserts a relative `--target` is made absolute; the `dependencies_dir`
integration test now asserts dependencies are present in the artifacts dir.
Fixes aws#864
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent c62aade commit 5bc95fa
5 files changed
Lines changed: 35 additions & 5 deletions
File tree
- aws_lambda_builders/workflows/python_uv
- tests
- integration/workflows/python_uv
- unit/workflows/python_uv
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
140 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
147 | | - | |
148 | | - | |
| 149 | + | |
| 150 | + | |
149 | 151 | | |
150 | 152 | | |
151 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
124 | 127 | | |
125 | 128 | | |
126 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
128 | 144 | | |
129 | 145 | | |
130 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
77 | 84 | | |
78 | 85 | | |
79 | 86 | | |
| |||
0 commit comments