Bug: PythonUvBuilder resolves local requirements from the caller directory
維護者通常 6 天內回覆
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 78/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- python
- 領域
- build-system
研究方向
從 aws_lambda_builders.workflows.python_uv.packager 中的 PythonUvDependencyBuilder.build_dependencies 開始,接著比較 requirements 建置路徑與提供工作目錄的 pyproject 建置路徑。使用 issue 中描述的本機 wheel 和 requirements.txt,從函式目錄外執行建置以重現問題。完成標準是 wheel 相對於清單解析,且其模組寫入指定的成品目錄。
由索引模型根據 Issue 內容生成。
描述
Description
PythonUvBuilder resolves relative wheel and local package paths in a requirements manifest against the process working directory, rather than the manifest directory. A function with a vendored wheel therefore fails when built from its parent directory. The pyproject build path already supplies a working directory to uv; the requirements build path does not.
Steps to reproduce
With aws-lambda-builders 1.68.0 and uv installed, run this from outside the temporary function directory:
from pathlib import Path
from tempfile import TemporaryDirectory
from zipfile import ZipFile
from aws_lambda_builders.workflows.python_uv.packager import PythonUvDependencyBuilder
with TemporaryDirectory() as directory:
root = Path(directory)
app = root / "function"
app.mkdir()
wheel = app / "local_demo-1.0.0-py3-none-any.whl"
with ZipFile(wheel, "w") as archive:
archive.writestr("local_demo.py", "VALUE = 42\n")
archive.writestr("local_demo-1.0.0.dist-info/METADATA",
"Metadata-Version: 2.1\nName: local-demo\nVersion: 1.0.0\n")
archive.writestr("local_demo-1.0.0.dist-info/WHEEL",
"Wheel-Version: 1.0\nRoot-Is-Purelib: true\nTag: py3-none-any\n")
archive.writestr("local_demo-1.0.0.dist-info/RECORD", "")
manifest = app / "requirements.txt"
manifest.write_text(f"./{wheel.name}\n", encoding="utf-8")
target, scratch = root / "artifacts", root / "scratch"
target.mkdir()
scratch.mkdir()
PythonUvDependencyBuilder(runtime="python3.13").build_dependencies(
str(target), str(scratch), str(manifest)
)
Observed result
UvBuildError: ... UV pip install failed: ... Distribution not found at: file:///<caller-directory>/local_demo-1.0.0-py3-none-any.whl
The wheel exists in function/; it is looked up outside that directory. This also reproduces through LambdaBuilder.build() with either absolute or relative build paths.
Expected result
Install the local wheel from the requirements manifest's directory and write its module into the requested artifact directory, independently of the caller's working directory.
Environment
- Windows, Python 3.13.3, uv 0.11.26
- aws-lambda-builders 1.68.0, develop commit
e3e14536501e38b0d6d8db582ddec6d0e0bd6f8a - Reproduction uses a local wheel only; no AWS account or package index is needed.
I checked the open and closed issue/PR history. #887 addresses workspace-root discovery for pyproject builds; this reproduction uses only requirements.txt and no workspace.
- 主要語言
- Python
- 星號
- 381
- 分支
- 161
- 平均合併
- 5 天 14 小時
- 30 天內合併 PR
- 3
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
aws/aws-lambda-builders 的其他 Issue
-
python_uv: `UvConfig.compile_bytecode` is never passed to uv, so the option has no effect可能已有人在做 @xujiantop-crypto 於 52 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
aws/aws-lambda-builders#925 · 1 個 reaction ·
維護者通常 6 天內回覆
-
Bug: PythonUvBuilder does not target Lambda manylinux compatibility可能已有人在做 @vinsymoyya 於 2 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 70/100
aws/aws-lambda-builders#955 · 1 則留言 ·
維護者通常 6 天內回覆
-
Bytecode compiled during build is always discarded at runtime: SAM packaging writes 1980 timestamps, so timestamp-based .pyc never validate可能已有人在做 @xujiantop-crypto 於 52 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 64/100
aws/aws-lambda-builders#924 · 1 則留言 · 1 個 reaction ·
維護者通常 6 天內回覆
-
Bug: PythonUvBuilder fails to build app with dependencies on editable installs in the workspace可能已有人在做 @noritada 於 121 天前認領。 未關閉stage/needs-triage
難度 3/5 1-2 天 新手友好度 25/100
aws/aws-lambda-builders#892 ·
維護者通常 6 天內回覆
-
Feature request: Add native uv support and configuration可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉stage/needs-triage type/feature
難度 4/5 3-5 天 新手友好度 38/100
aws/aws-lambda-builders#839 · 3 則留言 · 1 個 reaction ·
維護者通常 6 天內回覆
查看 aws/aws-lambda-builders 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 84/100
pylint-dev/pylint#11791 ·
維護者通常 1 天內回覆
-
Rasterio granule reads never retry, so one 503 (Service Unavailable) fails the whole request可能已有人在做 @chuckwondo 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 75/100
developmentseed/titiler-cmr#305 ·
維護者通常 1 天內回覆
-
community enhancement
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 86/100
維護者通常 1 天內回覆