Skip to content

Commit f51e105

Browse files
authored
Merge branch 'aws:develop' into feat/use-durable-functions-emulator-image
2 parents 9eaa5fe + 937358c commit f51e105

65 files changed

Lines changed: 1590 additions & 1262 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ updates:
1313
open-pull-requests-limit: 10
1414

1515
- package-ecosystem: "pip"
16-
directory: "/requirements"
16+
directory: "/"
1717
schedule:
1818
interval: "daily"
1919
target-branch: "develop"
@@ -26,11 +26,12 @@ updates:
2626
groups:
2727
boto:
2828
patterns:
29-
- "boto3"
29+
- "boto3[crt]"
3030
- "boto3-stubs*"
31-
- "botocore"
31+
- "botocore[crt]"
3232
- "botocore-stubs"
3333
- "mypy-boto3-*"
34+
- "types-awscrt"
3435
types:
3536
patterns:
3637
- "types-*"

.github/workflows/automated-updates-to-sam-cli.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ jobs:
108108
echo "SAM-T cur version is $SAM_T_CUR_VERSION"
109109
cd ../aws-sam-cli
110110
git checkout -b update_sam_transform_version
111-
SAM_T_PRE_VERSION=$(grep "aws-sam-translator=" requirements/base.txt)
111+
SAM_T_PRE_VERSION=$(grep -oP 'aws-sam-translator==\K[0-9.]+' pyproject.toml)
112112
echo "SAM-T pre version is $SAM_T_PRE_VERSION"
113113
git reset --hard develop
114-
sed -i "s/$SAM_T_PRE_VERSION/aws-sam-translator==$SAM_T_CUR_VERSION/g" requirements/base.txt
114+
sed -i "s/aws-sam-translator==$SAM_T_PRE_VERSION/aws-sam-translator==$SAM_T_CUR_VERSION/g" pyproject.toml
115115
cp -r ../serverless-application-model/tests/translator/input ./tests/functional/commands/validate/lib/models
116-
make update-reproducible-reqs-uv
116+
make update-reproducible-reqs
117117
git status
118118
git diff --quiet && exit 0 # exit if there is no change
119119
echo "is_new_sam_t=1" >> $GITHUB_ENV # set env variable for next step run decision
@@ -177,11 +177,11 @@ jobs:
177177
echo "Lambda Builders cur version is $BUILDERS_CUR_VERSION"
178178
cd ../aws-sam-cli
179179
git checkout -b update_lambda_builders_version
180-
BUILDERS_PRE_VERSION=$(grep "aws_lambda_builders=" requirements/base.txt)
180+
BUILDERS_PRE_VERSION=$(grep -oP 'aws_lambda_builders==\K[0-9.]+' pyproject.toml)
181181
echo "Lambda Builders pre version is $BUILDERS_PRE_VERSION"
182182
git reset --hard develop
183-
sed -i "s/$BUILDERS_PRE_VERSION/aws_lambda_builders==$BUILDERS_CUR_VERSION/g" requirements/base.txt
184-
make update-reproducible-reqs-uv
183+
sed -i "s/aws_lambda_builders==$BUILDERS_PRE_VERSION/aws_lambda_builders==$BUILDERS_CUR_VERSION/g" pyproject.toml
184+
make update-reproducible-reqs
185185
git status
186186
git diff --quiet && exit 0 # exit if there is no change
187187
echo "is_new_lambda_builders=1" >> $GITHUB_ENV # set env variable for next step run decision

.github/workflows/build.yml

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
- ubuntu-latest
5656
- windows-latest
5757
python:
58-
- "3.9"
58+
- "3.10"
5959
- "3.11"
6060
steps:
6161
# This allows temp file creation on drive D, which won't trigger windows defender scan and leads to faster IO
@@ -65,10 +65,13 @@ jobs:
6565
echo "TEMP=D:\\Temp" >> $env:GITHUB_ENV
6666
if: ${{ matrix.os == 'windows-latest' }}
6767
- uses: actions/checkout@v6
68-
- uses: actions/setup-python@v6
68+
- uses: astral-sh/setup-uv@v7
6969
with:
7070
python-version: ${{ matrix.python }}
71-
- uses: astral-sh/setup-uv@v7
71+
cache-python: false
72+
- name: Install and activate Python
73+
run: bash tests/setup-python-uv.sh ${{ matrix.python }}
74+
shell: bash
7275
- run: test -f "./.github/ISSUE_TEMPLATE/Bug_report.md" # prevent Bug_report.md from being renamed or deleted
7376
- run: make pr
7477

@@ -81,10 +84,12 @@ jobs:
8184
runs-on: ubuntu-latest
8285
steps:
8386
- uses: actions/checkout@v6
84-
- uses: actions/setup-python@v6
85-
name: Install Python 3.11
87+
- uses: astral-sh/setup-uv@v7
8688
with:
87-
python-version: 3.11
89+
python-version: "3.11"
90+
cache-python: false
91+
- name: Install and activate Python
92+
run: bash tests/setup-python-uv.sh 3.11
8893
- run: make init
8994
- run: |
9095
diff <( cat schema/samcli.json ) <( python -m schema.make_schema && cat schema/samcli.json ) && \
@@ -116,7 +121,7 @@ jobs:
116121
- ubuntu-latest
117122
- windows-latest
118123
python:
119-
- "3.9"
124+
- "3.10"
120125
- "3.11"
121126
# folders that is commented below requires credentials, no need to spare time to run them
122127
tests_config:
@@ -152,18 +157,12 @@ jobs:
152157
mkdir "D:\\Temp"
153158
echo "TEMP=D:\\Temp" >> $env:GITHUB_ENV
154159
if: ${{ matrix.os == 'windows-latest' }}
155-
- uses: actions/setup-python@v6
160+
- uses: astral-sh/setup-uv@v7
156161
with:
157-
# set last version as the one in matrix to make it default
158-
python-version: |
159-
3.9
160-
3.10
161-
3.11
162-
3.12
163-
3.13
164-
3.14
165-
${{ matrix.python }}
166-
cache: 'pip'
162+
python-version: ${{ matrix.python }}
163+
cache-python: false
164+
- name: Install Python versions
165+
run: bash tests/setup-python-uv.sh 3.9 3.10 3.11 3.12 3.13 3.14 ${{ matrix.python }}
167166
- uses: actions/setup-go@v6
168167
with:
169168
go-version: '1.19'
@@ -188,11 +187,11 @@ jobs:
188187
# Install and configure Rust & Cargo Lambda
189188
- name: Install Rust toolchain and cargo-lambda
190189
if: ${{ matrix.os == 'ubuntu-latest' }}
191-
run: bash tests/install-rust.sh
190+
run: bash tests/install-rust.sh --uv
192191
- name: Init samdev
193192
run: make init
194193
- name: uv install setuptools in Python3.12
195-
run: uv pip install --system --python python3.12 --upgrade pip setuptools
194+
run: uv pip install --break-system-packages --python "$(uv python find 3.12)" --upgrade pip setuptools
196195
- name: Run integration tests for ${{ matrix.tests_config.name }}
197196
run: pytest -vv ${{ matrix.tests_config.params }}
198197
env:
@@ -213,7 +212,7 @@ jobs:
213212
fail-fast: false
214213
matrix:
215214
python:
216-
- "3.9"
215+
- "3.10"
217216
- "3.11"
218217
tests_config:
219218
- name: "Smoke & Functional Tests - All"
@@ -239,10 +238,12 @@ jobs:
239238
mkdir "D:\\Temp"
240239
echo "TEMP=D:\\Temp" >> $env:GITHUB_ENV
241240
if: ${{ matrix.os == 'windows-latest' }}
242-
- uses: actions/setup-python@v6
241+
- uses: astral-sh/setup-uv@v7
243242
with:
244243
python-version: ${{ matrix.python }}
245-
cache: 'pip'
244+
cache-python: false
245+
- name: Install and activate Python
246+
run: bash tests/setup-python-uv.sh ${{ matrix.python }}
246247
- name: Init samdev
247248
run: make init
248249
- name: Run ${{ matrix.tests_config.name }}
@@ -269,16 +270,13 @@ jobs:
269270
mkdir "D:\\Temp"
270271
echo "TEMP=D:\\Temp" >> $env:GITHUB_ENV
271272
if: ${{ matrix.os == 'windows-latest' }}
272-
- uses: actions/setup-python@v6
273+
- uses: astral-sh/setup-uv@v7
273274
with:
274-
# These are the versions of Python that correspond to the supported Lambda runtimes
275-
python-version: |
276-
3.14
277-
3.9
278-
3.10
279-
3.11
280-
3.12
281-
3.13
275+
python-version: "3.10"
276+
cache-python: false
277+
- name: Install Python versions
278+
shell: bash
279+
run: bash tests/setup-python-uv.sh 3.9 3.10 3.11 3.12 3.13 3.14
282280
- name: Stop Docker Linux
283281
if: ${{ matrix.os == 'ubuntu-latest' }}
284282
run: |
@@ -292,7 +290,7 @@ jobs:
292290
- name: Init samdev
293291
run: make init
294292
- name: uv install setuptools in Python3.12
295-
run: uv pip install --system --python python3.12 --upgrade pip setuptools
293+
run: uv pip install --break-system-packages --python "$(uv python find 3.12)" --upgrade pip setuptools
296294
- name: Check Docker not Running
297295
run: docker info
298296
id: run-docker-info

.github/workflows/integration-tests.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ on:
66
# This translates to Tuesday-Saturday 3am UTC
77
- cron: '0 3 * * 2-6'
88
release:
9-
types: [published, edited]
10-
# published → latest-release binary test (full releases only)
11-
# edited + prereleasenightly binary test (nightly pre-release gets edited with new artifacts)
9+
types: [published]
10+
# prerelease published → nightly binary test
11+
# full release publishedlatest-release binary test
1212
workflow_dispatch: # Allow manual triggering
1313
# NOTE: This workflow can only be manually triggered from develop or main branches
1414
# The other branch will not pass the OIDC permission check
@@ -79,10 +79,27 @@ jobs:
7979
- tier1-finch
8080

8181
steps:
82+
- name: Determine test type
83+
run: |
84+
echo "CONTAINER_RUNTIME=${{ matrix.test_suite == 'tier1-finch' && 'finch' || 'docker' }}" >> $GITHUB_ENV
85+
if [[ "${{ inputs.install_mode }}" == "nightly-release" ]] || \
86+
[[ "${{ github.event.action }}" == "published" && "${{ github.event.release.prerelease }}" == "true" ]]; then
87+
echo "TEST_TYPE=nightly-release" >> $GITHUB_ENV
88+
elif [[ "${{ inputs.install_mode }}" == "latest-release" ]] || \
89+
[[ "${{ github.event.action }}" == "published" && "${{ github.event.release.prerelease }}" != "true" ]]; then
90+
echo "TEST_TYPE=latest-release" >> $GITHUB_ENV
91+
elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
92+
echo "TEST_TYPE=master" >> $GITHUB_ENV
93+
elif [[ "${{ github.event_name }}" == "schedule" ]] || [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
94+
echo "TEST_TYPE=develop" >> $GITHUB_ENV
95+
else
96+
echo "TEST_TYPE=other" >> $GITHUB_ENV
97+
fi
98+
8299
- name: Checkout code
83100
uses: actions/checkout@v6
84101
with:
85-
ref: ${{ github.event_name == 'schedule' && 'develop' || github.ref }}
102+
ref: ${{ env.TEST_TYPE == 'nightly-release' && 'nightly-builds' || (github.event_name == 'schedule' && 'develop' || github.ref) }}
86103

87104
- name: Free up disk space
88105
run: bash tests/free_disk_space.sh
@@ -196,23 +213,6 @@ jobs:
196213
if: "!contains(fromJSON('[\"build-x86-1\", \"build-x86-2\", \"build-x86-container-1\", \"build-x86-container-2\", \"tier1-finch\"]'), matrix.test_suite)"
197214
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
198215

199-
- name: Determine test type
200-
run: |
201-
echo "CONTAINER_RUNTIME=${{ matrix.test_suite == 'tier1-finch' && 'finch' || 'docker' }}" >> $GITHUB_ENV
202-
if [[ "${{ inputs.install_mode }}" == "nightly-release" ]] || \
203-
[[ "${{ github.event.action }}" == "edited" && "${{ github.event.release.prerelease }}" == "true" ]]; then
204-
echo "TEST_TYPE=nightly-release" >> $GITHUB_ENV
205-
elif [[ "${{ inputs.install_mode }}" == "latest-release" ]] || \
206-
[[ "${{ github.event.action }}" == "published" && "${{ github.event.release.prerelease }}" != "true" ]]; then
207-
echo "TEST_TYPE=latest-release" >> $GITHUB_ENV
208-
elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
209-
echo "TEST_TYPE=master" >> $GITHUB_ENV
210-
elif [[ "${{ github.event_name }}" == "schedule" ]] || [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
211-
echo "TEST_TYPE=develop" >> $GITHUB_ENV
212-
else
213-
echo "TEST_TYPE=other" >> $GITHUB_ENV
214-
fi
215-
216216
- name: Initialize integration test
217217
if: env.TEST_TYPE == 'develop' || env.TEST_TYPE == 'master' || env.TEST_TYPE == 'other'
218218
run: |

.github/workflows/sync-to-mirror-repo.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,7 @@ jobs:
2222

2323
- name: Push to mirror repo
2424
run: |
25-
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
25+
git config user.name "aws-sam-cli-bot"
26+
git config user.email "aws-sam-cli-gh-bot@amazon.com"
27+
git remote set-url origin https://x-access-token:${{ secrets.SYNC_REPO_PAT }}@github.com/${{ github.repository }}.git
2628
git push origin develop:develop --force

.github/workflows/update-reproducibles.yml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,24 @@ on:
44
branches: [develop]
55
paths:
66
# run this GHA if the following files have changed
7-
- requirements/base.txt
7+
- pyproject.toml
88
- requirements/reproducible-linux.txt
99
- requirements/reproducible-mac.txt
1010
- requirements/reproducible-win.txt
1111

1212
jobs:
13+
# For PRs from within the aws/aws-sam-cli repo: auto-update and push
1314
update-reqs:
1415
permissions:
1516
pull-requests: write
1617
contents: write
17-
if: github.repository_owner == 'aws'
18+
if: github.repository_owner == 'aws' && github.event.pull_request.head.repo.full_name == github.repository
1819
runs-on: ubuntu-latest
1920
steps:
2021
- uses: actions/checkout@v6
2122
with:
2223
ref: ${{ github.head_ref }}
24+
token: ${{ secrets.GITHUB_TOKEN }}
2325
- uses: actions/setup-python@v6
2426
with:
2527
python-version: "3.11"
@@ -31,7 +33,27 @@ jobs:
3133
run: |
3234
git config --global user.email "action@github.com"
3335
git config --global user.name "GitHub Action"
34-
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
3536
git add requirements/reproducible-*.txt
3637
git commit -m "Update reproducible requirements" || echo "nothing to commit"
37-
git push
38+
git push
39+
40+
# For PRs from forks: verify requirements are up to date, fail with instructions if not
41+
verify-up-to-date:
42+
if: github.repository_owner == 'aws' && github.event.pull_request.head.repo.full_name != github.repository
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v6
46+
- uses: actions/setup-python@v6
47+
with:
48+
python-version: "3.11"
49+
- name: Install uv
50+
uses: astral-sh/setup-uv@v7
51+
- name: Check reproducible requirements are up to date
52+
run: make update-reproducible-reqs-uv
53+
- name: Fail if requirements are out of date
54+
run: |
55+
if ! git diff --quiet requirements/reproducible-*.txt; then
56+
echo "::error::Reproducible requirements are out of date. Please run 'make update-reproducible-reqs' locally and commit the changes before raising a PR."
57+
exit 1
58+
fi
59+
echo "Reproducible requirements are up to date."

DEVELOPMENT_GUIDE.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ all changes you make to the SAM Transformer locally are immediately picked up fo
152152
pip install -e .
153153
```
154154

155-
Move back to your SAM CLI directory and re-run init, If necessary: open requirements/base.txt and replace the version number of aws-sam-translator with the ``version number`` specified in your local version of `serverless-application-model/samtranslator/__init__.py`
155+
Move back to your SAM CLI directory and re-run init, If necessary: open `pyproject.toml` and replace the version number of `aws-sam-translator` in the `[project].dependencies` list with the ``version number`` specified in your local version of `serverless-application-model/samtranslator/__init__.py`
156156

157157
```sh
158158
# Make sure you are back to your SAM CLI directory
@@ -341,23 +341,20 @@ conventions are best practices that we have learnt over time.
341341

342342
### Dependency Updates
343343

344-
Please update all the required files if the changes involve a version update on a dependency or to include a new dependency. The requirements files are located inside the `requirements` folder.
344+
Please update all the required files if the changes involve a version update on a dependency or to include a new dependency.
345345

346-
#### base.txt for SAM CLI code dependencies
347-
For dependencies used in SAM CLI code, update `base.txt` in `requirements` folder. To update `base.txt` file, simply follow the current convention and input the dependency name plus version, together with any necessary comment. For more information on the operators to be used for restricting compatible versions, read on [python's enhancement proposals](https://peps.python.org/pep-0440/#compatible-release).
346+
#### pyproject.toml for SAM CLI code dependencies
347+
All runtime and development dependencies are declared in `pyproject.toml` at the project root. Runtime dependencies go in `[project].dependencies` and test/dev dependencies go in `[project.optional-dependencies].dev`. Simply follow the current convention and input the dependency name plus version, together with any necessary comment. For more information on the operators to be used for restricting compatible versions, read on [python's enhancement proposals](https://peps.python.org/pep-0440/#compatible-release).
348348

349349
#### reproducible-linux.txt for SAM CLI code dependencies
350-
For dependencies used in SAM CLI code, also remember to update`reproducible-linux.txt` in `requirements` folder and `THIRD-PARTY-LICENSES` in `installer/assets` folder. To update the `reproducible-linux.txt`, run the following script to replace the file:
350+
For dependencies used in SAM CLI code, also remember to update `reproducible-linux.txt` in `requirements` folder and `THIRD-PARTY-LICENSES` in `installer/assets` folder. To update the reproducible requirements, run the following script to regenerate the files:
351351
```
352352
make update-reproducible-reqs
353353
```
354-
Note that this is a fully auto-generated file, any manual changes to reproducible-linux.txt will not last after the next update running the above script. As for updating the `THIRD-PARTY-LICENSES`, find the corresponding dependency entry in the license file (usually grouped by licensing organization) and update the versions. For adding a new dependency, look up for its licensing organization through PyPi and update the corresponding section. If the license is from GNU or another license type not included in the file, please contact the repository maintainers first. If you are not familiar with working with this file, please contact one of the repository maintainers or cut an issue to help with the update.
355-
356-
#### dev.txt for SAM CLI test dependencies
357-
For changing dependencies used for `make pr` checks and test related dependencies, update `dev.txt` in `requirements` folder only.
354+
Note that these are fully auto-generated files, any manual changes to reproducible-*.txt will not last after the next update running the above script. As for updating the `THIRD-PARTY-LICENSES`, find the corresponding dependency entry in the license file (usually grouped by licensing organization) and update the versions. For adding a new dependency, look up for its licensing organization through PyPi and update the corresponding section. If the license is from GNU or another license type not included in the file, please contact the repository maintainers first. If you are not familiar with working with this file, please contact one of the repository maintainers or cut an issue to help with the update.
358355

359356
#### pyinstaller-build.txt for SAM CLI native installer build dependencies
360-
For changing Python dependencies needed for creating builds through Pyinstaller (to run `build-mac.sh` or `build-linux.sh` in `installer/pyinstaller` folder), modify `pyinstaller-build.txt`.
357+
For changing Python dependencies needed for creating builds through Pyinstaller (to run `build-mac.sh` or `build-linux.sh` in `installer/pyinstaller` folder), modify `pyinstaller-build.txt` in the `requirements` folder.
361358

362359

363360
### Our Testing Practices

MANIFEST.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
include LICENSE
22
include THIRD-PARTY-LICENSES
3-
include requirements/base.txt
4-
include requirements/pre-dev.txt
5-
include requirements/dev.txt
63
recursive-include samcli *
74
prune tests
85
prune installer

0 commit comments

Comments
 (0)