This file contains all notable changes to the cableloss project.
just release-check, which runs the refusalsjust releaseopens with and stops there: a dirty working tree, a branch other thanmaster, amasterbehind its upstream, an emptyUnreleasedsection. Asking whether a release can be cut no longer means starting one and reading the error.just doc, which searches pydoc for a given term.
just buildandjust releasedepend oncovrather thantest. CI runs pytest under coverage and fails below thefail_underfloor inpyproject.toml, so the bare suite these recipes ran left that gate as one they never applied: a tree that passed locally could still be rejected on push, andjust releasecould tag a version CI would then refuse to publish.- The CHANGELOG parser that reads the
Unreleasedsection moved out ofreleaseand into a privateunreleasedrecipe.release-checkandreleaseboth read it, one to refuse an empty section and the other to show what is about to ship, so it is written once rather than inlined in each. - Promote "Releasing to PyPI" in the README from a fourth level heading to a third. It had been nested under "Development Setup on macOS", which made releasing look like a macOS specific topic.
just add,just dev,just up, andjust docquote the argument they are given. just interpolates an argument straight into the shell line, sojust add 'siganalysis>=0.10.0'ranuv add siganalysis>=0.10.0: the>redirected stdout, uv saw the bare package name, the version constraint was dropped, and an empty file called=0.10.0was left in the repository root. Nothing failed, so the only sign it had happened was the stray file and apyproject.tomlthat had not moved. The variadic*argsthattestandcovtake stays unquoted, since quoting it would collapse several arguments into one.
- Build, lock, and run the project with uv and Just. The
setup.py,setup.cfg,MANIFEST.in,requirements.txt,unittest.cfg, and Invoketasks.pyare gone, replaced by apyproject.tomlwith a hatchling build backend, auv.lockthat pins numpy and the dev tools exactly, and aJustfilecarrying the recipes.requirements.txthad pinned a development environment and a runtime dependency in one list with nothing distinguishing them, and it recorded no hashes and no transitive versions, so nothing reproduced an environment from it. - Run CI on GitHub Actions across Python 3.12, 3.13, and 3.14. The README still advertised a Travis CI badge for a build that had not run since Travis stopped serving open source repositories, so the badge was the only thing standing where the checks used to be. Every push now lints with ruff, type checks with pyright, and runs the suite on each interpreter, and reports coverage to Coveralls from one leg of the matrix.
- Test the dependency floor in CI. The
numpy>=2.2.0inpyproject.tomlis a promise to anyone installing cableloss alongside something that holds numpy back, and the matrix never tests it: it installs whateveruv.lockpins, which is the newest numpy rather than the oldest allowed one. A separate job resolves with--resolution lowest-directso that a change which quietly starts needing a newer numpy fails there rather than in a bug report. - Audit the workflows with zizmor in CI and in
just lint. Everything undersrc/is linted on every push; the workflows, which are the part of this repository that can mint a PyPI credential, would otherwise be read by eye alone. It runs as a job of its own rather than as a step gated on one leg of the matrix, since that gate would mean dropping a Python version silently stops the audit. - Publish to PyPI from a tag with trusted publishing, and sign a
PEP 740 attestation for each distribution. Releases had gone out by
hand,
python -m twine upload dist/*against a.pypircholding a username and password in plaintext on disk. The release workflow mints a short lived credential from the GitHub OIDC identity of the run instead, so there is no token to store, rotate, or leak, and the same identity signs an attestation that PyPI serves beside the file it attests. Before it uploads it waits on the whole CI workflow, checks that the tagged commit is onmaster, and checks the tag against the version inpyproject.toml. - Smoke test the built wheel before publishing it. Every other check runs
against the source tree, so a packaging mistake that leaves a module or
py.typedout of the distribution passes ruff, pyright, and the whole suite and ships anyway.scripts/smoke_test_wheel.pyinstalls the wheel wheresrc/cannot be reached and imports it there.just buildruns the same script, so a local build and the release check the same things. - Cut releases with
just release, which refuses a dirty tree, a branch other thanmaster, amasterbehind its upstream, an empty Unreleased section, or a tag that already exists, then shows the entries waiting and the version each kind of bump would produce and asks which to cut. The oldinvoke releaseprinted a checklist of questions to answer from memory and took the version as an argument. - Put the actions and the Python dependencies under Dependabot. The actions in both workflows are pinned to commit SHAs rather than to mutable tags, since the release workflow can mint a PyPI credential; a pin with nothing updating it is a decision to stay on one commit forever.
- Ship
py.typed, so that the annotations reach the type checkers of projects that depend on cableloss rather than stopping at this repository. - Require 100% statement and branch coverage. The suite covers every line; a floor set anywhere below that would let coverage fall without anything noticing.
- Breaking: dropped
cableloss.__version__. The version now lives inpyproject.tomlalone rather than in two places that could disagree. Read it withimportlib.metadata.version("cableloss"). - Breaking: require Python 3.12 or newer, and numpy 2.2 or newer. The classifiers had advertised 3.5 through 3.9, none of which have been supported upstream for years.
- Moved the module into a
src/cableloss/package.import cablelossandcableloss.loss()are unchanged; the layout is what makes the wheel smoke test meaningful, since a flat module sits on the path whether or not it was packaged. - Annotated
loss()as returningnpt.NDArray. It had been annotatednp.array, which is the factory function rather than a type, so the annotation described the return as a callable and no checker could use it. TheUnion[int, float]onlengthis nowint | float. - Replaced nose2, pep8, and mypy with pytest, ruff, and pyright, and rewrote
the suite in pytest style. It had asserted one cable type at one length;
it now covers all four cables, the published figures at both ends of each
table, the linear scaling with length, the sort order interpolating callers
rely on, and the
KeyErroran unknown cable type raises. - Renamed the local
lossinsideloss()tocable_loss, which had shadowed the function it was returned from. - Dropped
AUTHORS.md, which listed one author and no contributors and was pointed at by aLICENSE.txtline naming a file (AUTHORS.txt) that never existed. Git already records who wrote what.
- Eliminate pandoc for long_description.
- Eliminate Python 2.x support.
- Update dependencies
- Ability to calculate the cable loss.