This file contains foundational project knowledge, release procedures, and environment constraints for future development.
The project uses automated GitHub Actions for publishing to PyPI and creating GitHub Releases.
- Branching: All releases must be initiated from a branch matching the pattern
releases/*(e.g.,releases/v2.6.5). - Workflow: Trigger the
.github/workflows/publish-pypi.ymlaction manually.- Input Version: Use the format
X.Y.Z(e.g.,2.6.5). Do not include the leadingv. - Automation: The workflow automatically prepends
vfor the Git tag (v2.6.5) and strips it for the Python version check to ensure consistency.
- Input Version: Use the format
- Manual Gate: The
publish_to_real_pypiinput must be set totrueto deploy to production and create the GitHub Release. - Resiliency: The workflow is configured with
skip-existing: true. If a PyPI upload fails because the version exists, the workflow will continue and complete the GitHub Release creation. - Finalization: Once the release is successful, merge the release branch back into
masterto keep the official history and tags synchronized.
- Prefix: All official release tags must use the
vprefix (e.g.,v2.6.4,v2.6.5). - History: Tags must be part of the direct history of the
masterbranch.- Correction Note:
v2.6.4was re-anchored to commitca5072bto ensure correct diff calculation for subsequent releases.
- Correction Note:
- Setuptools Compatibility: TensorBoard (up to 2.20.0) depends on
pkg_resources.- Breaking Change:
setuptools>= 82.0.0 removedpkg_resources. - Mandate: For local development and testing,
setuptoolsshould be pinned to81.0.0or earlier to avoidModuleNotFoundError.
- Breaking Change:
- Version Management: The project uses
setuptools_scm. The version is derived dynamically from the most recent git tag.
Tests should be run locally before pushing any changes.
The project provides a helper script to install dependencies and run tests:
./run_pytest.shIf using uv (preferred), ensure your environment is correctly pinned:
- Pin Setuptools:
uv pip install "setuptools==81.0.0" - Run Pytest:
uv run pytest
tests/test_writer.py: CoreSummaryWriterlogic (includingwrite_to_diskchecks).tests/test_summary.py: Protobuf summary generation.tests/test_summary_writer.py: Integration tests for the writer.
- SummaryWriter: When
write_to_disk=Falseis passed to the constructor, theadd_scalarsmethod correctly respects this flag and uses aDummyFileWriterfor sub-directories (fixed in #765).