Skip to content

Commit 0c84cab

Browse files
authored
Merge branch 'develop' into dependabot/pip/develop/black-26.3.0
2 parents 4d761db + a1859d3 commit 0c84cab

55 files changed

Lines changed: 876 additions & 398 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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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/integration-tests.yml

Lines changed: 118 additions & 77 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@ init:
1313
SAM_CLI_DEV=1 pip install -e '.[dev]'; \
1414
fi
1515

16-
# Set up a pytest venv with test dependencies (without installing sam-cli itself)
16+
# Set up a pytest venv with test dependencies
17+
# Set up a pytest venv with test dependencies (cross-platform)
1718
setup-pytest:
18-
python3.11 -m venv $(HOME)/pytest
19-
uv pip install --python $(HOME)/pytest/bin/python3 --only-deps --extra dev '.'
20-
sudo ln -sf $(HOME)/pytest/bin/pytest /usr/local/bin/pytest
21-
pytest --version
19+
python3.11 -m venv $(HOME)/pytest || python3 -m venv $(HOME)/pytest || python -m venv $(HOME)/pytest
20+
uv pip install --python $(HOME)/pytest/bin/python3 --only-deps --extra dev '.' 2>/dev/null || \
21+
uv pip install --python $(HOME)/pytest/Scripts/python.exe --only-deps --extra dev '.'
22+
@if [ -f "$(HOME)/pytest/bin/pytest" ]; then \
23+
sudo ln -sf $(HOME)/pytest/bin/pytest /usr/local/bin/pytest 2>/dev/null || true; \
24+
fi
25+
$(HOME)/pytest/bin/pytest --version 2>/dev/null || $(HOME)/pytest/Scripts/pytest --version
2226

2327
# Install SAM CLI nightly binary
2428
init-nightly:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ dependencies = [
4545
"docker~=7.1.0",
4646
"dateparser~=1.3",
4747
"requests~=2.32.5",
48-
"aws_lambda_builders==1.62.0",
48+
"aws_lambda_builders==1.63.0",
4949
"tomlkit==0.14.0",
5050
"watchdog==4.0.2",
5151
"rich~=14.3.3",

requirements/reproducible-linux.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ attrs==25.4.0 \
1414
# via
1515
# jsonschema
1616
# referencing
17-
aws-lambda-builders==1.62.0 \
18-
--hash=sha256:008afea8aa14bd10a1cf8b7c736ceee893b38d8dca15519e6121a384bd86e52f \
19-
--hash=sha256:2f1a4baa61c165941d26fdf05966aa4c2e95a66af06b7309bb09558daea4a561
17+
aws-lambda-builders==1.63.0 \
18+
--hash=sha256:58662561bd52d931d62b3ba327acfa0c8e9117c4593eb816b3454ce6b47f4076 \
19+
--hash=sha256:9e03d163d78950d8896055afa4f19c0999ea0103076dfa8b0f2012d2503b1657
2020
# via aws-sam-cli (pyproject.toml)
2121
aws-sam-translator==1.107.0 \
2222
--hash=sha256:95b2a03a87fb61d9a9e9e431a18e6221c4780b32792eed4b239e72ef7366d63b \

requirements/reproducible-mac.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ attrs==25.4.0 \
1414
# via
1515
# jsonschema
1616
# referencing
17-
aws-lambda-builders==1.62.0 \
18-
--hash=sha256:008afea8aa14bd10a1cf8b7c736ceee893b38d8dca15519e6121a384bd86e52f \
19-
--hash=sha256:2f1a4baa61c165941d26fdf05966aa4c2e95a66af06b7309bb09558daea4a561
17+
aws-lambda-builders==1.63.0 \
18+
--hash=sha256:58662561bd52d931d62b3ba327acfa0c8e9117c4593eb816b3454ce6b47f4076 \
19+
--hash=sha256:9e03d163d78950d8896055afa4f19c0999ea0103076dfa8b0f2012d2503b1657
2020
# via aws-sam-cli (pyproject.toml)
2121
aws-sam-translator==1.107.0 \
2222
--hash=sha256:95b2a03a87fb61d9a9e9e431a18e6221c4780b32792eed4b239e72ef7366d63b \

requirements/reproducible-win.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ attrs==25.4.0 \
1414
# via
1515
# jsonschema
1616
# referencing
17-
aws-lambda-builders==1.62.0 \
18-
--hash=sha256:008afea8aa14bd10a1cf8b7c736ceee893b38d8dca15519e6121a384bd86e52f \
19-
--hash=sha256:2f1a4baa61c165941d26fdf05966aa4c2e95a66af06b7309bb09558daea4a561
17+
aws-lambda-builders==1.63.0 \
18+
--hash=sha256:58662561bd52d931d62b3ba327acfa0c8e9117c4593eb816b3454ce6b47f4076 \
19+
--hash=sha256:9e03d163d78950d8896055afa4f19c0999ea0103076dfa8b0f2012d2503b1657
2020
# via aws-sam-cli (pyproject.toml)
2121
aws-sam-translator==1.107.0 \
2222
--hash=sha256:95b2a03a87fb61d9a9e9e431a18e6221c4780b32792eed4b239e72ef7366d63b \

tests/free_disk_space.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
#!/bin/bash
2-
# Free up disk space on CI runners if root partition has less than 50GB free.
3-
# Removes common unused resources that ship with GitHub Actions runners.
2+
# Free up disk space on CI runners.
3+
# On Linux: cleans up unused packages if root partition has less than 50GB free.
4+
# On Windows: just reports disk usage for debugging.
45
set -e
56

7+
# Windows: just show disk usage and exit
8+
if [[ "${RUNNER_OS:-}" == "Windows" ]]; then
9+
echo "=== Windows Disk Usage ==="
10+
powershell.exe -Command "Get-PSDrive -PSProvider FileSystem | Format-Table Name, @{N='Used(GB)';E={[math]::Round(\$_.Used/1GB,1)}}, @{N='Free(GB)';E={[math]::Round(\$_.Free/1GB,1)}}, @{N='Total(GB)';E={[math]::Round((\$_.Used+\$_.Free)/1GB,1)}} -AutoSize"
11+
exit 0
12+
fi
13+
614
echo "=== Disk usage before cleanup ==="
715
df -h
816

tests/install-maven-gradle.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/bash
2+
# Install Maven 3.9.13 and Gradle 9.3.1 for SAM CLI integration tests.
3+
# Supports both Linux and Windows (Git Bash on GitHub Actions).
4+
set -euo pipefail
5+
6+
MAVEN_VERSION="3.9.13"
7+
GRADLE_VERSION="9.3.1"
8+
9+
# Check if correct versions are already installed
10+
MAVEN_INSTALLED=$(mvn --version 2>/dev/null | head -1 | grep -o "${MAVEN_VERSION}" || true)
11+
GRADLE_INSTALLED=$(gradle --version 2>/dev/null | grep "Gradle ${GRADLE_VERSION}" || true)
12+
13+
if [[ -n "$MAVEN_INSTALLED" && -n "$GRADLE_INSTALLED" ]]; then
14+
echo "Maven ${MAVEN_VERSION} and Gradle ${GRADLE_VERSION} are already installed, skipping."
15+
mvn --version
16+
gradle --version
17+
exit 0
18+
fi
19+
20+
if [[ "${RUNNER_OS:-}" == "Windows" ]]; then
21+
echo "=== Installing Maven ${MAVEN_VERSION} and Gradle ${GRADLE_VERSION} on Windows via choco ==="
22+
[[ -z "$MAVEN_INSTALLED" ]] && choco install maven --version="${MAVEN_VERSION}" -y --allow-downgrade
23+
[[ -z "$GRADLE_INSTALLED" ]] && choco install gradle --version="${GRADLE_VERSION}" -y --allow-downgrade
24+
25+
# Chocolatey updates the system PATH in the registry but the current bash session
26+
# doesn't see it. Explicitly add the known install paths so mvn/gradle are available
27+
# in this session and in subsequent workflow steps.
28+
CHOCO_MAVEN_BIN="C:/ProgramData/chocolatey/lib/maven/apache-maven-${MAVEN_VERSION}/bin"
29+
CHOCO_GRADLE_BIN="C:/ProgramData/chocolatey/lib/gradle/gradle-${GRADLE_VERSION}/bin"
30+
export PATH="${CHOCO_MAVEN_BIN}:${CHOCO_GRADLE_BIN}:${PATH}"
31+
echo "${CHOCO_MAVEN_BIN}" >> "$GITHUB_PATH"
32+
echo "${CHOCO_GRADLE_BIN}" >> "$GITHUB_PATH"
33+
else
34+
echo "=== Installing Maven ${MAVEN_VERSION} and Gradle ${GRADLE_VERSION} on Linux ==="
35+
sudo apt-get remove -y maven || true
36+
37+
wget -q "https://dlcdn.apache.org/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.zip" -P /tmp
38+
sudo unzip -o -q /tmp/apache-maven-*.zip -d /opt/mvn
39+
40+
wget -q "https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip" -P /tmp
41+
sudo unzip -o -q /tmp/gradle-*.zip -d /opt/gradle
42+
43+
sudo ln -sf "/opt/mvn/apache-maven-${MAVEN_VERSION}/bin/mvn" /usr/local/bin/mvn
44+
sudo ln -sf "/opt/gradle/gradle-${GRADLE_VERSION}/bin/gradle" /usr/local/bin/gradle
45+
46+
echo "/opt/mvn/apache-maven-${MAVEN_VERSION}/bin" >> "$GITHUB_PATH"
47+
echo "/opt/gradle/gradle-${GRADLE_VERSION}/bin" >> "$GITHUB_PATH"
48+
echo "MAVEN_HOME=/opt/mvn/apache-maven-${MAVEN_VERSION}" >> "$GITHUB_ENV"
49+
50+
export PATH="/opt/mvn/apache-maven-${MAVEN_VERSION}/bin:/opt/gradle/gradle-${GRADLE_VERSION}/bin:$PATH"
51+
fi
52+
53+
mvn --version || echo "WARNING: mvn --version failed"
54+
gradle --version || echo "WARNING: gradle --version failed"
55+
echo "=== Maven and Gradle installation complete ==="

tests/install-rust.sh

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,54 @@ CARGO_LAMBDA_VERSION="${1:-${CARGO_LAMBDA_VERSION:-v0.17.1}}"
1616
# Install rustup if not present
1717
if ! command -v rustup &> /dev/null; then
1818
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL https://sh.rustup.rs | sh -s -- --default-toolchain none -y
19-
source "$HOME/.cargo/env"
19+
# source cargo env (file doesn't exist on Windows where Rust is pre-installed)
20+
if [ -f "$HOME/.cargo/env" ]; then
21+
source "$HOME/.cargo/env"
22+
fi
2023
if [ -n "${GITHUB_PATH:-}" ]; then
2124
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> "$GITHUB_PATH"
2225
fi
2326
fi
2427

2528
rustup toolchain install stable --profile minimal --no-self-update
2629
rustup default stable
27-
rustup target add x86_64-unknown-linux-gnu --toolchain stable
28-
rustup target add aarch64-unknown-linux-gnu --toolchain stable
30+
31+
if [[ "${RUNNER_OS:-}" == "Windows" ]]; then
32+
# On Windows, add Windows-native targets
33+
rustup target add x86_64-pc-windows-msvc --toolchain stable || true
34+
else
35+
rustup target add x86_64-unknown-linux-gnu --toolchain stable
36+
rustup target add aarch64-unknown-linux-gnu --toolchain stable
37+
fi
2938

3039
# Install cargo-lambda and ziglang
3140
if [ "$USE_UV" = true ]; then
3241
PYTHON311="$(uv python find 3.11)"
3342
PYTHON311_BIN="$(dirname "$PYTHON311")"
34-
uv pip install --break-system-packages --python "$PYTHON311" "cargo-lambda==$CARGO_LAMBDA_VERSION"
43+
uv pip install --break-system-packages --python "$PYTHON311" "cargo-lambda==$CARGO_LAMBDA_VERSION" ziglang
44+
PYTHON_CMD="$PYTHON311"
3545
if [ -n "${GITHUB_PATH:-}" ]; then
3646
echo "$PYTHON311_BIN" >> "$GITHUB_PATH"
3747
fi
3848
else
39-
python3.11 -m pip install "cargo-lambda==$CARGO_LAMBDA_VERSION"
40-
PYTHON311="python3.11"
49+
python3.11 -m pip install "cargo-lambda==$CARGO_LAMBDA_VERSION" ziglang
50+
PYTHON_CMD="python3.11"
4151
fi
4252

4353
# Create a zig wrapper so SAM CLI's cargo-lambda can find it
44-
printf '#!/bin/bash\nexec %s -m ziglang "$@"\n' "$PYTHON311" | sudo tee /usr/local/bin/zig > /dev/null
45-
sudo chmod +x /usr/local/bin/zig
54+
if [[ "${RUNNER_OS:-}" == "Windows" ]]; then
55+
# Install zig via chocolatey (most reliable on Windows)
56+
choco install zig --no-progress -y 2>/dev/null || true
57+
# Fallback: create wrappers using the Python that has ziglang installed
58+
if ! command -v zig &>/dev/null; then
59+
ZIG_PYTHON="$PYTHON_CMD"
60+
printf '#!/bin/bash\nexec "%s" -m ziglang "$@"\n' "$ZIG_PYTHON" > /c/Windows/zig
61+
printf '@echo off\r\n"%s" -m ziglang %%*\r\n' "$ZIG_PYTHON" > /c/Windows/zig.cmd
62+
fi
63+
else
64+
printf '#!/bin/bash\nexec %s -m ziglang "$@"\n' "$PYTHON_CMD" | sudo tee /usr/local/bin/zig > /dev/null
65+
sudo chmod +x /usr/local/bin/zig
66+
fi
4667

4768
rustc -V
4869
cargo -V

0 commit comments

Comments
 (0)