maint #411 unify copyright automation#412
Merged
Merged
Conversation
* Add .copyright.txt as single source of truth for per-file header text: year range 2023-2026, institutional holder UChicago Argonne, LLC, SPDX identifier LicenseRef-UChicago-Argonne-LLC-License. * Add three Lucas-C/insert-license hook instances covering src/hklpy2/**/*.py (excluding _version.py and dev_*.py), scripts/*.py, and scripts/*.sh. Tests live inside src/hklpy2/ so are covered by the src+tests instance. * Update scripts/update_copyright_year.py TARGET_FILES: drop pyproject.toml and src/hklpy2/__init__.py (now hook-managed), drop docs/source/index.rst (copyright row removed), add .copyright.txt, LICENSE, and docs/source/conf.py. * Remove [tool.copyright] block from pyproject.toml (non-standard PEP 621 field; .copyright.txt + LICENSE + conf.py are sufficient). * Replace docs/source/conf.py dynamic-lookup copyright assignment with a static year-range string using UChicago Argonne, LLC; bump script maintains the end year. * Remove duplicate copyright row from docs/source/index.rst About table; conf.py is now the single source for the rendered docs. * Strip the 8-line Argonne block from src/hklpy2/__init__.py; the new institutional 2-line header is inserted by the hook at the top of the file. * Bump script fixed LICENSE line 1 from 2023-2025 to 2023-2026 (stale-year drift). * Stamp every covered .py file in src/hklpy2/, scripts/release.sh, and scripts/update_copyright_year.py with the institutional 2-line header. * Document the three-mechanism copyright handling in AGENTS.md. * Add Maintenance entry to RELEASE_NOTES.rst SEMVER block. Agent: OpenCode (claudeopus47)
|
Great job! No new security vulnerabilities introduced in this pull requestCommunicate with Checkmarx by submitting a PR comment with @Checkmarx followed by one of the supported commands. Learn about the supported commands here. |
Coverage Report for CI Build 26471355608Warning No base build found for commit Coverage: 100.0%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats
💛 - Coveralls |
* Remove dev_* exclusion from insert-license regex. Confirmed all three repos .gitignore dev_*, so such files never reach the hook in the first place; the regex was dead code. * Update AGENTS.md to note that dev_* files are .gitignore-d (the actual exclusion mechanism), not regex-excluded. * Replace scripts/update_copyright_year.py with the canonical text from BCDA-APS/ad_hoc_diffractometer#291: ASCII hyphens instead of em-dashes, consistent docstring paragraph order, identical body. Functionally equivalent; cosmetic alignment only. Agent: OpenCode (claudeopus47)
Migration artifact from copying scripts/update_copyright_year.py verbatim from BCDA-APS/ad_hoc_diffractometer and then having insert-license prepend the local repo's 2023-2026 header on top of the inherited 2026-2026 header. insert-license recognises the top-of-file header but not the duplicate below it. Agent: OpenCode (claudeopus47)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Port the unified copyright-automation system finalised in
BCDA-APS/ad_hoc_diffractometer#291 to this repo, completing the
three-repo trilogy (BCDA-APS/ad_hoc_diffractometer#290,
prjemian/hklpy2_solvers#112, this issue).
This repo already had the year-bump script (
scripts/update_copyright_year.py);this PR adds the
.copyright.txt+insert-licenseper-file-headerpropagation it lacked, removes the non-standard
pyproject.toml/[tool.copyright]block, standardises the rendereddocs holder string, and stamps every covered Python and Bash file.
Changes
Configuration
.copyright.txt(new):Copyright (c) 2023-2026 UChicago Argonne, LLCLicenseRef-UChicago-Argonne-LLC-License..pre-commit-config.yaml: three newinsert-licenseinstances:(src+tests)covering^src/hklpy2/(?!_version)(?!.*/dev_)(?!dev_).*\.py$.Tests live inside
src/hklpy2/so are covered here.(scripts-py)covering^scripts/.*\.py$.(scripts-shell)covering^scripts/.*\.sh$. Bash uses#comments so the same template applies; the hook handles shebangs
correctly.
scripts/update_copyright_year.pyTARGET_FILES: droppedpyproject.toml,src/hklpy2/__init__.py, anddocs/source/index.rst;added
.copyright.txt,LICENSE, anddocs/source/conf.py.Docstring file list updated.
pyproject.toml: removed the[tool.copyright]block (non-standardPEP 621 field; intentionally not used in any of the three repos).
docs/source/conf.py: replacedcopyright = toml["tool"]["copyright"]["copyright"]with static
copyright = "2023-2026, UChicago Argonne, LLC". Bumpscript maintains the end year. Holder string switched from
Argonne National LaboratorytoUChicago Argonne, LLCforcross-repo consistency.
docs/source/index.rst: removed the duplicatecopyright (c) 2023-2026, Argonne National Laboratoryrow from theAbout table. The Sphinx-rendered footer (driven by
conf.py) isnow the single source.
Stale-year fix
LICENSEline 1: bumped from2023-2025to2023-2026by the bumpscript on its first run with
LICENSEinTARGET_FILES. Bodyunchanged (verbatim per ANL legal).
Per-file header propagation
src/hklpy2/__init__.py: stripped the 8-line Argonne block; the newinstitutional 2-line header is inserted at the top of the file by
the hook.
.pyfiles undersrc/hklpy2/(including tests insrc/hklpy2/{,backends/,blocks/}tests/) had headers inserted.src/hklpy2/dev_i182.pyintentionally not stamped (excluded byregex;
dev_*files are developer scratch/experimental code).scripts/release.sh: 2-line header inserted after the#!/usr/bin/env bashshebang and before the existing usage block.scripts/update_copyright_year.py: 2-line header inserted after the#!/usr/bin/env python3shebang.Documentation
AGENTS.md: new "Copyright handling" section (between "Inputs &outputs" and "Running locally") documenting the three coordinated
mechanisms, what to edit by hand, and what not to. Notes the
dev_*exclusion and the Bash coverage.RELEASE_NOTES.rst: one-line Maintenance entry in the existingSEMVER block.
Verification
pre-commit run --all-files— all hooks pass.pytest -q— 1275 passed, 7 skipped, 0 failed.current).
Cross-repo coordination
open, awaiting review). Bump-script template,
.copyright.txtformat, hook config patterns, and AGENTS.md wording all derive
from there.
.copyright.txtorinsert-licensecoverage before; the visiblediff is dominated by 74 mechanical header insertions in
src/hklpy2/.Agent: OpenCode (claudeopus47)