maint #290 unify copyright automation#291
Merged
Merged
Conversation
* Convert .copyright.txt to year-range form (2026-2026) and switch SPDX identifier to LicenseRef-UChicago-Argonne-LLC-License. * Update pyproject.toml license field to match. * Convert LICENSE line 1 to year-range form; body unchanged (verbatim per ANL legal). * Add scripts/update_copyright_year.py reference implementation; rolls year-range end-year forward in .copyright.txt, LICENSE line 1, and docs/source/conf.py. * Register update-copyright-year as a local pre-commit hook (always_run, pass_filenames: false). * Extend insert-license hook to cover scripts/*.py. * Set docs/source/conf.py copyright to a static year-range string using UChicago Argonne, LLC; bump script maintains it. * Propagate the new header to all covered .py files. * Document the three-mechanism copyright handling in AGENTS.md. * Add Maintenance entry to CHANGES.md. Agent: OpenCode (claudeopus47)
This was referenced May 25, 2026
prjemian
added a commit
to bluesky/hklpy2
that referenced
this pull request
May 26, 2026
* 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)
Match the one-line release-note style adopted in bluesky/hklpy2#411 and prjemian/hklpy2_solvers#112. 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
Unify copyright automation in this repo and establish the reference
implementation for the parallel work in bluesky/hklpy2#411 and
prjemian/hklpy2_solvers#112.
Changes
Configuration
.copyright.txt: year-range form (2026-2026), SPDX identifierLicenseRef-UChicago-Argonne-LLC-License.pyproject.toml:licensefield switched toLicenseRef-UChicago-Argonne-LLC-License.LICENSEline 1: year-range form2026-2026. Body unchanged(verbatim per ANL legal).
docs/source/conf.py: static year-range string"2026-2026, UChicago Argonne, LLC"(no moref"2026, {author}").Bump script keeps the end year fresh.
New: bump script and hook
scripts/update_copyright_year.py: rewrites<START>-<OLD_END>→<START>-<CURRENT_YEAR>inTARGET_FILES = [.copyright.txt, LICENSE, docs/source/conf.py].Exits non-zero when it changes anything so pre-commit fails until
the developer stages the rewrite.
.pre-commit-config.yaml:update-copyright-year(
always_run: true,pass_filenames: false).insert-license (scripts)hook instance coveringscripts/*.py.Header propagation
.pyfile (61 files) had its header rewritten byinsert-licenseto match the new.copyright.txt. This is theexpected bulk diff; no logic changed.
Documentation
AGENTS.md: new "Copyright handling" section explaining the threecoordinated mechanisms (
.copyright.txt+insert-license, thebump script, static Sphinx
conf.py), what to edit by hand, andwhat not to.
CHANGES.md: one-line### Maintenanceentry inside the unreleasedHTML-comment block, referencing
(#290).Verification
pre-commit run --all-files— all hooks pass.pytest -q— 2580 passed, 2 skipped, 100% coverage maintained.current).
SPDX identifier change (PyPI metadata impact)
The
License-Expressionfield on PyPI will visibly change fromLicenseRef-ANL-Open-Source-LicensetoLicenseRef-UChicago-Argonne-LLC-Licenseon the next release.Acceptable per the issue discussion: this is a
LicenseRef-*customidentifier authored by the project owner, the licence text in
LICENSEis unchanged, and the new identifier aligns with
bluesky/hklpy2andprjemian/hklpy2_solvers.Cross-repo follow-up
This branch finalises the reference implementation. Parallel issues
will port the (now finalised)
scripts/update_copyright_year.py,.copyright.txt+insert-licenseconfig, and Sphinxconf.pypattern to:
Agent: OpenCode (claudeopus47)