Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/boring-cyborg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ labelPRBasedOnFilePath:

dependencies:
- pyproject.toml
- poetry.lock
- uv.lock

tests:
- tests/*
Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ updates:
patterns:
- "*"

- package-ecosystem: "pip"
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "weekly"
Expand Down
44 changes: 25 additions & 19 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,22 @@ jobs:

- name: Set release version
id: release_version
run: echo "RELEASE_VERSION=${{ inputs.version }}" >> "$GITHUB_OUTPUT"

- name: Verify pre-release version semantics
run: |
if [[ ! "${{ inputs.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+[a-b][0-9]+$ ]]; then
echo "Version ${{ inputs.version }} doesn't look like a pre-release version (e.g., 3.24.0a0); aborting"
VERSION_PART='(0|[1-9][0-9]*)'
if [[ ! "$RELEASE_VERSION" =~ ^${VERSION_PART}\.${VERSION_PART}\.${VERSION_PART}(a|b|rc)${VERSION_PART}$ ]]; then
echo "Invalid pre-release version: $RELEASE_VERSION"
exit 1
fi
- name: Update version in pyproject.toml
run: sed -i 's/^version = ".*"/version = "${{ inputs.version }}"/' pyproject.toml

- name: Update version in version.py
run: sed -i 's/^VERSION = ".*"/VERSION = "${{ inputs.version }}"/' aws_lambda_powertools/shared/version.py
sed -i "/^\[project\]$/,/^\[/s/^version = \".*\"/version = \"${RELEASE_VERSION}\"/" pyproject.toml
sed -i "s/^VERSION = \".*\"/VERSION = \"${RELEASE_VERSION}\"/" aws_lambda_powertools/shared/version.py
sed -i "/^name = \"aws-lambda-powertools\"$/{n;s/^version = \".*\"/version = \"${RELEASE_VERSION}\"/;}" uv.lock
# Stop before sealing if a field was missing or its format changed.
test "$(sed -n '/^\[project\]$/,/^\[/p' pyproject.toml | grep '^version = ')" = "version = \"${RELEASE_VERSION}\""
test "$(grep '^VERSION = ' aws_lambda_powertools/shared/version.py)" = "VERSION = \"${RELEASE_VERSION}\""
test "$(sed -n '/^name = "aws-lambda-powertools"$/{n;p;}' uv.lock)" = "version = \"${RELEASE_VERSION}\""
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> "$GITHUB_OUTPUT"
env:
RELEASE_VERSION: ${{ inputs.version }}

- name: Seal and upload
id: seal_source_code
Expand Down Expand Up @@ -112,13 +114,15 @@ jobs:
- name: Debug cache restore
run: cat pyproject.toml

- name: Install poetry
run: pipx install git+https://github.com/python-poetry/poetry@bd500dd3bdfaec3de6894144c9cedb3a9358be84 # v2.0.1
- name: Set up uv
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
version: "0.12.19"
enable-cache: true
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.14"
cache: "poetry"
- name: Install dependencies
run: make dev
- name: Run all tests, linting and baselines
Expand Down Expand Up @@ -150,16 +154,18 @@ jobs:
integrity_hash: ${{ needs.seal.outputs.integrity_hash }}
artifact_name: ${{ needs.seal.outputs.artifact_name }}

- name: Install poetry
run: pipx install git+https://github.com/python-poetry/poetry@bd500dd3bdfaec3de6894144c9cedb3a9358be84 # v2.0.1
- name: Set up uv
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
version: "0.12.19"
enable-cache: true
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.14"
cache: "poetry"

- name: Build python package and wheel
run: poetry build
run: uv build --no-sources

- name: Seal and upload
id: seal_build
Expand Down Expand Up @@ -258,7 +264,7 @@ jobs:
id: create-pr
uses: ./.github/actions/create-pr
with:
files: "pyproject.toml aws_lambda_powertools/shared/version.py provenance/"
files: "pyproject.toml uv.lock aws_lambda_powertools/shared/version.py provenance/"
temp_branch_prefix: "ci-bump"
pull_request_title: "chore(ci): new pre-release ${{ needs.seal.outputs.RELEASE_VERSION }}"
github_token: ${{ secrets.GITHUB_TOKEN }}
25 changes: 13 additions & 12 deletions .github/workflows/publish_v3_layer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,11 @@ jobs:
integrity_hash: ${{ inputs.source_code_integrity_hash }}
artifact_name: ${{ inputs.source_code_artifact_name }}

- name: Install poetry
run: |
pipx install git+https://github.com/python-poetry/poetry@bd500dd3bdfaec3de6894144c9cedb3a9358be84 # v2.0.1
pipx inject poetry git+https://github.com/python-poetry/poetry-plugin-export@8c83d26603ca94f2e203bfded7b6d7f530960e06 # v1.8.0
- name: Set up uv
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
version: "0.12.19"
enable-cache: true
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
Expand All @@ -130,13 +131,8 @@ jobs:
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Resolve and install project dependencies
# CDK spawns system python when compiling stack
# therefore it ignores both activated virtual env and cached interpreter by GH
run: |
poetry export --format requirements.txt --output requirements.txt
pip install --require-hashes -r requirements.txt
- name: Install dependencies
run: uv sync --locked --no-build

- name: Set up QEMU
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
Expand All @@ -163,9 +159,14 @@ jobs:
run: sleep 60

- name: CDK build
run: npx cdk synth --verbose --context version="${{ inputs.latest_published_version }}" --context pythonVersion="python${{ matrix.python-version }}" -o cdk.out
run: >-
uv run --locked --no-build npx cdk synth --verbose
--context "version=${LAYER_PACKAGE_VERSION}"
--context "pythonVersion=python${PYTHON_RUNTIME}" -o cdk.out
env:
BUILDX_BUILDER: ${{ steps.builder.outputs.name }}
LAYER_PACKAGE_VERSION: ${{ inputs.latest_published_version }}
PYTHON_RUNTIME: ${{ matrix.python-version }}
- name: zip output
run: zip -r cdk.py${{ matrix.python-version }}.out.zip cdk.out
- name: Archive CDK artifacts
Expand Down
27 changes: 23 additions & 4 deletions .github/workflows/quality_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,16 @@ on:
- "tests/**"
- "examples/**"
- "pyproject.toml"
- "poetry.lock"
- "uv.lock"
- "mypy.ini"
- "Makefile"
- "noxfile.py"
- ".pre-commit-config.yaml"
- ".github/workflows/quality_check.yml"
- ".github/workflows/release-v3.yml"
- ".github/workflows/pre-release.yml"
- ".github/actions/seal/**"
- ".github/actions/seal-restore/**"
branches:
- develop
push:
Expand All @@ -31,8 +39,16 @@ on:
- "tests/**"
- "examples/**"
- "pyproject.toml"
- "poetry.lock"
- "uv.lock"
- "mypy.ini"
- "Makefile"
- "noxfile.py"
- ".pre-commit-config.yaml"
- ".github/workflows/quality_check.yml"
- ".github/workflows/release-v3.yml"
- ".github/workflows/pre-release.yml"
- ".github/actions/seal/**"
- ".github/actions/seal-restore/**"
branches:
- develop

Expand All @@ -53,8 +69,11 @@ jobs:
contents: read # checkout code only
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install poetry
run: pipx install poetry
- name: Set up uv
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
version: "0.12.19"
enable-cache: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/quality_code_cdk_constructor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@ on:
pull_request:
paths:
- "layer_v3/layer_constructors/**"
- "layer_v3/pyproject.toml"
- "layer_v3/uv.lock"
- ".github/workflows/quality_code_cdk_constructor.yml"
branches:
- develop
push:
paths:
- "layer_v3/layer_constructors/**"
- "layer_v3/pyproject.toml"
- "layer_v3/uv.lock"
- ".github/workflows/quality_code_cdk_constructor.yml"
branches:
- develop

Expand All @@ -43,13 +49,15 @@ jobs:
working-directory: ./layer_v3/layer_constructors
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install poetry
run: pipx install poetry
- name: Set up uv
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
version: "0.12.19"
enable-cache: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Set up QEMU
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
with:
Expand All @@ -62,10 +70,8 @@ jobs:
driver: docker
platforms: linux/amd64,linux/arm64
- name: Install dependencies
run: |
pip install --upgrade pip pre-commit poetry
poetry install
run: uv sync --locked --no-build
- name: Test with pytest
run: poetry run pytest tests
run: uv run --locked --no-build pytest tests
env:
BUILDX_BUILDER: ${{ steps.builder.outputs.name }}
44 changes: 27 additions & 17 deletions .github/workflows/release-v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,28 @@ jobs:
id: release_version
# transform tag format `v<version` to `<version>`
run: |
RELEASE_VERSION="${RELEASE_TAG_VERSION:1}"
RELEASE_VERSION="${RELEASE_TAG_VERSION#v}"
VERSION_PART='(0|[1-9][0-9]*)'
if [[ ! "$RELEASE_VERSION" =~ ^${VERSION_PART}\.${VERSION_PART}\.${VERSION_PART}((a|b|rc)${VERSION_PART})?$ ]]; then
echo "Invalid release version: $RELEASE_VERSION"
exit 1
fi
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ env.RELEASE_COMMIT }}

# We use a pinned version of Poetry to be certain it won't modify source code before we create a hash
- name: Install poetry
run: |
pipx install git+https://github.com/python-poetry/poetry@bd500dd3bdfaec3de6894144c9cedb3a9358be84 # v2.0.1
pipx inject poetry git+https://github.com/monim67/poetry-bumpversion@348de6f247222e2953d649932426e63492e0a6bf # v0.3.3
- name: Bump package version
id: versioning
run: poetry version "${RELEASE_VERSION}"
run: |
sed -i "/^\[project\]$/,/^\[/s/^version = \".*\"/version = \"${RELEASE_VERSION}\"/" pyproject.toml
sed -i "s/^VERSION = \".*\"/VERSION = \"${RELEASE_VERSION}\"/" aws_lambda_powertools/shared/version.py
sed -i "/^name = \"aws-lambda-powertools\"$/{n;s/^version = \".*\"/version = \"${RELEASE_VERSION}\"/;}" uv.lock
# Stop before sealing if a field was missing or its format changed.
test "$(sed -n '/^\[project\]$/,/^\[/p' pyproject.toml | grep '^version = ')" = "version = \"${RELEASE_VERSION}\""
test "$(grep '^VERSION = ' aws_lambda_powertools/shared/version.py)" = "VERSION = \"${RELEASE_VERSION}\""
test "$(sed -n '/^name = "aws-lambda-powertools"$/{n;p;}' uv.lock)" = "version = \"${RELEASE_VERSION}\""
env:
RELEASE_VERSION: ${{ steps.release_version.outputs.RELEASE_VERSION}}

Expand Down Expand Up @@ -137,13 +143,15 @@ jobs:
- name: Debug cache restore
run: cat pyproject.toml

- name: Install poetry
run: pipx install git+https://github.com/python-poetry/poetry@bd500dd3bdfaec3de6894144c9cedb3a9358be84 # v2.0.1
- name: Set up uv
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
version: "0.12.19"
enable-cache: true
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.14"
cache: "poetry"
- name: Install dependencies
run: make dev
- name: Run all tests, linting and baselines
Expand Down Expand Up @@ -175,16 +183,18 @@ jobs:
integrity_hash: ${{ needs.seal.outputs.integrity_hash }}
artifact_name: ${{ needs.seal.outputs.artifact_name }}

- name: Install poetry
run: pipx install git+https://github.com/python-poetry/poetry@bd500dd3bdfaec3de6894144c9cedb3a9358be84 # v2.0.1
- name: Set up uv
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
version: "0.12.19"
enable-cache: true
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.14"
cache: "poetry"

- name: Build python package and wheel
run: poetry build
run: uv build --no-sources

- name: Seal and upload
id: seal_build
Expand Down Expand Up @@ -287,7 +297,7 @@ jobs:
- name: Create Git Tag
run: |
git add pyproject.toml aws_lambda_powertools/shared/version.py
git add pyproject.toml uv.lock aws_lambda_powertools/shared/version.py
git commit -m "chore: version bump"
git tag -a v"${RELEASE_VERSION}" -m "release_version: v${RELEASE_VERSION}"
git push origin v"${RELEASE_VERSION}"
Expand Down Expand Up @@ -326,7 +336,7 @@ jobs:
id: create-pr
uses: ./.github/actions/create-pr
with:
files: "pyproject.toml aws_lambda_powertools/shared/version.py"
files: "pyproject.toml uv.lock aws_lambda_powertools/shared/version.py"
temp_branch_prefix: "ci-bump"
pull_request_title: "chore(ci): bump version to ${{ needs.seal.outputs.RELEASE_VERSION }}"
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Loading
Loading