Feature request: Add support for pyproject.toml
Los mantenedores suelen responder en 7 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- python
- Área
- build-system
Línea de trabajo
Comienza revisando el builder python_pip existente y la selección actual de sam build entre requirements.txt y setup.py. Sigue cómo pyproject.toml podría seleccionar un builder y cómo valores de build-backend como Poetry o Flit controlarían la instalación de dependencias; se considera terminado cuando pyproject.toml se reconoce y las funciones se compilan sin exportar requirements manualmente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe your idea/feature/enhancement
As the Python ecosystem moves towards pyproject.toml as the standard for defining build system requirements and managing dependencies, it would be highly beneficial if there was a lambda builder to recognize and handle this file natively. Using setup.py is gradually being phased out in favor of pyproject.toml which modern package managers (like Poetry) support to align with PEP 517 and PEP 518 standards.
Currently, we either have to manually export our dependencies to a requirements.txt file, or have makefile as the build method in the template.yaml where the makefile is exporting the deps to a requirement.txt before preparing the function:
# template.yaml
Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: hello_world/
Handler: app.lambda_handler
Runtime: python3.12
Metadata:
BuildMethod: makefile
build-HelloWorldFunction:
poetry export -f requirements.txt --output requirements.txt --without-hashes
pip install --target "$(ARTIFACTS_DIR)" -r requirements.txt
cp -r *.py $(ARTIFACTS_DIR)
This can be tedious when having to deal with multiple functions.
Proposal
Implement a builder, similar to python_pip that parses pyproject.toml, recognizes the build-backend defined in pyproject.toml (such as poetry or flit) and handles dependencies installation accordingly. This way when invoking sam build the existence of pyproject.toml is also taken into consideration (and not only requirements.txt and setup.py). Based on this, it should be able to select the appropriate builder to use.
- Lenguaje dominante
- Python
- Estrellas
- 381
- Forks
- 162
- Merge medio
- 1 d 1 h
- PR fusionados (30 d)
- 2
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de aws/aws-lambda-builders
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
aws/aws-lambda-builders#925 · 1 reacción ·
Los mantenedores suelen responder en 7 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 64/100
aws/aws-lambda-builders#924 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 7 días
-
Bug: PythonUvBuilder fails to build app with dependencies on editable installs in the workspaceAbiertostage/needs-triage
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
aws/aws-lambda-builders#892 ·
Los mantenedores suelen responder en 7 días
-
stage/needs-triage type/feature
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
aws/aws-lambda-builders#839 · 2 comentarios · 1 reacción ·
Los mantenedores suelen responder en 7 días
-
area/build contributors/good-first-issue contributors/welcome type/feature
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
aws/aws-lambda-builders#831 · 3 comentarios ·
Los mantenedores suelen responder en 7 días
Todos los issues de aws/aws-lambda-builders
Issues similares
-
needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
openvinotoolkit/openvino_notebooks#3665 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
docs
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
benchmark-gap
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día