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

Separate dependency for each layer using a separate requirements.txt file

Aperta
#13,384 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
aws, fastapi, python
Ambito
backend, cloud

Direzione di ricerca

Inizia esaminando la gestione integrata di layer: true da parte di serverless-python-requirements e il modo in cui vengono configurate le dipendenze dei layer. Riproduci l'esempio con tre layer usando file delle dipendenze separati per ulid, pydantic e FastAPI. Il lavoro è completato quando ogni layer configurato contiene solo le dipendenze previste e i test coprono il comportamento del packaging.

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

Descrizione

Is there an existing issue for this?
  • I have searched existing issues, it hasn't been reported yet
Use case description

Hello everyone.

After incorporating serverless-python-requirements into the framework, I encountered a problem: there's no way to create separate layers, each with its own dependencies.

Let's say I have three functions:

cognito_post_confirmation - it only needs pydantic
cognito_post_authentication - it only needs ulid
shop - it needs FastAPI, meaning it will automatically install pydantic

To keep size of functions small and uptimize coldstart, my idea was to create three layers:

clear - for functions with minimal packages - only ulid
pydantic - for functions that only require pydantic
fastapi - for functions that require FastaAPI

and I'll include these layers in the corresponding functions.

As far as I know, the serverless-python-requirements plugin allows you to set dependencies for layers. However, in new versions of the serverless framework, it has been integrated into the framework, and now the "layer: true" parameter builds a single dependency layer, uniform for all. Question:

  1. Am I misunderstanding something?
  2. Is there another way to set a separate dependency for each layer using a separate requirements.txt file?
Proposed solution (optional)

No response

Lingua principale
JavaScript
Stelle
46.9k
Fork
5.7k
Merge medio
12h 57m
PR unite (30g)
61

Guida per i contributori

Apri la guida per i contributori

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 serverless/serverless

Tutte le issue di serverless/serverless

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.