Skip to content

Derive __version__ from the metadata, and gate it - #8

Merged
remislp merged 1 commit into
masterfrom
version-single-source
Sep 11, 2026
Merged

remislp merged 1 commit into
masterfrom
version-single-source

Conversation

@remislp

@remislp remislp commented Sep 11, 2026

Copy link
Copy Markdown
Member

dcio 0.1.1 is published with dcio.__version__ reading 0.1.0. My error,
in the release that lowered the Python floor: pyproject.toml and
dcio/__init__.py both carried the version and I bumped one.

pyproject: version = "0.1.1"
__init__:  __version__ = "0.1.0"     # published like this

So pip install "dcio>=0.1.1" succeeds and then dcio.__version__ says
0.1.0. I found it while verifying HJCFIT's new [fitting] extra, which pins
dcio>=0.1.1.

Fixed at the source, not by bumping the other copy

__version__ now comes from the installed package metadata, so there is one
place for the version to be wrong and pyproject.toml is that place. A source
tree that was never installed reports 0.0.0+unknown rather than a stale
number.

Two gates, because SCALCS had one and dcio had none

  • the tag must match the version — SCALCS and HJCFIT both check this; dcio
    did not;
  • the built wheel, installed into a clean environment, must report the
    declared version
    — this is the one that would have caught the bug, because
    it asserts against the artifact rather than against the source tree.

0.1.1 cannot be replaced, so this is 0.1.2. 358 passing.

🤖 Generated with Claude Code

dcio 0.1.1 was published with pyproject.toml saying 0.1.1 and
dcio/__init__.py still saying 0.1.0, so `pip install "dcio>=0.1.1"` succeeds
and `dcio.__version__` then reports 0.1.0. My error, in the release that
lowered the Python floor: I bumped one of the two places.

Rather than bump the other, __version__ now comes from the installed package
metadata, so there is one place for it to be wrong and pyproject.toml is that
place. A source tree that was never installed reports 0.0.0+unknown rather
than lying.

SCALCS has a versions-agree gate for exactly this and dcio had none. It gets
two: the tag must match the version it claims to publish, which SCALCS and
HJCFIT both check and dcio did not; and the built wheel, installed into a
clean environment, must report the version pyproject declares. The second is
the one that would have caught this, because it asserts against the artifact
rather than against the source tree.

0.1.1 cannot be replaced, so this is 0.1.2.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@remislp
remislp merged commit ffd5220 into master Sep 11, 2026
10 checks passed
@remislp
remislp deleted the version-single-source branch September 11, 2026 10:30
remislp added a commit to DCPROGS/HJCFIT that referenced this pull request Sep 11, 2026
The fitting layer goes here, and mechanisms, rate constants and constraints
stay in SCALCS, so HJCFIT needs SCALCS to handle a mechanism. That is a
dependency it has never had, and making it a hard one would cost something
worth keeping: the likelihood needs numpy and scipy and nothing else, and a
test asserts that importing HJCFIT leaves dcio and scalcs out of sys.modules.
Someone who wants Log10Likelihood on a Q matrix they already have should not
acquire a mechanism library and a plotting stack to get it.

    pip install hjcfit             the likelihood
    pip install hjcfit[fitting]    records, mechanisms, fits, displays

dcio for records, scalcs for mechanisms and theoretical curves, matplotlib for
the displays. All three resolve from PyPI; verified in a clean virtualenv.

dcio is pinned at >=0.1.2 rather than >=0.1.1 because 0.1.1 reports the wrong
__version__ (DCPROGS/dcio#8).

EKDIST is deliberately not an extra. Exponential mixtures and t_crit
estimation belong to the displays that want them, but EKDIST is not on PyPI,
and declaring it would make pip install hjcfit[...] fail outright rather than
install what it can -- which is exactly how EKDIST's own dcio dependency
behaved until dcio was published.

This is metadata only; no import changes. What actually goes in the fitting
layer follows.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant