Local development
Install uv and Python 3.12 (uv python install 3.12).
The private Payability packages are installed from GitHub tags, and uv.lock pins each tag to a commit:
-
pybsdkfrom Payability/pyb-sdk, tag2.0.0 -
eventloggerfrom Payability/EventLoggerPySDK, tag1.0.0 -
pyb-cdk-v2from Payability/pyb-cdk-v2, tagv0.2.0
$ uv sync --frozen
uv sync clones those repositories with your normal git credentials.
Tasks
$ make sync # uv sync --frozen
$ make format # ruff format and autofix
$ make lint # ruff and mypy
$ make test # unit tests (with coverage) and integration tests
$ make test-unit
$ make test-integration
$ make lambda-reqs # write Lambda requirements.txt from uv.lock
$ make synth ENV=development
$ make deploy ENV=development
Pass extra pytest arguments with PYB_ENV=test uv run pytest tests/unit/ -x.
make test-unit -- is not a way to forward arguments.
Unit tests write report_unit.xml and coverage.xml.
Integration tests write report_integration.xml.
Pytest exit code 5 (no tests collected) is not a failure for the integration target.
Install the git hook with uv run pre-commit install.
Lambda requirements
make lambda-reqs writes two files that are not committed:
-
oppa-common/requirements.txt, installed into the shared layer byoppa-common/Dockerfile -
oppa-mailbox-checker/requirements.txt, bundled into that function. Packages already provided byoppa-commonare removed.
make synth and make deploy generate those files first.
The layer’s Docker build installs pybsdk and eventlogger from GitHub.
That image is built on every synth, so every CDK command (synth, diff, deploy, including deploy CD) needs GITHUB_TOKEN.
make synth and make deploy fill it from gh auth token when it is unset.
When you call npx aws-cdk directly, run export GITHUB_TOKEN="$(gh auth token)" first.
Local synth and deploy use CDK CLI 2.1147.0 through npx.
That CLI is versioned separately from aws-cdk-lib. An older global cdk cannot read the cloud assembly.