Bug: PythonUvBuilder resolves local requirements from the caller directory
Mantenedores costumam responder em até 6 dias
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 78/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- python
- Domínio
- build-system
Direção de pesquisa
Comece em aws_lambda_builders.workflows.python_uv.packager, em PythonUvDependencyBuilder.build_dependencies, e depois compare o caminho de build de requirements com o caminho de build de pyproject, que fornece um diretório de trabalho. Reproduza o problema com o wheel local e requirements.txt descritos na issue, executando o build de fora do diretório da função. O objetivo é que o wheel seja resolvido em relação ao manifesto e que seu módulo seja gravado no diretório de artefatos solicitado.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Python
- Estrelas
- 381
- Forks
- 161
- Merge médio
- 5d 14h
- PRs com merge (30d)
- 3
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de aws/aws-lambda-builders
-
python_uv: `UvConfig.compile_bytecode` is never passed to uv, so the option has no effectTalvez já em andamento @xujiantop-crypto assumiu há 51 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
aws/aws-lambda-builders#925 · 1 reação ·
Mantenedores costumam responder em até 6 dias
-
Bug: PythonUvBuilder does not target Lambda manylinux compatibilityTalvez já em andamento @vinsymoyya assumiu hoje. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 70/100
aws/aws-lambda-builders#955 · 1 comentário ·
Mantenedores costumam responder em até 6 dias
-
Bytecode compiled during build is always discarded at runtime: SAM packaging writes 1980 timestamps, so timestamp-based .pyc never validateTalvez já em andamento @xujiantop-crypto assumiu há 51 dias. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 64/100
aws/aws-lambda-builders#924 · 1 comentário · 1 reação ·
Mantenedores costumam responder em até 6 dias
-
Bug: PythonUvBuilder fails to build app with dependencies on editable installs in the workspaceTalvez já em andamento @noritada assumiu há 120 dias. Abertastage/needs-triage
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 25/100
aws/aws-lambda-builders#892 ·
Mantenedores costumam responder em até 6 dias
-
Feature request: Add native uv support and configurationTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertastage/needs-triage type/feature
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 38/100
aws/aws-lambda-builders#839 · 3 comentários · 1 reação ·
Mantenedores costumam responder em até 6 dias
Todas as issues de aws/aws-lambda-builders
Issues semelhantes
-
Remove the `pull_request_target` workflow before GitHub blocks itTalvez já em andamento @jat255 assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
IBM/mcp-context-forge#7483 ·
Mantenedores costumam responder em até 2 dias
-
bug good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
[Bug Report]: OpenAI 辅助 API 连通性测试因输出上限仅 1 token 误报“未知错误”Talvez já em andamento @fjfanjian assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Project-N-E-K-O/N.E.K.O#3640 ·
Mantenedores costumam responder em até 1 dia
-
author-page correction
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
acl-org/acl-anthology#10808 · 1 comentário ·
Mantenedores costumam responder em até 1 dia