Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7e20331
feat: Python ItemEncryptor impl and tests (#1889)
lucasmcdonald3 May 15, 2025
c93bf08
Merge branch 'python-reviewed' of github.com:aws/aws-database-encrypt…
May 16, 2025
1b0bdff
feat: Python EncryptedClient impl and tests (#1894)
lucasmcdonald3 May 16, 2025
009c5f9
Merge branch 'main' into python-reviewed
May 29, 2025
e9d473b
feat: Python EncryptedPaginator impl and tests (#1896)
lucasmcdonald3 May 30, 2025
f42ca1f
chore(python): examples for client_supplier
imabhichow May 23, 2025
f8e8911
linter
imabhichow May 29, 2025
b55c13f
Update Examples/runtimes/python/DynamoDBEncryption/src/client_supplie…
imabhichow May 30, 2025
112798d
chore(python): examples for client_supplier
imabhichow May 30, 2025
3b76f86
chore(Python): Commit project files (#1916)
lucasmcdonald3 Jun 3, 2025
b1d4ea6
docs(Python): Docs config (#1918)
lucasmcdonald3 Jun 3, 2025
418687f
test(Python): GHA and test config files (#1917)
lucasmcdonald3 Jun 3, 2025
e9b623f
feat(Python): Commit Smithy-generated code (#1912)
lucasmcdonald3 Jun 3, 2025
41c4d92
feat(Python): DynamoDB Resource/Client shape transforms (#1907)
lucasmcdonald3 Jun 3, 2025
fc5f30c
feat: Python EncryptedResource, EncryptedTablesCollectionManager, and…
lucasmcdonald3 Jun 3, 2025
33c173f
feat: Python EncryptedTable impl and tests (#1895)
lucasmcdonald3 Jun 3, 2025
3aa3f59
chore(python): examples for keyrings with EncryptedClient (#1914)
imabhichow Jun 3, 2025
50c6617
chore(python): examples for EncryptedTable (#1934)
imabhichow Jun 9, 2025
45377c9
chore(python): Add Support for Legacy DBEC and Migration Examples (#1…
imabhichow Jun 25, 2025
99a32aa
chore(python): restructure legacy migration examples (#1956)
imabhichow Jul 8, 2025
de4588f
chore(python): plaintext migration examples (#1957)
imabhichow Jul 21, 2025
7092015
Merge branch 'main' into python-reviewed
imabhichow Sep 22, 2025
6427f70
chore(python): polymorph (#1992)
imabhichow Sep 22, 2025
d48e363
Merge branch 'main' into python-reviewed
imabhichow Sep 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
100 changes: 100 additions & 0 deletions .github/workflows/ci_examples_python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# This workflow performs tests in Python.
name: Python Examples

on:
workflow_call:
inputs:
dafny:
description: "The Dafny version to run"
required: true
type: string
regenerate-code:
description: "Regenerate code using smithy-dafny"
required: false
default: false
type: boolean
mpl-version:
description: "MPL version to use"
required: false
type: string
mpl-head:
description: "Running on MPL HEAD"
required: false
default: false
type: boolean

jobs:
testPython:
strategy:
max-parallel: 1
matrix:
python-version: [3.11, 3.12, 3.13]
os: [macos-13]
runs-on: ${{ matrix.os }}
permissions:
id-token: write
contents: read
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2
role-session-name: DDBEC-Dafny-Python-Tests

- uses: actions/checkout@v3
with:
submodules: recursive

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Setup Python ${{ matrix.python-version }} for running tests
run: |
python -m pip install --upgrade pip
pip install --upgrade tox
pip install poetry

- name: Setup Dafny
uses: ./submodules/MaterialProviders/.github/actions/setup_dafny/
with:
dafny-version: ${{ inputs.dafny }}

- name: Update MPL submodule if using MPL HEAD
if: ${{ inputs.mpl-head == true }}
working-directory: submodules/MaterialProviders
run: |
git checkout main
git pull
git submodule update --init --recursive
git rev-parse HEAD

- name: Install Smithy-Dafny codegen dependencies
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies

- name: Regenerate code using smithy-dafny if necessary
if: ${{ inputs.regenerate-code }}
uses: ./.github/actions/polymorph_codegen
with:
dafny: ${{ env.DAFNY_VERSION }}
library: DynamoDbEncryption
diff-generated-code: false
update-and-regenerate-mpl: true

- name: Build and locally deploy dependencies for examples
shell: bash
working-directory: ./DynamoDbEncryption
run: |
make transpile_python

- name: Test DynamoDbEncryption Examples
working-directory: ./Examples/runtimes/python
run: |
# Run simple examples
tox -e dynamodbencryption
# Run legacy migration examples
tox -e legacymigration
# Run plaintext migration examples
tox -e plaintextmigration
79 changes: 79 additions & 0 deletions .github/workflows/ci_static_analysis_python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# This workflow performs static analysis in Python.
name: Python Static Analysis

on:
workflow_call:
inputs:
regenerate-code:
description: "Regenerate code using smithy-dafny"
required: false
default: false
type: boolean
mpl-version:
description: "MPL version to use"
required: false
type: string
mpl-head:
description: "Running on MPL HEAD"
required: false
default: false
type: boolean

jobs:
testPython:
strategy:
matrix:
python-version: [3.11]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
permissions:
id-token: write
contents: read
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2
role-session-name: DDBEC-Dafny-Python-Tests

- uses: actions/checkout@v3
with:
submodules: recursive

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Setup Python ${{ matrix.python-version }} for running tests
run: |
python -m pip install --upgrade pip
pip install --upgrade tox
pip install poetry

- name: Update MPL submodule if using MPL HEAD
if: ${{ inputs.mpl-head == true }}
working-directory: submodules/MaterialProviders
run: |
git checkout main
git pull
git submodule update --init --recursive
git rev-parse HEAD

- name: Install Smithy-Dafny codegen dependencies
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies

- name: Regenerate code using smithy-dafny if necessary
if: ${{ inputs.regenerate-code }}
uses: ./.github/actions/polymorph_codegen
with:
dafny: ${{ env.DAFNY_VERSION }}
library: DynamoDbEncryption
diff-generated-code: false
update-and-regenerate-mpl: true

- name: Run static analysis
working-directory: ./DynamoDbEncryption/runtimes/python
run: |
tox -e lint-check
132 changes: 132 additions & 0 deletions .github/workflows/ci_test_python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# This workflow runs only Dafny-transpiled Python tests.
name: test python

on:
workflow_call:
inputs:
dafny:
description: "The Dafny version to run"
required: true
type: string
regenerate-code:
description: "Regenerate code using smithy-dafny"
required: false
default: false
type: boolean
mpl-head:
description: "Running on MPL HEAD"
required: false
default: false
type: boolean

jobs:
testPython:
strategy:
fail-fast: false
matrix:
library: [DynamoDbEncryption]
python-version: ["3.11", "3.12", "3.13"]
os: [
macos-13,
ubuntu-22.04,
# Dafny-transpiled Python tests use a PYTHONPATH hack that doesn't work on Windows.
# Windows is tested with non-Dafny-transpiled Python tests.
# windows-latest
]
runs-on: ${{ matrix.os }}
permissions:
id-token: write
contents: read
steps:
- name: Support longpaths on Git checkout
run: |
git config --global core.longpaths true
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Setup Python ${{ matrix.python-version }} for running tests
run: |
python -m pip install --upgrade pip
pip install --upgrade tox
pip install poetry

- name: Setup Dafny
uses: ./submodules/MaterialProviders/.github/actions/setup_dafny/
with:
dafny-version: ${{ inputs.dafny }}

- name: Update MPL submodule if using MPL HEAD
if: ${{ inputs.mpl-head == true }}
working-directory: submodules/MaterialProviders
run: |
git checkout main
git pull
git submodule update --init --recursive
git rev-parse HEAD

- name: Install Smithy-Dafny codegen dependencies
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies

- name: Regenerate code using smithy-dafny if necessary
if: ${{ inputs.regenerate-code }}
uses: ./.github/actions/polymorph_codegen
with:
dafny: ${{ env.DAFNY_VERSION }}
library: ${{ matrix.library }}
diff-generated-code: false
update-and-regenerate-mpl: true

- name: Download Dependencies
working-directory: ./${{ matrix.library }}
run: make setup_python

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2
role-session-name: DDBEC-Dafny-Net-Tests

- name: Compile ${{ matrix.library }} implementation
shell: bash
working-directory: ./${{ matrix.library }}
run: |
# This works because `node` is installed by default on GHA runners
CORES=$(node -e 'console.log(os.cpus().length)')
make transpile_python CORES=$CORES

- name: Test ${{ matrix.library }} Dafny-transpiled Python tests
# Dafny-transpiled Python tests use a PYTHONPATH hack that doesn't work on Windows.
# Windows is tested with non-Dafny-transpiled Python tests.
if: ${{ matrix.os != 'windows-latest' }}
working-directory: ./${{ matrix.library }}/runtimes/python
shell: bash
run: |
tox -e dafnytests

- name: Test ${{ matrix.library }} Python unit tests
working-directory: ./${{ matrix.library }}/runtimes/python
shell: bash
run: |
tox -e unit

- name: Test ${{ matrix.library }} Python integration tests
working-directory: ./${{ matrix.library }}/runtimes/python
shell: bash
run: |
tox -e integ
tox -e legacyinteg

- name: Test ${{ matrix.library }} Python coverage
working-directory: ./${{ matrix.library }}/runtimes/python
shell: bash
run: |
tox -e encrypted-interface-coverage
tox -e client-to-resource-conversions-coverage
tox -e resource-to-client-conversions-coverage
Loading
Loading