Skip to content

🛡️ Warracker is an open source, self-hostable warranty tracker to monitor expirations, store receipts, files. You own the data, your rules!

Fix #293: pin packaging explicitly so the Docker image starts

Omega (QA)8b18da5c7f80
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 83f76de..89794f3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
# Changelog
+## 1.0.6 - Unreleased
+
+- **Docker image fails to start, fixed (#293):** the 1.0.5 image crashes on boot with "ModuleNotFoundError: No module named 'packaging'" and gunicorn never starts. The gevent worker class gunicorn loads imports the packaging module, but gunicorn declares packaging only in its optional "gevent" extra, and the requirements file installs plain gunicorn, so pip never installed it. The 1.0.4 image worked because it copied the builder's whole /usr/local, which happened to carry packaging along; the 1.0.5 image diet copies only the virtualenv, which exposed the missing pin. packaging is now pinned explicitly in the requirements file, and a regression test guards the pin. Verified in clean virtualenvs built from the old and new requirements: the old set reproduces the ModuleNotFoundError on worker load, the new set loads the worker.
+ - _Files: `backend/requirements.txt`, `tests/test_requirements_packaging.py`_
+
## 1.0.5 - 2026-11-09
- **Collapsible card actions in grid view:** a grid card header carried six icon buttons (Claims, Edit, Archive, Void, Duplicate, Delete) next to the product name, and the name was capped at 200px, so long product names truncated while the buttons took more room than the title. The header now keeps Claims and Edit visible and moves Archive, Void/Unvoid, Duplicate and Delete into an overflow (kebab) menu whose items carry text labels, not just icons, which also helps touch users who never see the icon tooltips. Delete sits last in the menu in the danger color, so it takes one deliberate extra tap. The title cap is gone in grid view, and names wrap to a second line instead of truncating, so the full product name shows. List and table views are unchanged.
diff --git a/backend/requirements.txt b/backend/requirements.txt
index dc5ab33..bb2c220 100644
--- a/backend/requirements.txt
+++ b/backend/requirements.txt
@@ -1,5 +1,8 @@
Flask==3.1.3
gunicorn==26.2.0
+# gunicorn's gevent worker imports packaging, but gunicorn declares it
+# only in its "gevent" extra, so it must be pinned explicitly (#293).
+packaging==26.3
psycopg2==2.9.13
Werkzeug==3.1.9
flask-cors==6.0.5
diff --git a/tests/test_requirements_packaging.py b/tests/test_requirements_packaging.py
new file mode 100644
index 0000000..53d31e7
--- /dev/null
+++ b/tests/test_requirements_packaging.py
@@ -0,0 +1,56 @@
+"""Regression guard for #293 (1.0.5 Docker image fails to start).
+
+gunicorn's gevent worker imports the `packaging` module at worker
+load, but gunicorn 26.2.0 declares `packaging` only under its
+"gevent" extra. backend/requirements.txt installs plain gunicorn
+(no extra), so without an explicit pin pip never installs packaging
+and the shipped image crashes on boot with
+"ModuleNotFoundError: No module named 'packaging'".
+
+The 1.0.4 image worked because it copied the builder's whole
+/usr/local, which carried packaging along; the 1.0.5 venv-only
+image (91ed0d3) exposed the missing pin.
+
+These tests pin the requirement in place and verify the worker
+class loads with the installed dependency set. The clean-venv
+verification (fresh venv from requirements.txt, then importing
+gunicorn.workers.ggevent) is the end-to-end check; it is run at
+release time because it needs network access to PyPI.
+"""
+import re
+from pathlib import Path
+
+REPO_ROOT = Path(__file__).resolve().parent.parent
+REQUIREMENTS = REPO_ROOT / "backend" / "requirements.txt"
+
+
+def _requirement_lines():
+ lines = []
+ for raw in REQUIREMENTS.read_text(encoding="utf-8").splitlines():
+ line = raw.strip()
+ if line and not line.startswith("#"):
+ lines.append(line)
+ return lines
+
+
+def test_packaging_is_pinned_explicitly():
+ pins = [l for l in _requirement_lines() if re.match(r"(?i)packaging\s*==", l)]
+ assert pins, (
+ "backend/requirements.txt must pin packaging explicitly: "
+ "gunicorn's gevent worker imports it, but gunicorn declares "
+ "it only in its gevent extra (issue #293)."
+ )
+
+
+def test_gunicorn_and_gevent_are_pinned():
+ lines = _requirement_lines()
+ assert any(re.match(r"(?i)gunicorn\s*==", l) for l in lines)
+ assert any(re.match(r"(?i)gevent\s*==", l) for l in lines)
+
+
+def test_gevent_worker_class_loads():
+ # In any environment built from requirements.txt, importing the
+ # worker class gunicorn loads for the gevent worker must succeed.
+ # This import is what failed in the 1.0.5 image.
+ from gunicorn.workers.ggevent import GeventWorker # noqa: F401
+ import packaging # noqa: F401