This guide provides high-signal context for AI agents working in this repository.
- Type: Python SDK for ApertureDB.
- Entrypoints: The core package is in the
aperturedb/directory. - CLI: Provides the
adbCLI tool, mapped toaperturedb.cli.adb:app. - Packaging: Uses
setuptoolswith configurations defined inpyproject.toml.
- Formatting: CI strictly enforces
autopep8and trailing whitespace checks. If you modify code, ensure it aligns with these standards. You can usepre-commit run --all-filesif pre-commit is installed, or rely onautopep8. - Dependencies: Extra dependencies are organized in
pyproject.toml(e.g.[complete],[notebook],[dev]). When running locally, a standard dev installation ispip install -e '.[dev]'.
The test suite is located in test/ and heavily relies on a local isolated container environment. It is NOT a standard simple pytest suite.
- The full suite orchestrates
aperturedb,lenz, andnginxcontainers using Docker Compose. - Crucial for Agents: To run tests without AWS/GCP credentials (which agents typically lack), you must use
SKIP_SLOW_TESTS=true. - To build the test image and run the full suite:
# Build the image using the CI script source version.sh && NO_PUSH=true RUN_TESTS=true BUILD_AUX_IMAGES=false bash ci.sh # OR build manually if needed: # mkdir -p docker/tests/aperturedata && cp -r aperturedb pyproject.toml README.md docker/tests/aperturedata && mkdir -p docker/tests/aperturedata/test/aperturedb && cp -r test/*.py test/*.sh test/input docker/tests/aperturedata/test && docker build -t aperturedata/aperturedb-python-tests:latest -f docker/tests/Dockerfile .
- If the test image is already built, you can run the suite directly:
cd test set -a && source .env && set +a SKIP_SLOW_TESTS=true bash run_test_container.sh
If you only need to run a single test file (e.g. test_Session.py) and don't want to run the full containerized suite:
- Bring up the environment in the background:
cd test docker compose up -d
- Update
test/dbinfo.pyto map the local exposed ports (find them viadocker compose port lenz 55551anddocker compose port nginx 443). - Execute the single test:
PROJECT=aperturedata KAGGLE_username=ci KAGGLE_key=dummy python3 -m pytest test_Session.py -v -s --log-cli-level=DEBUG
PytestUnknownMarkWarning: Forslow,external_network,remote_credentials,tcp,http,dask. Tests still filter correctly.CoverageWarning: No data was collected: Known limitation of the containerized setup.Port 8787 is already in use: Dask parallel run conflict, Dask auto-reassigns port. Ignore these warnings during a successful test run.
- Prefer executable sources of truth: if tests fail, look at the container output and
.logfiles generated intest/output/client/. run_test.shis mounted into the test container as a volume; edits to it apply locally without a container rebuild.- When generating ML placeholders or dummy assets, keep them minimal. The test environment has built-in dummy generation via
generateInput.pyanddownload_images.py.