Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#13,384 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@nitishagar đang làm issue này rồi.

Từ ngày 2/7/2026.

  • #13671 của @nitishagar — đang mở

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
aws, fastapi, python
Lĩnh vực
backend, cloud

Hướng nghiên cứu

Bắt đầu bằng cách xem xét việc xử lý tích hợp layer: true của serverless-python-requirements và cách các dependency của layer được cấu hình. Tái tạo ví dụ ba layer với các file dependency riêng cho ulid, pydantic và FastAPI. Được xem là hoàn tất khi mỗi layer đã cấu hình chỉ chứa các dependency dành cho nó và có các test bao quát hành vi đóng gói.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
JavaScript
Star
46.9k
Fork
5.7k
Merge trung bình
1 ngày 25 phút
Pull request đã merge (30 ngày)
65

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của serverless/serverless

Tất cả issue của serverless/serverless

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.