What's Changed
Agent-friendly API additions, expanded test coverage, and a tooling refresh. No runtime dependencies (still zero). Python 3.10–3.14.
Features
atomic_write_text()/atomic_write_bytes()— one-call wrappers aroundatomic_output_file()for the common "write a whole string/bytes atomically" case, withmake_parentsandbackup_suffixsupport.__version__is now exposed on the package (strif.__version__).InsertionandReplacementare nowNamedTuples with named fields (offset/textandstart/end/text) for clearer construction and better editor/agent support.HashAlgorithmLiteral type onhash_string()/hash_file()for autocomplete of common algorithms (the default remainssha1; any namehashlibaccepts still works).
Fixes
hash_file()now accepts every spellinghashlibaccepts (e.g."SHA1","sha-1"). The previousalgorithms_availableprecheck wrongly rejected valid spellings and was inconsistent withhash_string(); invalid algorithms still raiseValueError.- Published source distribution (sdist) is now clean — agent/tooling directories (
.claude,.tbd,.github,.copier-answers.yml) are excluded. (The wheel was always clean.)
Removed
abbreviate_str/abbreviate_listdeprecated aliases have been removed. Useabbrev_str()/abbrev_list(). These were never exported from the publicstrifpackage, so this only affects code importing them directly from the privatestrif.strifsubmodule.
Tooling
- Bumped
softprops/action-gh-releaseto v3.0.0 (Node 24 runtime) andastral-sh/setup-uvto v8.1.0; both pinned by commit SHA.
Tests
- New tests for
AtomicVar(including a real concurrency test),hash_filebinary/large-file paths,new_uidlength math,{timestamp}backups, and the new atomic-write helpers. Suite grew from 26 to 43 tests.
Note on backward compatibility
The NamedTuple change is runtime-compatible (positional construction, unpacking, and indexing all still work). Code that statically annotates values as list[Insertion] / list[Replacement] and assigns bare tuple literals should switch to the named constructors to satisfy type checkers.