Skip to content

Add Apache 2.0 license headers and related scripts to the repository

Latest

Choose a tag to compare

@dschwartznyc dschwartznyc released this 15 Oct 07:53
· 5 commits to main since this release
951f033

Summary

  • Adds the Copyright (c) 2023-2026 CLOUDRISK Limited and FT Advisory LLC / SPDX-License-Identifier: Apache-2.0 header to every .py, .yml, .sh, and .toml file in the repository, and puts tooling in place to keep it enforced going forward.
  • Fixes a pydantic 2.12 compatibility break in BaseDataClass._serialize_refs that caused all model serialization to fail with a PydanticSerializationError.

What changed

License headers

  • Added src/license/header.txt (the header template) and src/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.yaml with two licenseheaders hooks (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 to main or develop
  • Updated dev_clean_setup.sh to run pre-commit install automatically, so hooks are active for any developer who follows the standard setup
  • Updated README.md with 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