The engine stopped updating, and said "installed" every time
The SSL fix shipped and did not reach the machine it was written for. That log said so, one line above the tick: behavision is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel. [ok] Engine and dependencies installed and the traceback below it still pointed at model_assets.py line 59, urllib.request.urlretrieve - code the fix had deleted. Two frozen literals caused it: version = "1.1.0" in pyproject.toml and __version__ = "1.0.0" in behavision/__init__.py. They disagreed with each other and neither tracked a release, so every release built behavision-1.1.0-py3-none-any.whl and pip install --upgrade on a machine that already had 1.1.0 is a no-op. The comment beside that call claimed the opposite. The shape of the damage is what makes it bad. The Go binaries - app, agent, setup tool - are rebuilt every release and updated normally. So a shop PC ran a current app supervising an engine several releases old, and nothing said which: /api/health reported the model, the paths, the cameras and the gallery, and no version at all. - One version, in the package, read by pyproject through [tool.setuptools.dynamic]. In a checkout it reads 0.0.0+dev: a plausible-looking number on a developer's /api/health is worse than none. - pip install --force-reinstall --no-deps <wheel>, after the ordinary --upgrade. --upgrade settles the dependencies; the second call guarantees our own code is the code in the folder. --no-deps keeps it cheap - forcing the dependencies too would re-download ~300 MB every run. A rebuild at an unchanged version is the ordinary case while developing, so this must not rely on the version moving. - release.sh stamps the tag: v0.5.6-demo -> 0.5.6+demo, valid PEP 440. Into a copy of the line, reverted in a trap, so the tree is never left dirty. /api/health reports version now. Without it there is no way to tell a shop PC three releases behind from a current one, which is how this survived several releases. Reproduced end to end before fixing, against real wheels on Python 3.12: two builds of the same version, --upgrade leaves the old code in place and prints the same sentence the colleague's Mac printed, --force-reinstall --no-deps replaces it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KGcjxF1cNLcuwc3DAPcnfj
This commit is contained in:
54
CLAUDE.md
54
CLAUDE.md
@@ -3599,3 +3599,57 @@ is not up yet and a shop PC showing a stopped engine for five minutes after
|
||||
install looks broken. `tests/test_model_download.py` asserts them, and the
|
||||
rewritten fetch was checked against the real URL: 232,589 bytes, sha256
|
||||
identical to the model already on disk.
|
||||
|
||||
## The engine stopped updating, and said "installed" every time
|
||||
|
||||
The SSL fix above was released and **did not reach the machine it was written
|
||||
for**. Its log said so, one line above the tick:
|
||||
|
||||
```
|
||||
behavision is already installed with the same version as the provided wheel.
|
||||
Use --force-reinstall to force an installation of the wheel.
|
||||
[ok] Engine and dependencies installed
|
||||
```
|
||||
|
||||
and the traceback that followed still pointed at `model_assets.py", line 59,
|
||||
in _fetch / urllib.request.urlretrieve` — code the fix had deleted.
|
||||
|
||||
Two frozen literals caused it: `version = "1.1.0"` in `pyproject.toml` and
|
||||
`__version__ = "1.0.0"` in `behavision/__init__.py`. They disagreed with each
|
||||
other and neither tracked a release, so **every release built
|
||||
`behavision-1.1.0-py3-none-any.whl`** and `pip install --upgrade` on a machine
|
||||
that already had 1.1.0 is a no-op. The comment beside that call even claimed
|
||||
the opposite: *"`--upgrade` so re-running after a new release replaces the
|
||||
engine rather than leaving the old one in place and reporting success."*
|
||||
|
||||
The shape of the damage is what makes it bad. The Go binaries — the app, the
|
||||
agent, the setup tool — are rebuilt every release and updated normally. So a
|
||||
shop PC ran a current app supervising an engine several releases old, and
|
||||
nothing anywhere said which: `/api/health` reported the model, the paths, the
|
||||
cameras and the gallery, and **no version at all**.
|
||||
|
||||
Three changes, and the second is the one that does not depend on the first
|
||||
being remembered:
|
||||
|
||||
- **One version, in the package**, read by `pyproject.toml` through
|
||||
`[tool.setuptools.dynamic]`. Two literals in two files is how they came to
|
||||
disagree. In a checkout it reads `0.0.0+dev`, because a plausible-looking
|
||||
number on a developer's `/api/health` would be worse than none.
|
||||
- **`pip install --force-reinstall --no-deps <wheel>`, after the ordinary
|
||||
`--upgrade`.** `--upgrade` settles the dependencies; the second call
|
||||
guarantees our own code is the code in the folder. `--no-deps` is what keeps
|
||||
it cheap — forcing the dependencies too would re-download ~300 MB of numpy,
|
||||
OpenCV and onnxruntime on every run. A rebuild at an unchanged version is the
|
||||
ordinary case while developing, so this must not rely on the version moving.
|
||||
- **`release.sh` stamps the tag**: `v0.5.6-demo` → `0.5.6+demo`, valid PEP 440
|
||||
(a local segment takes alphanumerics and dots, never hyphens). Into a copy of
|
||||
the line, reverted in a `trap`, so the tree is never left dirty.
|
||||
|
||||
`/api/health` reports `version` now. Without it there is no way to tell a shop
|
||||
PC three releases behind from a current one, which is precisely how this
|
||||
survived several releases.
|
||||
|
||||
Reproduced end to end before fixing, against real wheels on Python 3.12: two
|
||||
builds of the same version, `--upgrade` leaves the old code in place and prints
|
||||
the same sentence the colleague's Mac printed, `--force-reinstall --no-deps`
|
||||
replaces it.
|
||||
|
||||
Reference in New Issue
Block a user