continuo-python-runtime 0.13.0__tar.gz → 0.14.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/.github/workflows/publish-pypi.yml +2 -2
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/CHANGELOG.md +69 -2
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/PKG-INFO +89 -6
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/README.md +87 -4
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/cli.py +78 -6
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/contract/loader.py +42 -11
- continuo_python_runtime-0.14.0/continuo_python_runtime/contract/ontology_check.py +89 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/docs/boundary-contract.md +62 -6
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/image-requirements-duckdb.txt +1 -1
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/image-requirements-postgres.txt +1 -1
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/image-requirements-trino.txt +1 -1
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/pyproject.toml +2 -2
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/template/Dockerfile +1 -1
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/conftest.py +46 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/contract/test_loader.py +133 -2
- continuo_python_runtime-0.14.0/tests/contract/test_ontology_check.py +191 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/contract/test_pack.py +20 -1
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/odcs_builder.py +24 -11
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_cli.py +200 -2
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_contract_pin_consistency.py +3 -3
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_harness.py +13 -1
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_packages.py +2 -2
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_template.py +1 -1
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/uv.lock +5 -5
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/.claude/agents/ddd-architecture-auditor.md +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/.dockerignore +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/.github/CODEOWNERS +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/.github/dependabot.yml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/.github/workflows/ci.yml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/.github/workflows/dco.yml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/.github/workflows/image-build.yml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/.github/workflows/image-smoke.yml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/.github/workflows/images.yml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/.github/workflows/release.yml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/.github/workflows/security.yml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/.github/workflows/verify-packages.yml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/.gitignore +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/.gitleaks.toml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/.python-version +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/CLAUDE.md +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/CODE_OF_CONDUCT.md +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/CONTRIBUTING.md +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/DCO +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/Dockerfile.duckdb +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/Dockerfile.postgres +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/Dockerfile.trino +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/LICENSE +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/NOTICE +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/SECURITY.md +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/README.md +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/continuo_duckdb_adapter/__init__.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/continuo_duckdb_adapter/adapter.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/continuo_duckdb_adapter/application/__init__.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/continuo_duckdb_adapter/application/ports.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/continuo_duckdb_adapter/application/warehouse.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/continuo_duckdb_adapter/domain/__init__.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/continuo_duckdb_adapter/domain/columns.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/continuo_duckdb_adapter/domain/identifiers.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/continuo_duckdb_adapter/domain/layout.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/continuo_duckdb_adapter/infrastructure/__init__.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/continuo_duckdb_adapter/infrastructure/ddl.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/continuo_duckdb_adapter/infrastructure/extensions.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/continuo_duckdb_adapter/infrastructure/passfile.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/continuo_duckdb_adapter/infrastructure/session.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/continuo_duckdb_adapter/infrastructure/settings.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/pyproject.toml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/tests/__init__.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/tests/conftest.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/tests/test_adapter_duckdb_proxy.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/tests/test_adapter_duckdb_runtime.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/tests/test_adapter_duckdb_validation.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/tests/test_adapter_duckdb_wiring.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/tests/test_domain_duckdb_columns.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/tests/test_domain_duckdb_identifiers.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/tests/test_domain_duckdb_layout.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/tests/test_infra_duckdb_session.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/tests/test_infra_duckdb_settings_ddl.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/tests/test_integration_duckdb_conformance.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/tests/test_integration_duckdb_entrypoint.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/tests/test_integration_duckdb_layout.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/tests/test_integration_duckdb_nullability_probe.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/tests/test_integration_duckdb_runtime.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/tests/test_integration_duckdb_seed_preflight.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/tests/test_integration_duckdb_stack.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/duckdb/tests/test_integration_duckdb_validation.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/postgres/README.md +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/postgres/continuo_postgres_adapter/__init__.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/postgres/continuo_postgres_adapter/adapter.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/postgres/pyproject.toml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/postgres/tests/__init__.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/postgres/tests/conftest.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/postgres/tests/test_adapter_postgres_connect.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/postgres/tests/test_adapter_postgres_validation.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/postgres/tests/test_adapter_runtime_postgres.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/postgres/tests/test_integration_postgres_conformance.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/postgres/tests/test_integration_postgres_dependents.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/postgres/tests/test_integration_postgres_entrypoint.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/postgres/tests/test_integration_postgres_seed_preflight.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/postgres/tests/test_integration_postgres_validation.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/postgres/tests/test_integration_runtime_postgres.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/trino/README.md +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/trino/continuo_trino_adapter/__init__.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/trino/continuo_trino_adapter/adapter.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/trino/pyproject.toml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/trino/tests/__init__.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/trino/tests/test_adapter_runtime_trino.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/trino/tests/test_adapter_trino_connect.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/trino/tests/test_adapter_trino_dependents.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/trino/tests/test_adapter_trino_validation.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/trino/tests/test_adapter_trino_writes.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/trino/tests/test_integration_runtime_trino.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/trino/tests/test_integration_trino_conformance.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/trino/tests/test_integration_trino_entrypoint.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/trino/tests/test_integration_trino_merge_probe.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/trino/tests/test_integration_trino_seed_preflight.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/adapters/trino/tests/test_integration_trino_validation.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/conftest.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/__init__.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/closure.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/conform.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/content_check.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/context.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/contract/__init__.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/contract/kinds.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/contract/model.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/contract/pack.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/contract/paths.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/contract/read_tables.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/csv_loader.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/csv_readers/__init__.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/csv_readers/https.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/csv_readers/s3.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/csv_source.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/errors.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/harness.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/hash_inputs.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/hashing.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/lint.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/packages.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/shape.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/types.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/validation/__init__.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/validation/preflight.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/validation/runner.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/validation/s3.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/LICENSE +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/NOTICE +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/README.md +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/continuo_engine_contract/__init__.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/continuo_engine_contract/config.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/continuo_engine_contract/keys.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/continuo_engine_contract/port.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/continuo_engine_contract/result.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/continuo_engine_contract/sql.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/continuo_engine_contract/testing/__init__.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/continuo_engine_contract/testing/conformance.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/continuo_engine_contract/types.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/pyproject.toml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/tests/__init__.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/tests/test_config.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/tests/test_conformance_suite.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/tests/test_contract_keys.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/tests/test_contract_packaging.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/tests/test_contract_types.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/tests/test_port.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/tests/test_result.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/tests/test_sql.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/contract/tests/test_startup_conformance.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/scripts/apply_rehearsal_version.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/scripts/bake_duckdb_extensions.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/scripts/check_version_bumps.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/scripts/install_image_pins.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/scripts/security-scan.sh +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/scripts/verify_installed_packages.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/template/.github/workflows/release.yml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/template/Dockerfile.pip +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/template/README.md +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/template/contracts/example.odcs.yaml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/template/contracts/example_csv.odcs.yaml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/template/requirements.lock +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/template/scripts/example.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/__init__.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/contract/__init__.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/contract/test_kinds.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/contract/test_model.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/contract/test_read_tables.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/contract/test_write_modes.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/fixtures/demo/service-py/contracts/demo_orders_csv.odcs.yaml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/fixtures/demo/service-py/contracts/fx_eur_usd_rates.odcs.yaml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/fixtures/demo/service-py/contracts/py_daily_kpis.odcs.yaml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/fixtures/demo/service-py/old/demo_orders_csv.yml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/fixtures/demo/service-py/old/fx_eur_usd_rates.yml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/fixtures/demo/service-py/old/py_daily_kpis.yml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/fixtures/write_modes/append_node.odcs.yaml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/fixtures/write_modes/assets_node.odcs.yaml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/fixtures/write_modes/replace_node.odcs.yaml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/fixtures/write_modes/upsert_node.odcs.yaml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/smoke/duckdb-stack/docker-compose.yml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/smoke/node_smoke/contracts/smoke.odcs.yaml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/smoke/node_smoke/scripts/smoke.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/smoke/postgres-stack/docker-compose.yml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/smoke/trino-stack/catalog/iceberg.properties +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/smoke/trino-stack/docker-compose.yml +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_adapter_naming.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_check_version_bumps_tags.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_ci_test_coverage.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_closure.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_conform.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_context.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_contract_loader.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_csv_loader.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_csv_readers_https.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_csv_readers_integration.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_csv_source.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_entrypoint_shims.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_errors.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_harness_content_check.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_harness_write_modes.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_hashing.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_hashing_vectors.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_image_requirements_sync.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_image_smoke_validation.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_install_image_pins.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_kind_registries.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_lint.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_no_legacy_names.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_package.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_projection_vectors.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_python_version_consistency.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_rehearsal_version.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_release_pipeline_structure.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_shape.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_types.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_validation_preflight.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_validation_runner.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_validation_s3.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_verify_installed_packages.py +0 -0
- {continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/tests/test_write_contract_fixture.py +0 -0
{continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/.github/workflows/publish-pypi.yml
RENAMED
|
@@ -250,7 +250,7 @@ jobs:
|
|
|
250
250
|
# Pinned to a commit SHA. release/v1 is a moving branch, and this job
|
|
251
251
|
# holds id-token: write for PyPI Trusted Publishing — a compromised
|
|
252
252
|
# revision could mint a token and publish under this project's name.
|
|
253
|
-
uses: pypa/gh-action-pypi-publish@
|
|
253
|
+
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # release/v1
|
|
254
254
|
with:
|
|
255
255
|
repository-url: https://test.pypi.org/legacy/
|
|
256
256
|
packages-dir: dist
|
|
@@ -263,7 +263,7 @@ jobs:
|
|
|
263
263
|
# guard in `prepare` is what catches that case.
|
|
264
264
|
- name: Publish to PyPI
|
|
265
265
|
if: needs.prepare.outputs.mode == 'real'
|
|
266
|
-
uses: pypa/gh-action-pypi-publish@
|
|
266
|
+
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # release/v1
|
|
267
267
|
with:
|
|
268
268
|
packages-dir: dist
|
|
269
269
|
skip-existing: true
|
|
@@ -5,6 +5,73 @@ follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.14.0] - 2026-11-21
|
|
9
|
+
|
|
10
|
+
**TL;DR**
|
|
11
|
+
|
|
12
|
+
- The runtime pins continuo-contracts 0.4.1. A Python contract may carry the
|
|
13
|
+
ontology's binding properties (`entity`, `grain`, `fixed` and `filter` on the
|
|
14
|
+
table, `property`, `local` and `aggregate` on a column). A binding of the
|
|
15
|
+
wrong shape is refused, naming the file.
|
|
16
|
+
- `continuo-runtime validate --service <name> --ontology <file>` checks a
|
|
17
|
+
service's contracts against the company's ontology file with the rules a
|
|
18
|
+
release runs over one service, and refuses an ontology file that the
|
|
19
|
+
library's own ontology rule rejects. `--service` alone refuses a contract
|
|
20
|
+
that names another service.
|
|
21
|
+
- A node's hashes are the same with or without bindings. No node changes its
|
|
22
|
+
`content_hash` by moving to 0.14.0.
|
|
23
|
+
|
|
24
|
+
**Upgrade**
|
|
25
|
+
|
|
26
|
+
1. Nothing is required. To move a service, build its image `FROM` the `v0.14.0`
|
|
27
|
+
engine image; CI installs `continuo-python-runtime==0.14.0` from the `FROM`
|
|
28
|
+
line.
|
|
29
|
+
2. Release a service on the `v0.14.0` image only to a continuo install that
|
|
30
|
+
runs continuo-contracts 0.4.1 or later. `pack` records the library version
|
|
31
|
+
in the bundle, and continuo refuses a bundle written by a newer library than
|
|
32
|
+
its own. continuo accepts it from the first chart release whose CHANGELOG
|
|
33
|
+
names continuo-contracts 0.4.1.
|
|
34
|
+
3. To check bindings in CI, see "Checking against the ontology" in the README.
|
|
35
|
+
A company that does not use the ontology changes nothing.
|
|
36
|
+
|
|
37
|
+
Versions: runtime 0.14.0 (pins continuo-contracts 0.4.1), engine contract 0.10.0, postgres adapter 0.4.0, trino adapter 0.5.0, duckdb adapter 0.3.0.
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
|
|
41
|
+
- `continuo-runtime validate` takes `--service <name>` and `--ontology <file>`.
|
|
42
|
+
With `--service`, a contract whose `service` property names another service is
|
|
43
|
+
refused, as `pack` refuses it. `--ontology` needs `--service`: it checks every
|
|
44
|
+
contract of the folder against the company's ontology file with the rules a
|
|
45
|
+
release runs over one service. Each finding is logged as
|
|
46
|
+
`<severity> [<rule>] <subject>: <message>`, at the level of its severity,
|
|
47
|
+
followed by one INFO line that counts them, and the command exits 1 when any
|
|
48
|
+
finding is an error. A service the ontology does not declare gets one
|
|
49
|
+
information line and one warning for each contract that writes bindings, and
|
|
50
|
+
exits 0. An ontology file that cannot be read, is not an ontology, or is one
|
|
51
|
+
the library's `ontology` rule refuses (a thing owned by a domain the file does
|
|
52
|
+
not declare, for example) gives one error line and exit 1, whatever the
|
|
53
|
+
service; the line of a refused file points to
|
|
54
|
+
`continuo-contracts ontology check`. Without the two flags `validate` is
|
|
55
|
+
unchanged, and it prints nothing to stdout.
|
|
56
|
+
|
|
57
|
+
### Changed
|
|
58
|
+
|
|
59
|
+
- The runtime pins `continuo-contracts==0.4.1`. A Python contract may now carry
|
|
60
|
+
the ontology's binding properties: `entity`, `grain`, `fixed` and `filter` on
|
|
61
|
+
the table, `property`, `local` and `aggregate` on a column. The loader,
|
|
62
|
+
`validate`, `pack` and the harness accept them, `pack` writes them into the
|
|
63
|
+
bundle as the file has them, and a node's hashes are the same with or without
|
|
64
|
+
them. A binding whose value has the wrong shape is refused with a `value`
|
|
65
|
+
issue that names the file, by `validate`, `pack` and the harness at start,
|
|
66
|
+
whatever the flags say.
|
|
67
|
+
- The README's engine examples and the template's `Dockerfile` build on the
|
|
68
|
+
`v0.14.0` engine images, the first with `validate --service` and
|
|
69
|
+
`validate --ontology`. The README says how a team adds the ontology check to
|
|
70
|
+
its CI, with a copy of the company's ontology file kept in the team's own
|
|
71
|
+
repository; the boundary-contract guide lists the bindings a contract may
|
|
72
|
+
carry and points to the README for the check. The template's workflow is
|
|
73
|
+
unchanged: a company without an ontology adds nothing.
|
|
74
|
+
|
|
8
75
|
## [0.13.0] - 2026-11-16
|
|
9
76
|
|
|
10
77
|
**TL;DR**
|
|
@@ -29,8 +96,8 @@ follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
29
96
|
`continuo-runtime pack contracts/ --service <name> --repo-root . --image <pushed image> --out odcs-bundle.json`.
|
|
30
97
|
4. Upload `odcs-bundle.json` to
|
|
31
98
|
`s3://<bucket>/<service>/<release_id>/odcs-bundle.json` and post the release
|
|
32
|
-
with kind `python-odcs
|
|
33
|
-
|
|
99
|
+
with kind `python-odcs`. continuo accepts that kind from the first chart
|
|
100
|
+
release whose CHANGELOG names it.
|
|
34
101
|
|
|
35
102
|
Versions: runtime 0.13.0 (pins continuo-contracts 0.2.0), engine contract 0.10.0, postgres adapter 0.4.0, trino adapter 0.5.0, duckdb adapter 0.3.0.
|
|
36
103
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: continuo-python-runtime
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.14.0
|
|
4
4
|
Summary: Runtime harness, contract tooling, and CI lint for Continuo python nodes.
|
|
5
5
|
Author: Simone Carolini
|
|
6
6
|
Maintainer: Simone Carolini
|
|
@@ -12,7 +12,7 @@ Classifier: Intended Audience :: Developers
|
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.14
|
|
13
13
|
Requires-Python: >=3.14
|
|
14
14
|
Requires-Dist: boto3==1.43.114
|
|
15
|
-
Requires-Dist: continuo-contracts==0.
|
|
15
|
+
Requires-Dist: continuo-contracts==0.4.1
|
|
16
16
|
Requires-Dist: continuo-engine-contract==0.10.0
|
|
17
17
|
Requires-Dist: pyarrow==26.0.0
|
|
18
18
|
Requires-Dist: pyyaml==6.0.3
|
|
@@ -197,7 +197,10 @@ schema:
|
|
|
197
197
|
`vendor: continuo`. Every node sets `schedule` and `criticality`
|
|
198
198
|
(`REGULATORY`, `CORE` or `SECONDARY`); the node's kind decides the rest
|
|
199
199
|
(see "Node kinds" below). An optional `service` names the node's service,
|
|
200
|
-
and `pack`
|
|
200
|
+
and `pack` and `validate --service` refuse a contract whose `service` is not
|
|
201
|
+
their `--service`.
|
|
202
|
+
- A contract may also bind its table and its columns to the company's ontology
|
|
203
|
+
(see "Checking against the ontology" below).
|
|
201
204
|
- The contract has exactly one schema object, `physicalType: table`. Its
|
|
202
205
|
`properties` are the table's columns, in order: each has a `name`, a
|
|
203
206
|
`physicalType` (`BIGINT`, `INTEGER` or `INT`, `DOUBLE PRECISION`,
|
|
@@ -236,6 +239,86 @@ The harness does not run these read checks again when a node starts, so a
|
|
|
236
239
|
read that passes here is not judged again under a different grammar in
|
|
237
240
|
production. See `docs/boundary-contract.md` §13.1.
|
|
238
241
|
|
|
242
|
+
### Checking against the ontology
|
|
243
|
+
|
|
244
|
+
A company that keeps an ontology file, the things its data is about and the
|
|
245
|
+
services that own them, can have each contract bind its table and its columns
|
|
246
|
+
to it. The bindings are optional `continuo` properties: `entity`, `grain`,
|
|
247
|
+
`fixed` and `filter` on the schema object, and `property`, `local` and
|
|
248
|
+
`aggregate` on a column (`docs/boundary-contract.md` gives their values):
|
|
249
|
+
|
|
250
|
+
```yaml
|
|
251
|
+
schema:
|
|
252
|
+
- name: example
|
|
253
|
+
physicalType: table
|
|
254
|
+
customProperties:
|
|
255
|
+
- {vendor: continuo, property: entity, value: Order}
|
|
256
|
+
properties:
|
|
257
|
+
- name: order_id
|
|
258
|
+
physicalType: INTEGER
|
|
259
|
+
required: true
|
|
260
|
+
customProperties:
|
|
261
|
+
- {vendor: continuo, property: property, value: Order.order_id}
|
|
262
|
+
- name: note
|
|
263
|
+
physicalType: "VARCHAR(64)"
|
|
264
|
+
customProperties:
|
|
265
|
+
- {vendor: continuo, property: local, value: true}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
If `Order` has a key part or a property named `order_id`, the check would bind
|
|
269
|
+
that column itself; the binding is written out for clarity.
|
|
270
|
+
|
|
271
|
+
A contract with bindings loads, validates, packs and runs like any other, and
|
|
272
|
+
its `content_hash` is the one it has without them. To check the bindings in your
|
|
273
|
+
CI, keep a copy of the company's ontology file in your own repository, for
|
|
274
|
+
example at `ontology/ontology.yaml`, and give `validate` the name of your
|
|
275
|
+
service and the path of that copy:
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
continuo-runtime validate contracts --service <name> --ontology ontology/ontology.yaml
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
Copy the file from the company's ontology repository, never from continuo, and
|
|
282
|
+
keep it outside `contracts/`, where `validate` refuses any other YAML file. The
|
|
283
|
+
copy is yours to keep current: when the ontology changes, you update it. A copy
|
|
284
|
+
that is behind the ontology can pass here and still be refused by the release,
|
|
285
|
+
which checks against the ontology the install runs. The library's dbt check,
|
|
286
|
+
`continuo-contracts dbt check`, takes the same file with `--ontology`.
|
|
287
|
+
|
|
288
|
+
`--service` alone refuses a contract whose `service` property names another
|
|
289
|
+
service. `--ontology` needs `--service`; without it `validate` exits 2. With
|
|
290
|
+
both, every contract is checked as a contract of that service by the rules of
|
|
291
|
+
`continuo-contracts` that need no other service: `contract`, `coverage`,
|
|
292
|
+
`quality` and `privacy`. The rules that read the whole estate (`access`,
|
|
293
|
+
`order` and `drift`) cannot run on one service's contracts and are not run
|
|
294
|
+
here. `validate` logs, on stderr and at the level of its severity (ERROR,
|
|
295
|
+
WARNING or INFO), one line for each finding,
|
|
296
|
+
`<severity> [<rule>] <subject>: <message>`, then one INFO line that counts them,
|
|
297
|
+
`<e> error(s), <w> warning(s), <i> info: <name>`. It exits 1 when any finding is
|
|
298
|
+
an error and 0 otherwise, and it prints nothing to stdout.
|
|
299
|
+
|
|
300
|
+
- When the ontology declares the service, each contract names exactly one of
|
|
301
|
+
`entity` or `grain`, so a contract that names neither, or both, is an error.
|
|
302
|
+
A column that carries no binding is a warning, unless its name is a key part
|
|
303
|
+
or a property of the table's entity, in which case the check binds it itself.
|
|
304
|
+
- When the ontology does not declare the service, none of its contracts is
|
|
305
|
+
checked: `validate` logs one INFO line, `not declared in the ontology: none
|
|
306
|
+
of this service's contracts is checked`, and one WARNING for each contract
|
|
307
|
+
that writes bindings, and exits 0.
|
|
308
|
+
- A file that cannot be read, is not UTF-8 text or is not an ontology is one
|
|
309
|
+
ERROR line, `<file>: <reason>`, and exit 1. The reason of an invalid
|
|
310
|
+
ontology is the library's, with the path to the first fault.
|
|
311
|
+
- A file that is an ontology but that the library's `ontology` rule refuses (a
|
|
312
|
+
thing owned by a domain the file does not declare, a service of a domain it
|
|
313
|
+
does not declare, a personal property no access rule names) is refused the
|
|
314
|
+
same way, whatever the service, and no contract is checked against it: one
|
|
315
|
+
ERROR line, `<file>: the ontology file has <n> error(s): run
|
|
316
|
+
continuo-contracts ontology check <file>`, and exit 1. That command lists the
|
|
317
|
+
errors. Findings of that rule that are not errors do not stop the check.
|
|
318
|
+
|
|
319
|
+
A company without an ontology adds nothing: without the two flags `validate`
|
|
320
|
+
runs the checks above and no others.
|
|
321
|
+
|
|
239
322
|
## Node kinds
|
|
240
323
|
|
|
241
324
|
The `kind` property (a `customProperties` item, not the contract's root
|
|
@@ -471,11 +554,11 @@ A domain repo picks its warehouse engine by which base image it builds
|
|
|
471
554
|
`FROM`:
|
|
472
555
|
|
|
473
556
|
```dockerfile
|
|
474
|
-
FROM ghcr.io/carolsimone/continuo-python-runtime-postgres:v0.
|
|
557
|
+
FROM ghcr.io/carolsimone/continuo-python-runtime-postgres:v0.14.0
|
|
475
558
|
# or
|
|
476
|
-
FROM ghcr.io/carolsimone/continuo-python-runtime-trino:v0.
|
|
559
|
+
FROM ghcr.io/carolsimone/continuo-python-runtime-trino:v0.14.0
|
|
477
560
|
# or
|
|
478
|
-
FROM ghcr.io/carolsimone/continuo-python-runtime-duckdb:v0.
|
|
561
|
+
FROM ghcr.io/carolsimone/continuo-python-runtime-duckdb:v0.14.0
|
|
479
562
|
```
|
|
480
563
|
|
|
481
564
|
The engine is part of the image **name**; the tag is the bare version, so
|
|
@@ -176,7 +176,10 @@ schema:
|
|
|
176
176
|
`vendor: continuo`. Every node sets `schedule` and `criticality`
|
|
177
177
|
(`REGULATORY`, `CORE` or `SECONDARY`); the node's kind decides the rest
|
|
178
178
|
(see "Node kinds" below). An optional `service` names the node's service,
|
|
179
|
-
and `pack`
|
|
179
|
+
and `pack` and `validate --service` refuse a contract whose `service` is not
|
|
180
|
+
their `--service`.
|
|
181
|
+
- A contract may also bind its table and its columns to the company's ontology
|
|
182
|
+
(see "Checking against the ontology" below).
|
|
180
183
|
- The contract has exactly one schema object, `physicalType: table`. Its
|
|
181
184
|
`properties` are the table's columns, in order: each has a `name`, a
|
|
182
185
|
`physicalType` (`BIGINT`, `INTEGER` or `INT`, `DOUBLE PRECISION`,
|
|
@@ -215,6 +218,86 @@ The harness does not run these read checks again when a node starts, so a
|
|
|
215
218
|
read that passes here is not judged again under a different grammar in
|
|
216
219
|
production. See `docs/boundary-contract.md` §13.1.
|
|
217
220
|
|
|
221
|
+
### Checking against the ontology
|
|
222
|
+
|
|
223
|
+
A company that keeps an ontology file, the things its data is about and the
|
|
224
|
+
services that own them, can have each contract bind its table and its columns
|
|
225
|
+
to it. The bindings are optional `continuo` properties: `entity`, `grain`,
|
|
226
|
+
`fixed` and `filter` on the schema object, and `property`, `local` and
|
|
227
|
+
`aggregate` on a column (`docs/boundary-contract.md` gives their values):
|
|
228
|
+
|
|
229
|
+
```yaml
|
|
230
|
+
schema:
|
|
231
|
+
- name: example
|
|
232
|
+
physicalType: table
|
|
233
|
+
customProperties:
|
|
234
|
+
- {vendor: continuo, property: entity, value: Order}
|
|
235
|
+
properties:
|
|
236
|
+
- name: order_id
|
|
237
|
+
physicalType: INTEGER
|
|
238
|
+
required: true
|
|
239
|
+
customProperties:
|
|
240
|
+
- {vendor: continuo, property: property, value: Order.order_id}
|
|
241
|
+
- name: note
|
|
242
|
+
physicalType: "VARCHAR(64)"
|
|
243
|
+
customProperties:
|
|
244
|
+
- {vendor: continuo, property: local, value: true}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
If `Order` has a key part or a property named `order_id`, the check would bind
|
|
248
|
+
that column itself; the binding is written out for clarity.
|
|
249
|
+
|
|
250
|
+
A contract with bindings loads, validates, packs and runs like any other, and
|
|
251
|
+
its `content_hash` is the one it has without them. To check the bindings in your
|
|
252
|
+
CI, keep a copy of the company's ontology file in your own repository, for
|
|
253
|
+
example at `ontology/ontology.yaml`, and give `validate` the name of your
|
|
254
|
+
service and the path of that copy:
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
continuo-runtime validate contracts --service <name> --ontology ontology/ontology.yaml
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Copy the file from the company's ontology repository, never from continuo, and
|
|
261
|
+
keep it outside `contracts/`, where `validate` refuses any other YAML file. The
|
|
262
|
+
copy is yours to keep current: when the ontology changes, you update it. A copy
|
|
263
|
+
that is behind the ontology can pass here and still be refused by the release,
|
|
264
|
+
which checks against the ontology the install runs. The library's dbt check,
|
|
265
|
+
`continuo-contracts dbt check`, takes the same file with `--ontology`.
|
|
266
|
+
|
|
267
|
+
`--service` alone refuses a contract whose `service` property names another
|
|
268
|
+
service. `--ontology` needs `--service`; without it `validate` exits 2. With
|
|
269
|
+
both, every contract is checked as a contract of that service by the rules of
|
|
270
|
+
`continuo-contracts` that need no other service: `contract`, `coverage`,
|
|
271
|
+
`quality` and `privacy`. The rules that read the whole estate (`access`,
|
|
272
|
+
`order` and `drift`) cannot run on one service's contracts and are not run
|
|
273
|
+
here. `validate` logs, on stderr and at the level of its severity (ERROR,
|
|
274
|
+
WARNING or INFO), one line for each finding,
|
|
275
|
+
`<severity> [<rule>] <subject>: <message>`, then one INFO line that counts them,
|
|
276
|
+
`<e> error(s), <w> warning(s), <i> info: <name>`. It exits 1 when any finding is
|
|
277
|
+
an error and 0 otherwise, and it prints nothing to stdout.
|
|
278
|
+
|
|
279
|
+
- When the ontology declares the service, each contract names exactly one of
|
|
280
|
+
`entity` or `grain`, so a contract that names neither, or both, is an error.
|
|
281
|
+
A column that carries no binding is a warning, unless its name is a key part
|
|
282
|
+
or a property of the table's entity, in which case the check binds it itself.
|
|
283
|
+
- When the ontology does not declare the service, none of its contracts is
|
|
284
|
+
checked: `validate` logs one INFO line, `not declared in the ontology: none
|
|
285
|
+
of this service's contracts is checked`, and one WARNING for each contract
|
|
286
|
+
that writes bindings, and exits 0.
|
|
287
|
+
- A file that cannot be read, is not UTF-8 text or is not an ontology is one
|
|
288
|
+
ERROR line, `<file>: <reason>`, and exit 1. The reason of an invalid
|
|
289
|
+
ontology is the library's, with the path to the first fault.
|
|
290
|
+
- A file that is an ontology but that the library's `ontology` rule refuses (a
|
|
291
|
+
thing owned by a domain the file does not declare, a service of a domain it
|
|
292
|
+
does not declare, a personal property no access rule names) is refused the
|
|
293
|
+
same way, whatever the service, and no contract is checked against it: one
|
|
294
|
+
ERROR line, `<file>: the ontology file has <n> error(s): run
|
|
295
|
+
continuo-contracts ontology check <file>`, and exit 1. That command lists the
|
|
296
|
+
errors. Findings of that rule that are not errors do not stop the check.
|
|
297
|
+
|
|
298
|
+
A company without an ontology adds nothing: without the two flags `validate`
|
|
299
|
+
runs the checks above and no others.
|
|
300
|
+
|
|
218
301
|
## Node kinds
|
|
219
302
|
|
|
220
303
|
The `kind` property (a `customProperties` item, not the contract's root
|
|
@@ -450,11 +533,11 @@ A domain repo picks its warehouse engine by which base image it builds
|
|
|
450
533
|
`FROM`:
|
|
451
534
|
|
|
452
535
|
```dockerfile
|
|
453
|
-
FROM ghcr.io/carolsimone/continuo-python-runtime-postgres:v0.
|
|
536
|
+
FROM ghcr.io/carolsimone/continuo-python-runtime-postgres:v0.14.0
|
|
454
537
|
# or
|
|
455
|
-
FROM ghcr.io/carolsimone/continuo-python-runtime-trino:v0.
|
|
538
|
+
FROM ghcr.io/carolsimone/continuo-python-runtime-trino:v0.14.0
|
|
456
539
|
# or
|
|
457
|
-
FROM ghcr.io/carolsimone/continuo-python-runtime-duckdb:v0.
|
|
540
|
+
FROM ghcr.io/carolsimone/continuo-python-runtime-duckdb:v0.14.0
|
|
458
541
|
```
|
|
459
542
|
|
|
460
543
|
The engine is part of the image **name**; the tag is the bare version, so
|
{continuo_python_runtime-0.13.0 → continuo_python_runtime-0.14.0}/continuo_python_runtime/cli.py
RENAMED
|
@@ -8,7 +8,8 @@ import sys
|
|
|
8
8
|
from importlib import metadata
|
|
9
9
|
from pathlib import Path
|
|
10
10
|
|
|
11
|
-
from continuo_python_runtime.contract.loader import load_contract_dir
|
|
11
|
+
from continuo_python_runtime.contract.loader import load_contract_dir, load_contract_docs
|
|
12
|
+
from continuo_python_runtime.contract.ontology_check import check_service
|
|
12
13
|
from continuo_python_runtime.contract.pack import (
|
|
13
14
|
PACKAGE_SOURCE_USAGE,
|
|
14
15
|
build_bundle,
|
|
@@ -57,6 +58,18 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
57
58
|
)
|
|
58
59
|
validate_parser.add_argument("contract_dir", help="Path to contract directory")
|
|
59
60
|
validate_parser.add_argument("--dialect", default=None, help=dialect_help)
|
|
61
|
+
validate_parser.add_argument(
|
|
62
|
+
"--service",
|
|
63
|
+
default=None,
|
|
64
|
+
help="The service the contracts belong to: a contract whose `service` property "
|
|
65
|
+
"names another service is refused",
|
|
66
|
+
)
|
|
67
|
+
validate_parser.add_argument(
|
|
68
|
+
"--ontology",
|
|
69
|
+
default=None,
|
|
70
|
+
help="The company's ontology file (needs --service): check every contract "
|
|
71
|
+
"against it, as a release does",
|
|
72
|
+
)
|
|
60
73
|
|
|
61
74
|
# pack subcommand
|
|
62
75
|
pack_parser = subparsers.add_parser(
|
|
@@ -120,12 +133,19 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
120
133
|
)
|
|
121
134
|
|
|
122
135
|
args = parser.parse_args(argv)
|
|
136
|
+
if args.command == "validate" and args.ontology is not None and args.service is None:
|
|
137
|
+
validate_parser.error("--ontology needs --service")
|
|
123
138
|
if args.command == "pack" and (args.image is None) == (args.image_packages is None):
|
|
124
139
|
pack_parser.error(PACKAGE_SOURCE_USAGE)
|
|
125
140
|
|
|
126
141
|
try:
|
|
127
142
|
if args.command == "validate":
|
|
128
|
-
return cmd_validate(
|
|
143
|
+
return cmd_validate(
|
|
144
|
+
args.contract_dir,
|
|
145
|
+
args.dialect,
|
|
146
|
+
service=args.service,
|
|
147
|
+
ontology=args.ontology,
|
|
148
|
+
)
|
|
129
149
|
elif args.command == "pack":
|
|
130
150
|
return cmd_pack(
|
|
131
151
|
args.contract_dir,
|
|
@@ -158,10 +178,62 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
158
178
|
return 0
|
|
159
179
|
|
|
160
180
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
181
|
+
_FINDING_LEVELS = {"error": logging.ERROR, "warning": logging.WARNING, "info": logging.INFO}
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
def cmd_validate(
|
|
185
|
+
contract_dir: str,
|
|
186
|
+
dialect: str | None = None,
|
|
187
|
+
*,
|
|
188
|
+
service: str | None = None,
|
|
189
|
+
ontology: str | None = None,
|
|
190
|
+
) -> int:
|
|
191
|
+
"""Validate contracts in a directory.
|
|
192
|
+
|
|
193
|
+
With no ``service``, every contract is checked as a contract of any service
|
|
194
|
+
and nothing is logged. With a ``service``, a contract whose ``service``
|
|
195
|
+
property names another one is refused too, as ``pack`` refuses it.
|
|
196
|
+
|
|
197
|
+
With an ``ontology`` file (which needs the ``service``), each contract is
|
|
198
|
+
then checked against it by the per-service rules of continuo-contracts.
|
|
199
|
+
Each finding is logged at its level, ERROR for an error, WARNING for a
|
|
200
|
+
warning and INFO for information, as ``<severity> [<rule>] <subject>:
|
|
201
|
+
<message>``, in the order the library returns them, followed by one INFO
|
|
202
|
+
line counting the three. Any error makes the exit code 1. An ontology file
|
|
203
|
+
that cannot be read, is not an ontology or is refused by the library's
|
|
204
|
+
``ontology`` rule is one ERROR line and exit 1, before any finding. Nothing
|
|
205
|
+
goes to stdout.
|
|
206
|
+
"""
|
|
207
|
+
if service is None:
|
|
208
|
+
load_contract_dir(Path(contract_dir), dialect=dialect)
|
|
209
|
+
return 0
|
|
210
|
+
loaded = load_contract_docs(Path(contract_dir), dialect=dialect, service=service)
|
|
211
|
+
if ontology is None:
|
|
212
|
+
return 0
|
|
213
|
+
|
|
214
|
+
findings = check_service(
|
|
215
|
+
[doc for _, doc in loaded], service=service, ontology_path=Path(ontology)
|
|
216
|
+
)
|
|
217
|
+
for finding in findings:
|
|
218
|
+
logger.log(
|
|
219
|
+
_FINDING_LEVELS[finding.severity],
|
|
220
|
+
"%s [%s] %s: %s",
|
|
221
|
+
finding.severity,
|
|
222
|
+
finding.rule,
|
|
223
|
+
finding.subject,
|
|
224
|
+
finding.message,
|
|
225
|
+
)
|
|
226
|
+
counts = {severity: 0 for severity in _FINDING_LEVELS}
|
|
227
|
+
for finding in findings:
|
|
228
|
+
counts[finding.severity] += 1
|
|
229
|
+
logger.info(
|
|
230
|
+
"%d error(s), %d warning(s), %d info: %s",
|
|
231
|
+
counts["error"],
|
|
232
|
+
counts["warning"],
|
|
233
|
+
counts["info"],
|
|
234
|
+
service,
|
|
235
|
+
)
|
|
236
|
+
return 1 if counts["error"] else 0
|
|
165
237
|
|
|
166
238
|
|
|
167
239
|
def cmd_pack(
|
|
@@ -129,15 +129,22 @@ def issue_lines(file: Path | str, issues: Iterable[object]) -> list[str]:
|
|
|
129
129
|
|
|
130
130
|
|
|
131
131
|
def node_from_contract(
|
|
132
|
-
doc: Mapping[str, Any],
|
|
132
|
+
doc: Mapping[str, Any],
|
|
133
|
+
file: Path,
|
|
134
|
+
*,
|
|
135
|
+
dialect: str | None,
|
|
136
|
+
check_reads: bool,
|
|
137
|
+
service: str | None = None,
|
|
133
138
|
) -> Node:
|
|
134
139
|
"""Check the ODCS contract ``doc``, read from ``file``, and build its :class:`Node`.
|
|
135
140
|
|
|
136
141
|
continuo-contracts checks the contract first
|
|
137
|
-
(``validate_python_contract``,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
(``validate_python_contract``, of which only the base name of ``file``
|
|
143
|
+
counts for the file-name rule). With a ``service`` it also refuses a
|
|
144
|
+
contract whose authored ``service`` property names another service; with
|
|
145
|
+
none, that property is not compared. When it finds issues they become one
|
|
146
|
+
:class:`ContractError` with one :func:`issue_lines` line per issue, and
|
|
147
|
+
nothing else runs.
|
|
141
148
|
|
|
142
149
|
The runtime's own rules follow, each naming ``file`` and the relation:
|
|
143
150
|
the kind's reads rule (:mod:`~continuo_python_runtime.contract.kinds`),
|
|
@@ -155,7 +162,7 @@ def node_from_contract(
|
|
|
155
162
|
``required``), ``extra_columns``, ``config``, ``secret_ref``,
|
|
156
163
|
``mode_type``, the key when the node upserts and the assets.
|
|
157
164
|
"""
|
|
158
|
-
issues = validate_python_contract(doc, path=str(file), service=
|
|
165
|
+
issues = validate_python_contract(doc, path=str(file), service=service)
|
|
159
166
|
if issues:
|
|
160
167
|
raise ContractError("\n".join(issue_lines(file, issues)))
|
|
161
168
|
python = node_from_odcs(doc)
|
|
@@ -225,6 +232,27 @@ def load_contract_dir(
|
|
|
225
232
|
) -> list[Node]:
|
|
226
233
|
"""Load and check every ``*.odcs.yaml`` contract in ``path``, in file-name order.
|
|
227
234
|
|
|
235
|
+
The nodes, as :func:`load_contract_docs` loads them with no service. Every
|
|
236
|
+
refusal and every rule are described there.
|
|
237
|
+
"""
|
|
238
|
+
return [node for node, _ in load_contract_docs(path, dialect=dialect, check_reads=check_reads)]
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
def load_contract_docs(
|
|
242
|
+
path: Path,
|
|
243
|
+
*,
|
|
244
|
+
dialect: str | None = None,
|
|
245
|
+
check_reads: bool = True,
|
|
246
|
+
service: str | None = None,
|
|
247
|
+
) -> list[tuple[Node, Mapping[str, Any]]]:
|
|
248
|
+
"""Load and check every ``*.odcs.yaml`` contract in ``path``, in file-name order.
|
|
249
|
+
|
|
250
|
+
Each node comes with the document it was built from, the one read from its
|
|
251
|
+
file and checked, so a caller that needs the documents does not read the
|
|
252
|
+
files again. ``service``, when given, is the service the contracts belong
|
|
253
|
+
to: continuo-contracts then refuses a contract whose authored ``service``
|
|
254
|
+
property names another one, as :func:`node_from_contract` says.
|
|
255
|
+
|
|
228
256
|
Any other file whose name ends in ``.yml`` or ``.yaml``, in any case
|
|
229
257
|
(``legacy.YML``, ``t.odcs.YAML``, ``t.odcs.yml``), is refused: one
|
|
230
258
|
:class:`ContractError` names every such file, one line each, with how to
|
|
@@ -256,7 +284,8 @@ def load_contract_dir(
|
|
|
256
284
|
instead of blaming a valid read.
|
|
257
285
|
|
|
258
286
|
Raises ``ContractError`` for an unknown ``dialect``, a file in another
|
|
259
|
-
format, a folder with no contract, a contract that is refused
|
|
287
|
+
format, a folder with no contract, a contract that is refused (one that
|
|
288
|
+
names another service than ``service``, when given, included), and two
|
|
260
289
|
files that declare the same ``<schema>.<table>``, compared in lower case.
|
|
261
290
|
"""
|
|
262
291
|
if dialect is not None:
|
|
@@ -282,11 +311,13 @@ def load_contract_dir(
|
|
|
282
311
|
if not files:
|
|
283
312
|
raise ContractError(f"no contract files found in {path}")
|
|
284
313
|
|
|
285
|
-
|
|
314
|
+
loaded: list[tuple[Node, Mapping[str, Any]]] = []
|
|
286
315
|
relation_files: dict[str, Path] = {}
|
|
287
316
|
for file in files:
|
|
288
317
|
doc = parse_contract(read_contract_text(file), file)
|
|
289
|
-
node = node_from_contract(
|
|
318
|
+
node = node_from_contract(
|
|
319
|
+
doc, file, dialect=dialect, check_reads=check_reads, service=service
|
|
320
|
+
)
|
|
290
321
|
# Relations are compared in lower case, as continuo compares them: a
|
|
291
322
|
# warehouse folds the case of an unquoted name, so two contracts whose
|
|
292
323
|
# tables differ only in case would build one table.
|
|
@@ -297,5 +328,5 @@ def load_contract_dir(
|
|
|
297
328
|
f"duplicate node {node.relation} (in {existing} and {file})"
|
|
298
329
|
)
|
|
299
330
|
relation_files[key] = file
|
|
300
|
-
|
|
301
|
-
return
|
|
331
|
+
loaded.append((node, doc))
|
|
332
|
+
return loaded
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"""Check a Python service's contracts against the company's ontology file.
|
|
2
|
+
|
|
3
|
+
``continuo-runtime validate --service <name> --ontology <file>`` runs the
|
|
4
|
+
per-service rules of continuo-contracts over the contracts of one service:
|
|
5
|
+
each contract is stored as a release stores it, filled with what the
|
|
6
|
+
ontology knows and checked, so a team sees in its own CI what a release says
|
|
7
|
+
about its bindings. The rules read contracts against an ontology file that the
|
|
8
|
+
library's own ``ontology`` rule accepts, so a file that rule refuses stops the
|
|
9
|
+
check before any contract is read, as it does in the library's dbt check. This
|
|
10
|
+
is the only module of the runtime that imports the library's ontology modules.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
from collections.abc import Mapping, Sequence
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
from typing import Any
|
|
18
|
+
|
|
19
|
+
from continuo_contracts import ontology
|
|
20
|
+
from continuo_contracts.contract import normalise_python
|
|
21
|
+
from continuo_contracts.errors import ContractsError, OntologyError
|
|
22
|
+
from continuo_contracts.ontology_check import (
|
|
23
|
+
PER_SERVICE_RULES,
|
|
24
|
+
Finding,
|
|
25
|
+
check,
|
|
26
|
+
ontology_findings,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
from continuo_python_runtime.errors import ContractError
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _read_ontology(ontology_path: Path) -> ontology.Ontology:
|
|
33
|
+
"""Return the ontology the file ``ontology_path`` holds.
|
|
34
|
+
|
|
35
|
+
Raises ``ContractError``, with the message ``<file>: <reason>``, for a file
|
|
36
|
+
that cannot be read (missing, a folder, no permission), one that is not
|
|
37
|
+
UTF-8 text and one the library does not accept as an ontology, whose
|
|
38
|
+
reason is the library's own message. The ``ontology`` rule, which can
|
|
39
|
+
refuse a file that loads, is run by :func:`check_service`.
|
|
40
|
+
"""
|
|
41
|
+
try:
|
|
42
|
+
text = ontology_path.read_bytes().decode("utf-8")
|
|
43
|
+
except OSError as exc:
|
|
44
|
+
raise ContractError(f"{ontology_path}: {exc.strerror or exc}") from None
|
|
45
|
+
except UnicodeDecodeError as exc:
|
|
46
|
+
raise ContractError(f"{ontology_path}: the file is not UTF-8 text ({exc})") from None
|
|
47
|
+
try:
|
|
48
|
+
return ontology.load(text)
|
|
49
|
+
except OntologyError as exc:
|
|
50
|
+
raise ContractError(f"{ontology_path}: {exc}") from None
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def check_service(
|
|
54
|
+
docs: Sequence[Mapping[str, Any]], *, service: str, ontology_path: Path
|
|
55
|
+
) -> list[Finding]:
|
|
56
|
+
"""Return the findings of the per-service rules over ``docs``, the contracts of ``service``.
|
|
57
|
+
|
|
58
|
+
``docs`` are contract documents that continuo-contracts already accepted as
|
|
59
|
+
a Python contract; none is changed. The ontology file is read first, and
|
|
60
|
+
the library's ``ontology`` rule runs over it alone. Each document then goes
|
|
61
|
+
through ``normalise_python`` as the contract of ``service`` that reads
|
|
62
|
+
nothing the ontology tracks, then through ``ontology.resolve``, and the
|
|
63
|
+
rules ``contract``, ``coverage``, ``quality`` and ``privacy`` run over all
|
|
64
|
+
of them. The findings come as the library returns them, sorted. A
|
|
65
|
+
``service`` the ontology does not declare gets the library's one
|
|
66
|
+
information finding and one warning for each contract that writes a
|
|
67
|
+
binding.
|
|
68
|
+
|
|
69
|
+
Raises ``ContractError`` when ``ontology_path`` cannot be read or is not an
|
|
70
|
+
ontology (see :func:`_read_ontology`), when the ``ontology`` rule finds an
|
|
71
|
+
error in the file, whatever ``service`` is (the message is ``<file>: the
|
|
72
|
+
ontology file has <n> error(s): run continuo-contracts ontology check
|
|
73
|
+
<file>``, and no contract is read against the file), and when ``service``
|
|
74
|
+
is blank. Findings of the ``ontology`` rule that are not errors do not stop
|
|
75
|
+
the check.
|
|
76
|
+
"""
|
|
77
|
+
loaded = _read_ontology(ontology_path)
|
|
78
|
+
broken = sum(finding.severity == "error" for finding in ontology_findings(loaded))
|
|
79
|
+
if broken:
|
|
80
|
+
raise ContractError(
|
|
81
|
+
f"{ontology_path}: the ontology file has {broken} error(s): "
|
|
82
|
+
f"run continuo-contracts ontology check {ontology_path}"
|
|
83
|
+
)
|
|
84
|
+
try:
|
|
85
|
+
stored = [normalise_python(doc, service=service, reads=[]) for doc in docs]
|
|
86
|
+
except ContractsError as exc:
|
|
87
|
+
raise ContractError(str(exc)) from None
|
|
88
|
+
resolved = [ontology.resolve(contract, loaded) for contract in stored]
|
|
89
|
+
return check(loaded, resolved, rules=PER_SERVICE_RULES)
|