Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 418687f

Browse files
authoredJun 3, 2025
test(Python): GHA and test config files (#1917)
1 parent b1d4ea6 commit 418687f

File tree

13 files changed

+675
-0
lines changed

13 files changed

+675
-0
lines changed
 
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# This workflow performs tests in Python.
2+
name: Python Examples
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
dafny:
8+
description: "The Dafny version to run"
9+
required: true
10+
type: string
11+
regenerate-code:
12+
description: "Regenerate code using smithy-dafny"
13+
required: false
14+
default: false
15+
type: boolean
16+
mpl-version:
17+
description: "MPL version to use"
18+
required: false
19+
type: string
20+
mpl-head:
21+
description: "Running on MPL HEAD"
22+
required: false
23+
default: false
24+
type: boolean
25+
26+
jobs:
27+
testPython:
28+
strategy:
29+
max-parallel: 1
30+
matrix:
31+
python-version: [3.11, 3.12, 3.13]
32+
os: [macos-13]
33+
runs-on: ${{ matrix.os }}
34+
permissions:
35+
id-token: write
36+
contents: read
37+
steps:
38+
- name: Configure AWS Credentials
39+
uses: aws-actions/configure-aws-credentials@v4
40+
with:
41+
aws-region: us-west-2
42+
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2
43+
role-session-name: DDBEC-Dafny-Python-Tests
44+
45+
- uses: actions/checkout@v3
46+
with:
47+
submodules: recursive
48+
49+
- name: Setup Python ${{ matrix.python-version }}
50+
uses: actions/setup-python@v4
51+
with:
52+
python-version: ${{ matrix.python-version }}
53+
54+
- name: Setup Python ${{ matrix.python-version }} for running tests
55+
run: |
56+
python -m pip install --upgrade pip
57+
pip install --upgrade tox
58+
pip install poetry
59+
60+
- name: Setup Dafny
61+
uses: ./submodules/MaterialProviders/.github/actions/setup_dafny/
62+
with:
63+
dafny-version: ${{ inputs.dafny }}
64+
65+
- name: Update MPL submodule if using MPL HEAD
66+
if: ${{ inputs.mpl-head == true }}
67+
working-directory: submodules/MaterialProviders
68+
run: |
69+
git checkout main
70+
git pull
71+
git submodule update --init --recursive
72+
git rev-parse HEAD
73+
74+
- name: Install Smithy-Dafny codegen dependencies
75+
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
76+
77+
- name: Regenerate code using smithy-dafny if necessary
78+
if: ${{ inputs.regenerate-code }}
79+
uses: ./.github/actions/polymorph_codegen
80+
with:
81+
dafny: ${{ env.DAFNY_VERSION }}
82+
library: DynamoDbEncryption
83+
diff-generated-code: false
84+
update-and-regenerate-mpl: true
85+
86+
- name: Build and locally deploy dependencies for examples
87+
shell: bash
88+
working-directory: ./DynamoDbEncryption
89+
run: |
90+
make transpile_python
91+
92+
- name: Test DynamoDbEncryption Examples
93+
working-directory: ./Examples/runtimes/python
94+
run: |
95+
# Run simple examples
96+
tox -e dynamodbencryption
97+
# Run migration examples
98+
# tox -e migration
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# This workflow performs static analysis in Python.
2+
name: Python Static Analysis
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
regenerate-code:
8+
description: "Regenerate code using smithy-dafny"
9+
required: false
10+
default: false
11+
type: boolean
12+
mpl-version:
13+
description: "MPL version to use"
14+
required: false
15+
type: string
16+
mpl-head:
17+
description: "Running on MPL HEAD"
18+
required: false
19+
default: false
20+
type: boolean
21+
22+
jobs:
23+
testPython:
24+
strategy:
25+
matrix:
26+
python-version: [3.11]
27+
os: [ubuntu-latest]
28+
runs-on: ${{ matrix.os }}
29+
permissions:
30+
id-token: write
31+
contents: read
32+
steps:
33+
- name: Configure AWS Credentials
34+
uses: aws-actions/configure-aws-credentials@v4
35+
with:
36+
aws-region: us-west-2
37+
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2
38+
role-session-name: DDBEC-Dafny-Python-Tests
39+
40+
- uses: actions/checkout@v3
41+
with:
42+
submodules: recursive
43+
44+
- name: Setup Python ${{ matrix.python-version }}
45+
uses: actions/setup-python@v4
46+
with:
47+
python-version: ${{ matrix.python-version }}
48+
49+
- name: Setup Python ${{ matrix.python-version }} for running tests
50+
run: |
51+
python -m pip install --upgrade pip
52+
pip install --upgrade tox
53+
pip install poetry
54+
55+
- name: Update MPL submodule if using MPL HEAD
56+
if: ${{ inputs.mpl-head == true }}
57+
working-directory: submodules/MaterialProviders
58+
run: |
59+
git checkout main
60+
git pull
61+
git submodule update --init --recursive
62+
git rev-parse HEAD
63+
64+
- name: Install Smithy-Dafny codegen dependencies
65+
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
66+
67+
- name: Regenerate code using smithy-dafny if necessary
68+
if: ${{ inputs.regenerate-code }}
69+
uses: ./.github/actions/polymorph_codegen
70+
with:
71+
dafny: ${{ env.DAFNY_VERSION }}
72+
library: DynamoDbEncryption
73+
diff-generated-code: false
74+
update-and-regenerate-mpl: true
75+
76+
- name: Run static analysis
77+
working-directory: ./DynamoDbEncryption/runtimes/python
78+
run: |
79+
tox -e lint-check

‎.github/workflows/ci_test_python.yml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# This workflow runs only Dafny-transpiled Python tests.
2+
name: test python
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
dafny:
8+
description: "The Dafny version to run"
9+
required: true
10+
type: string
11+
regenerate-code:
12+
description: "Regenerate code using smithy-dafny"
13+
required: false
14+
default: false
15+
type: boolean
16+
mpl-head:
17+
description: "Running on MPL HEAD"
18+
required: false
19+
default: false
20+
type: boolean
21+
22+
jobs:
23+
testPython:
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
library: [DynamoDbEncryption]
28+
python-version: ["3.11", "3.12", "3.13"]
29+
os: [
30+
macos-13,
31+
ubuntu-22.04,
32+
# Dafny-transpiled Python tests use a PYTHONPATH hack that doesn't work on Windows.
33+
# Windows is tested with non-Dafny-transpiled Python tests.
34+
# windows-latest
35+
]
36+
runs-on: ${{ matrix.os }}
37+
permissions:
38+
id-token: write
39+
contents: read
40+
steps:
41+
- name: Support longpaths on Git checkout
42+
run: |
43+
git config --global core.longpaths true
44+
- uses: actions/checkout@v3
45+
with:
46+
submodules: recursive
47+
48+
- name: Setup Python
49+
uses: actions/setup-python@v4
50+
with:
51+
python-version: ${{ matrix.python-version }}
52+
53+
- name: Setup Python ${{ matrix.python-version }} for running tests
54+
run: |
55+
python -m pip install --upgrade pip
56+
pip install --upgrade tox
57+
pip install poetry
58+
59+
- name: Setup Dafny
60+
uses: ./submodules/MaterialProviders/.github/actions/setup_dafny/
61+
with:
62+
dafny-version: ${{ inputs.dafny }}
63+
64+
- name: Update MPL submodule if using MPL HEAD
65+
if: ${{ inputs.mpl-head == true }}
66+
working-directory: submodules/MaterialProviders
67+
run: |
68+
git checkout main
69+
git pull
70+
git submodule update --init --recursive
71+
git rev-parse HEAD
72+
73+
- name: Install Smithy-Dafny codegen dependencies
74+
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
75+
76+
- name: Regenerate code using smithy-dafny if necessary
77+
if: ${{ inputs.regenerate-code }}
78+
uses: ./.github/actions/polymorph_codegen
79+
with:
80+
dafny: ${{ env.DAFNY_VERSION }}
81+
library: ${{ matrix.library }}
82+
diff-generated-code: false
83+
update-and-regenerate-mpl: true
84+
85+
- name: Download Dependencies
86+
working-directory: ./${{ matrix.library }}
87+
run: make setup_python
88+
89+
- name: Configure AWS Credentials
90+
uses: aws-actions/configure-aws-credentials@v4
91+
with:
92+
aws-region: us-west-2
93+
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2
94+
role-session-name: DDBEC-Dafny-Net-Tests
95+
96+
- name: Compile ${{ matrix.library }} implementation
97+
shell: bash
98+
working-directory: ./${{ matrix.library }}
99+
run: |
100+
# This works because `node` is installed by default on GHA runners
101+
CORES=$(node -e 'console.log(os.cpus().length)')
102+
make transpile_python CORES=$CORES
103+
104+
- name: Test ${{ matrix.library }} Dafny-transpiled Python tests
105+
# Dafny-transpiled Python tests use a PYTHONPATH hack that doesn't work on Windows.
106+
# Windows is tested with non-Dafny-transpiled Python tests.
107+
if: ${{ matrix.os != 'windows-latest' }}
108+
working-directory: ./${{ matrix.library }}/runtimes/python
109+
shell: bash
110+
run: |
111+
tox -e dafnytests
112+
113+
- name: Test ${{ matrix.library }} Python unit tests
114+
working-directory: ./${{ matrix.library }}/runtimes/python
115+
shell: bash
116+
run: |
117+
tox -e unit
118+
119+
- name: Test ${{ matrix.library }} Python integration tests
120+
working-directory: ./${{ matrix.library }}/runtimes/python
121+
shell: bash
122+
run: |
123+
tox -e integ
124+
125+
- name: Test ${{ matrix.library }} Python coverage
126+
working-directory: ./${{ matrix.library }}/runtimes/python
127+
shell: bash
128+
run: |
129+
tox -e encrypted-interface-coverage
130+
tox -e client-to-resource-conversions-coverage
131+
tox -e resource-to-client-conversions-coverage
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# This workflow performs test vectors in Python.
2+
name: Library Python Test Vectors
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
dafny:
8+
description: "The Dafny version to run"
9+
required: true
10+
type: string
11+
regenerate-code:
12+
description: "Regenerate code using smithy-dafny"
13+
required: false
14+
default: false
15+
type: boolean
16+
mpl-version:
17+
description: "MPL version to use"
18+
required: false
19+
type: string
20+
mpl-head:
21+
description: "Running on MPL HEAD"
22+
required: false
23+
default: false
24+
type: boolean
25+
26+
jobs:
27+
testPython:
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
library: [TestVectors]
32+
python-version: [3.11, 3.12, 3.13]
33+
# Only ubuntu for now;
34+
# As of 4.10.1, Dafny's Python JSON processing is still very slow (1 hour to run test vectors on ubuntu)
35+
# and Github's macOS runners are also very slow (~2x slower than ubuntu).
36+
# If Dafny's JSON processing speed is improved, we can add macOS back.
37+
os: [ubuntu-22.04]
38+
interface: [client, resource, table]
39+
runs-on: ${{ matrix.os }}
40+
permissions:
41+
id-token: write
42+
contents: read
43+
steps:
44+
- name: Setup DynamoDB Local
45+
uses: rrainn/dynamodb-action@v4.0.0
46+
with:
47+
port: 8000
48+
cors: "*"
49+
50+
- name: Configure AWS Credentials
51+
uses: aws-actions/configure-aws-credentials@v4
52+
with:
53+
aws-region: us-west-2
54+
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2
55+
role-session-name: DDBEC-Dafny-Python-Tests
56+
role-duration-seconds: 7200
57+
58+
- uses: actions/checkout@v3
59+
with:
60+
submodules: recursive
61+
62+
- name: Setup Dafny
63+
uses: ./submodules/MaterialProviders/.github/actions/setup_dafny/
64+
with:
65+
dafny-version: ${{ inputs.dafny }}
66+
67+
- name: Update MPL submodule if using MPL HEAD
68+
if: ${{ inputs.mpl-head == true }}
69+
working-directory: submodules/MaterialProviders
70+
run: |
71+
git checkout main
72+
git pull
73+
git submodule update --init --recursive
74+
git rev-parse HEAD
75+
76+
- name: Install Smithy-Dafny codegen dependencies
77+
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
78+
79+
- name: Regenerate code using smithy-dafny if necessary
80+
if: ${{ inputs.regenerate-code }}
81+
uses: ./.github/actions/polymorph_codegen
82+
with:
83+
dafny: ${{ env.DAFNY_VERSION }}
84+
library: ${{ matrix.library }}
85+
diff-generated-code: false
86+
update-and-regenerate-mpl: true
87+
88+
- name: Setup Python ${{ matrix.python-version }}
89+
uses: actions/setup-python@v4
90+
with:
91+
python-version: ${{ matrix.python-version }}
92+
93+
- name: Setup Python ${{ matrix.python-version }} for running tests
94+
run: |
95+
python -m pip install --upgrade pip
96+
pip install --upgrade tox
97+
pip install poetry
98+
99+
- name: Build Python TestVectors implementation
100+
shell: bash
101+
working-directory: ${{matrix.library}}
102+
run: |
103+
# This works because `node` is installed by default on GHA runners
104+
CORES=$(node -e 'console.log(os.cpus().length)')
105+
make transpile_python CORES=$CORES
106+
107+
- name: Test Python TestVectors with ${{matrix.interface}} interface
108+
working-directory: ${{matrix.library}}
109+
run: |
110+
cp runtimes/java/*.json runtimes/python
111+
make test_python_${{matrix.interface}}_interface

‎.github/workflows/daily_ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,26 @@ jobs:
6161
uses: ./.github/workflows/library_rust_tests.yml
6262
with:
6363
dafny: ${{needs.getVersion.outputs.version}}
64+
daily-ci-python:
65+
needs: getVersion
66+
uses: ./.github/workflows/ci_test_python.yml
67+
with:
68+
dafny: ${{needs.getVersion.outputs.version}}
69+
daily-ci-python-examples:
70+
needs: getVersion
71+
uses: ./.github/workflows/ci_examples_python.yml
72+
with:
73+
dafny: ${{needs.getVersion.outputs.version}}
74+
daily-ci-python-test-vectors:
75+
needs: getVersion
76+
uses: ./.github/workflows/ci_test_vector_python.yml
77+
with:
78+
dafny: ${{needs.getVersion.outputs.version}}
79+
daily-ci-python-static-analysis:
80+
needs: getVersion
81+
uses: ./.github/workflows/ci_static_analysis_python.yml
82+
with:
83+
dafny: ${{needs.getVersion.outputs.version}}
6484
daily-ci-net-test-vectors:
6585
needs: getVersion
6686
uses: ./.github/workflows/ci_test_vector_net.yml

‎.github/workflows/manual.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,26 @@ jobs:
5757
with:
5858
dafny: ${{ inputs.dafny }}
5959
regenerate-code: ${{ inputs.regenerate-code }}
60+
manual-ci-python:
61+
uses: ./.github/workflows/ci_test_python.yml
62+
with:
63+
dafny: ${{ inputs.dafny }}
64+
regenerate-code: ${{ inputs.regenerate-code }}
65+
manual-ci-python-examples:
66+
uses: ./.github/workflows/ci_examples_python.yml
67+
with:
68+
dafny: ${{ inputs.dafny }}
69+
regenerate-code: ${{ inputs.regenerate-code }}
70+
manual-ci-python-test-vectors:
71+
uses: ./.github/workflows/ci_test_vector_python.yml
72+
with:
73+
dafny: ${{ inputs.dafny }}
74+
regenerate-code: ${{ inputs.regenerate-code }}
75+
manual-ci-python-static-analysis:
76+
uses: ./.github/workflows/ci_static_analysis_python.yml
77+
with:
78+
dafny: ${{ inputs.dafny }}
79+
regenerate-code: ${{ inputs.regenerate-code }}
6080
manual-ci-net-test-vectors:
6181
uses: ./.github/workflows/ci_test_vector_net.yml
6282
with:

‎.github/workflows/mpl-head.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,18 @@ jobs:
7373
with:
7474
dafny: ${{needs.getVersion.outputs.version}}
7575
mpl-head: true
76+
mpl-head-ci-python:
77+
needs: getVersion
78+
uses: ./.github/workflows/ci_test_python.yml
79+
with:
80+
dafny: ${{needs.getVersion.outputs.version}}
81+
mpl-head: true
82+
mpl-head-ci-python-examples:
83+
needs: getVersion
84+
uses: ./.github/workflows/ci_examples_python.yml
85+
with:
86+
dafny: ${{needs.getVersion.outputs.version}}
87+
mpl-head: true
7688
mpl-head-ci-net-test-vectors:
7789
needs: getVersion
7890
uses: ./.github/workflows/ci_test_vector_net.yml

‎.github/workflows/nightly.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ jobs:
5858
with:
5959
dafny: "nightly-latest"
6060
regenerate-code: true
61+
dafny-nightly-python:
62+
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
63+
uses: ./.github/workflows/ci_test_python.yml
64+
with:
65+
dafny: "nightly-latest"
66+
regenerate-code: true
67+
dafny-nightly-python-test-vectors:
68+
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
69+
uses: ./.github/workflows/ci_test_vector_python.yml
70+
with:
71+
dafny: "nightly-latest"
72+
regenerate-code: true
6173
dafny-nightly-test-vectors-net:
6274
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
6375
uses: ./.github/workflows/ci_test_vector_net.yml

‎.github/workflows/pull.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,24 @@ jobs:
5454
uses: ./.github/workflows/library_rust_tests.yml
5555
with:
5656
dafny: ${{needs.getVersion.outputs.version}}
57+
pr-ci-python:
58+
needs: getVersion
59+
uses: ./.github/workflows/ci_test_python.yml
60+
with:
61+
dafny: ${{needs.getVersion.outputs.version}}
62+
pr-ci-python-testvectors:
63+
needs: getVersion
64+
uses: ./.github/workflows/ci_test_vector_python.yml
65+
with:
66+
dafny: ${{needs.getVersion.outputs.version}}
67+
pr-ci-python-examples:
68+
needs: getVersion
69+
uses: ./.github/workflows/ci_examples_python.yml
70+
with:
71+
dafny: ${{needs.getVersion.outputs.version}}
72+
pr-ci-python-static-analysis:
73+
needs: getVersion
74+
uses: ./.github/workflows/ci_static_analysis_python.yml
5775
pr-ci-net-test-vectors:
5876
needs: getVersion
5977
uses: ./.github/workflows/ci_test_vector_net.yml
@@ -80,6 +98,10 @@ jobs:
8098
- pr-ci-rust
8199
- pr-ci-net-test-vectors
82100
- pr-ci-net-examples
101+
- pr-ci-python
102+
- pr-ci-python-testvectors
103+
- pr-ci-python-examples
104+
- pr-ci-python-static-analysis
83105
runs-on: ubuntu-22.04
84106
steps:
85107
- name: Verify all required jobs passed

‎.github/workflows/push.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,24 @@ jobs:
5656
uses: ./.github/workflows/library_rust_tests.yml
5757
with:
5858
dafny: ${{needs.getVersion.outputs.version}}
59+
pr-ci-python:
60+
needs: getVersion
61+
uses: ./.github/workflows/ci_test_python.yml
62+
with:
63+
dafny: ${{needs.getVersion.outputs.version}}
64+
pr-ci-python-examples:
65+
needs: getVersion
66+
uses: ./.github/workflows/ci_examples_python.yml
67+
with:
68+
dafny: ${{needs.getVersion.outputs.version}}
69+
pr-ci-python-static-analysis:
70+
needs: getVersion
71+
uses: ./.github/workflows/ci_static_analysis_python.yml
72+
pr-ci-python-test-vectors:
73+
needs: getVersion
74+
uses: ./.github/workflows/ci_test_vector_python.yml
75+
with:
76+
dafny: ${{needs.getVersion.outputs.version}}
5977
pr-ci-net-test-vectors:
6078
needs: getVersion
6179
uses: ./.github/workflows/ci_test_vector_net.yml
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
[tox]
2+
isolated_build = True
3+
envlist =
4+
py{311,312,313}-{dafnytests,unit,integ},
5+
encrypted-interface-coverage,
6+
client-to-resource-conversions-coverage,
7+
resource-to-client-conversions-coverage,
8+
docs,
9+
isort-check,
10+
black-check
11+
12+
[testenv:base-command]
13+
commands = poetry run pytest -s -v -l {posargs}
14+
15+
[testenv]
16+
skip_install = true
17+
allowlist_externals = poetry,ruff,black
18+
passenv = AWS_*
19+
commands_pre =
20+
poetry lock
21+
poetry install --with test
22+
commands =
23+
dafnytests: {[testenv:base-command]commands} test/internaldafny/
24+
unit: {[testenv:base-command]commands} test/unit/
25+
integ: {[testenv:base-command]commands} test/integ/
26+
27+
[testenv:encrypted-interface-coverage]
28+
description = Run integ + unit tests for encrypted interfaces with coverage
29+
commands =
30+
python -m pytest -s -vv \
31+
test/integ/encrypted \
32+
test/unit/encrypted \
33+
--cov aws_dbesdk_dynamodb.encrypted \
34+
--cov-report=term-missing \
35+
--cov-fail-under=100
36+
37+
[testenv:client-to-resource-conversions-coverage]
38+
description = Run boto3 conversion tests with coverage
39+
commands =
40+
python -m pytest -s -vv \
41+
test/unit/internal/test_client_to_resource.py \
42+
--cov aws_dbesdk_dynamodb.internal.client_to_resource \
43+
--cov-report=term-missing \
44+
--cov-fail-under=100
45+
46+
[testenv:resource-to-client-conversions-coverage]
47+
description = Run boto3 conversion tests with coverage
48+
commands =
49+
python -m pytest -s -vv \
50+
test/unit/internal/test_resource_to_client.py \
51+
--cov aws_dbesdk_dynamodb.internal.resource_to_client \
52+
--cov-report=term-missing \
53+
--cov-fail-under=100
54+
55+
# Linters
56+
[testenv:ruff]
57+
commands_pre =
58+
poetry install --with linting
59+
deps =
60+
ruff
61+
commands =
62+
ruff check \
63+
src/aws_dbesdk_dynamodb/ \
64+
../../../Examples/runtimes/python/DynamoDBEncryption/ \
65+
test/ \
66+
{posargs}
67+
68+
[testenv:blacken]
69+
commands_pre =
70+
poetry install --with linting
71+
deps =
72+
black
73+
basepython = python3
74+
commands =
75+
black --line-length 120 \
76+
src/aws_dbesdk_dynamodb/ \
77+
../../../Examples/runtimes/python/DynamoDBEncryption/ \
78+
test/ \
79+
{posargs}
80+
81+
[testenv:black-check]
82+
commands_pre =
83+
{[testenv:blacken]commands_pre}
84+
basepython = python3
85+
deps =
86+
{[testenv:blacken]deps}
87+
commands =
88+
{[testenv:blacken]commands} --diff --check
89+
90+
[testenv:lint]
91+
commands_pre =
92+
poetry install --with linting
93+
deps =
94+
black
95+
basepython = python3
96+
commands =
97+
{[testenv:blacken]commands}
98+
{[testenv:ruff]commands} --fix
99+
100+
[testenv:lint-check]
101+
commands_pre =
102+
poetry install --with linting
103+
deps =
104+
black
105+
basepython = python3
106+
commands =
107+
{[testenv:black-check]commands}
108+
{[testenv:ruff]commands}

‎Examples/runtimes/python/tox.ini

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[tox]
2+
isolated_build = True
3+
envlist =
4+
py{311,312,313}-{dynamodbencryption,migration}
5+
6+
[testenv:base-command]
7+
commands = poetry run pytest -s -v -l {posargs}
8+
9+
[testenv]
10+
skip_install = true
11+
allowlist_externals = poetry
12+
passenv = AWS_*
13+
commands_pre =
14+
poetry lock
15+
poetry install --with test --no-root
16+
commands =
17+
dynamodbencryption: {[testenv:base-command]commands} DynamoDBEncryption/test/
18+
migration: {[testenv:base-command]commands} Migration/PlaintextToAWSDBE/test/

‎TestVectors/runtimes/python/tox.ini

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[tox]
2+
isolated_build = True
3+
envlist =
4+
py{311,312,313}
5+
6+
[testenv]
7+
skip_install = true
8+
allowlist_externals = poetry
9+
passenv = AWS_*
10+
commands_pre =
11+
poetry lock
12+
poetry install
13+
commands =
14+
poetry run pytest test/ -s -v
15+
16+
[testenv:client]
17+
commands =
18+
poetry run pytest test/client -s -v
19+
20+
[testenv:resource]
21+
commands =
22+
poetry run pytest test/resource -s -v
23+
24+
[testenv:table]
25+
commands =
26+
poetry run pytest test/table -s -v

0 commit comments

Comments
 (0)
Please sign in to comment.