build: replace broken setup.py with pyproject.toml; bump to 0.5.1 - #4
Merged
Conversation
`pip install` of this repository produced an empty distribution. setup.py used
find_packages(where="src"), but there is no src/ directory, so it matched no
packages at all:
>>> find_packages(where="src")
[]
Fixes four packaging defects:
1. Package discovery. The importable packages live at the top level. scalcs
imports `from samples import samples`, and the Qt front end imports
`from gui import myqtcommon`, so scalcs, samples and gui are all declared.
2. Undeclared runtime dependencies. `Deprecated` (scalcs/qmatlib.py, pdfs.py,
hjclib.py) and `tabulate` (scalcs/pdfs.py, scalcslib.py) were imported but
never listed, so a clean install failed on first use.
3. Licence metadata. setup.py declared only the generic "GNU General Public
License (GPL)" classifier. LICENSE.MD is the verbatim GPL version 2 (June
1991) and no source file carries an "or (at your option) any later version"
header, so this is now declared as GPL-2.0-only.
4. Version skew. setup.py said 0.5.0 while scalcs/version.py said 0.3.0, and
the latter claimed to be generated from setup.py. Both are now 0.5.1 and
the stale comment is corrected.
PyQt5 moves from a hard dependency to an optional `gui` extra: the library
itself never imports Qt, so `pip install scalcs` no longer pulls it in. Install
the Qt front end with `pip install scalcs[gui]`.
Also moves to PEP 621 metadata, updates the project URL to DCPROGS/SCALCS, and
ships the samples data files (*.yaml, *.xlsx) as package data.
Verified by building a wheel and installing it into a clean virtualenv, with the
probe run from a neutral working directory so the checkout cannot shadow
site-packages: scalcs, samples.samples, Deprecated and tabulate all resolve,
importlib.metadata and scalcs.version agree at 0.5.1, and GlyR_flip gives
Popen(1 mM) = 0.94133.
No source module is changed apart from the version string, so numerical
behaviour is unaffected.
Co-Authored-By: Claude Opus 5 <[email protected]>
remislp
added a commit
that referenced
this pull request
Aug 6, 2026
master and modernise are two independent modernisations of the same 2021 code, not successive versions of one. modernise branched in 2021 and was developed in June 2026; refactoring2, merged into master as #3, was developed separately and landed in May. Neither contains the other. This makes modernise the basis, on the evidence below. test suite 74 passed 348 passed, 1 skipped popen.maxPopen(tres > 0) AttributeError works popen.EC50(tres > 0) AttributeError works stdout noise from one call 558 KB none packaging fixed in #4 already correct declared dependencies also Deprecated numpy, scipy - and it and tabulate imports no others documentation 35-file Sphinx 11 Markdown files tree The missed-events failures are the substantive point. refactoring2 moved functions into classes but left module-level callers reaching for qml.GXY, qml.eGs, qml.phiHJC and qml.dARSdS, none of which exist at module level any more, so every resolution-corrected Popen calculation on master raises. The class QMatrix also carries two live debug prints and computes five matrix inversions eagerly on construction. A 74-test suite did not catch any of it. Mechanics: this is a merge with modernise's tree taken wholesale, not a force-push. Both histories are preserved and refactoring2 remains reachable through the second parent. Two things are carried over from master rather than taken from modernise: * .gitignore, which modernise had deleted * the eight tracked scalcs/__pycache__/*.pyc files are dropped again, as in #6 hjclib.py does not survive into this tree. It is the most finished part of refactoring2 - HJCMatrix, AsymptoticPDF, ExactPDFCalculator, DerivativeCalculator in 1488 lines - and it is the model to work from when the class API is redone on top of this base, with 348 tests underneath it to catch the kind of half-migration that broke master. It is kept on the branch classapi/refactoring2. Verified on the merged tree: 348 passed, 1 skipped; maxPopen and EC50 at tres = 30 us return 0.95345 and 2.3561e-06 with no stray output; and the Colquhoun & Lape (2012) reproduction notebook runs against it unchanged, all twelve published values within 0.129 %, ALL CHECKS PASSED. The v0.5.1 and v0.5.1-cl2012 tags are unaffected: they are immutable and point at cf0df11, and the corrigendum notebook is pinned to the tag. Co-Authored-By: Claude Opus 5 <[email protected]>
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.
pip installof this repository produced an empty distribution. setup.py used find_packages(where="src"), but there is no src/ directory, so it matched no packages at all:Fixes four packaging defects:
Package discovery. The importable packages live at the top level. scalcs imports
from samples import samples, and the Qt front end importsfrom gui import myqtcommon, so scalcs, samples and gui are all declared.Undeclared runtime dependencies.
Deprecated(scalcs/qmatlib.py, pdfs.py, hjclib.py) andtabulate(scalcs/pdfs.py, scalcslib.py) were imported but never listed, so a clean install failed on first use.Licence metadata. setup.py declared only the generic "GNU General Public License (GPL)" classifier. LICENSE.MD is the verbatim GPL version 2 (June 1991) and no source file carries an "or (at your option) any later version" header, so this is now declared as GPL-2.0-only.
Version skew. setup.py said 0.5.0 while scalcs/version.py said 0.3.0, and the latter claimed to be generated from setup.py. Both are now 0.5.1 and the stale comment is corrected.
PyQt5 moves from a hard dependency to an optional
guiextra: the library itself never imports Qt, sopip install scalcsno longer pulls it in. Install the Qt front end withpip install scalcs[gui].Also moves to PEP 621 metadata, updates the project URL to DCPROGS/SCALCS, and ships the samples data files (*.yaml, *.xlsx) as package data.
Verified by building a wheel and installing it into a clean virtualenv, with the probe run from a neutral working directory so the checkout cannot shadow site-packages: scalcs, samples.samples, Deprecated and tabulate all resolve, importlib.metadata and scalcs.version agree at 0.5.1, and GlyR_flip gives Popen(1 mM) = 0.94133.
No source module is changed apart from the version string, so numerical behaviour is unaffected.