Feature request: Add support for pyproject.toml
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
- 領域
- build-system
調査の方向性
まず、既存の python_pip builder と、requirements.txt と setup.py の間で現在 sam build が行っている選択を確認します。pyproject.toml がどのように builder を選択できるか、また Poetry や Flit などの build-backend の値が依存関係のインストールをどのように決定するかを追跡します。pyproject.toml が認識され、requirements を手動で export しなくても functions が build できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 381
- フォーク
- 164
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
aws/aws-lambda-builders のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
aws/aws-lambda-builders#925 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
aws/aws-lambda-builders#933 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 64/100
aws/aws-lambda-builders#924 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Bug: PythonUvBuilder fails to build app with dependencies on editable installs in the workspaceオープンstage/needs-triage
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
aws/aws-lambda-builders#892 ·
メンテナーはふだん 2 日以内に返信
-
stage/needs-triage type/feature
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
aws/aws-lambda-builders#839 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
aws/aws-lambda-builders の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
letsencrypt/cp-cps#353 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
PedestrianDynamics/pyFDS-Evac#394 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
DOI-USGS/pywatershed#421 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
python-pillow/Pillow#10087 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信