Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Feature request: Add support for pyproject.toml

Aperta
#688 4 commenti 12 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
build-system

Direzione di ricerca

Inizia esaminando il builder python_pip esistente e la selezione attuale di sam build tra requirements.txt e setup.py. Analizza come pyproject.toml potrebbe selezionare un builder e come valori di build-backend come Poetry o Flit determinerebbero l’installazione delle dipendenze; il lavoro è completato quando pyproject.toml viene riconosciuto e le funzioni vengono compilate senza esportare manualmente requirements.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area/workflow/python_pip type/feature
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.

Lingua principale
Python
Stelle
381
Fork
162
Merge medio
1g 1h
PR unite (30g)
2

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di aws/aws-lambda-builders

Tutte le issue di aws/aws-lambda-builders

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.