Repository navigation
Summary
- Adds the
Copyright (c) 2023-2026 CLOUDRISK Limited and FT Advisory LLC / SPDX-License-Identifier: Apache-2.0header to every.py,.yml,.sh, and.tomlfile in the repository, and puts tooling in place to keep it enforced going forward. - Fixes a pydantic 2.12 compatibility break in
BaseDataClass._serialize_refsthat caused all model serialization to fail with aPydanticSerializationError.
What changed
License headers
- Added
src/license/header.txt(the header template) andsrc/license/apply_headers.sh(applies headers across all directories and root files in one command) - Applied the header to all tracked source and config files (
.py,.yml,.sh,.toml) - Added
.pre-commit-config.yamlwith twolicenseheadershooks (managed by pre-commit, no manual venv setup needed) — triggered on commit for all covered file types - Added
.github/workflows/check-license-headers.yml— CI backstop that fails the build if any file is missing a header on push/PR tomainordevelop - Updated
dev_clean_setup.shto runpre-commit installautomatically, so hooks are active for any developer who follows the standard setup - Updated
README.mdwith the header format and the fix command
pydantic 2.12 compatibility fix
BaseDataClass._serialize_refs is decorated with @model_serializer(mode='wrap'). The wrap handler callable (SerializerFunctionWrapHandler) only accepts the value to serialize — SerializationInfo is passed to the outer function but must not be forwarded to the handler. In pydantic ≤ 2.11 the extra argument was silently tolerated; in 2.12 it raises:
PydanticSerializationError: Error calling function `_serialize_refs`:
TypeError: 'index_key' is expected to be an integer or a string,
got 'SerializationInfo(...)'
Fix: serializer(self, info) → serializer(self) in base_data_class.py.
Closes: #45