Skip to content

Add Apache 2.0 license headers and related scripts to the repository - #44

Merged
dschwartznyc merged 2 commits into
mainfrom
feat-add-licensing
Oct 15, 2026
Merged

dschwartznyc merged 2 commits into
mainfrom
feat-add-licensing

Conversation

@dschwartznyc

@dschwartznyc dschwartznyc commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

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.

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Test Results

238 tests  ±0   218 ✅ ±0   1s ⏱️ ±0s
  1 suites ±0    20 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit c6e2847. ± Comparison against base commit b0fa1cd.

♻️ This comment has been updated with latest results.

…ap handler

pydantic 2.12 made the SerializerFunctionWrapHandler strict about its
call signature — it only accepts the value to serialize, not a trailing
SerializationInfo. Calling serializer(self, info) now raises:

  PydanticSerializationError: 'index_key' is expected to be an integer
  or a string, got 'SerializationInfo(...)'

Drop the info argument from the handler call; info remains available
on the outer function for any callers that need it.
@dschwartznyc
dschwartznyc merged commit 951f033 into main Oct 15, 2026
6 checks passed
@dschwartznyc
dschwartznyc deleted the feat-add-licensing branch October 15, 2026 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants