Skip to content

Commit b17a8df

Browse files
committed
Fix GUI version: use setuptools_scm version instead of hardcoded 0.7.0
- Import __version__ from zebra_day in create_app() - Set app.state.version and FastAPI constructor version from __version__ - Remove hardcoded '0.7.0' fallback from base.html and get_modern_context() - 289 tests passing
1 parent a0e647d commit b17a8df

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

zebra_day/templates/modern/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
<div class="container">
8282
<div class="footer-content">
8383
<div class="footer-info">
84-
<span>Zebra Day v{{ version | default('0.7.0') }}</span>
84+
<span>Zebra Day v{{ version | default('unknown') }}</span>
8585
<span class="footer-sep"></span>
8686
<span>IP: {{ local_ip | default('unknown') }}</span>
8787
</div>

zebra_day/web/app.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from fastapi.staticfiles import StaticFiles
1717
from fastapi.templating import Jinja2Templates
1818

19-
from zebra_day import paths as xdg
19+
from zebra_day import __version__, paths as xdg
2020
from zebra_day.logging_config import get_logger
2121
from zebra_day.web.middleware import RequestLoggingMiddleware, print_rate_limiter
2222

@@ -65,10 +65,13 @@ def create_app(
6565
app = FastAPI(
6666
title="Zebra Day",
6767
description="Zebra printer fleet management and label printing",
68-
version="0.5.0",
68+
version=__version__,
6969
debug=debug,
7070
)
7171

72+
# Expose version to templates via app.state
73+
app.state.version = __version__
74+
7275
# Add request logging middleware
7376
app.add_middleware(RequestLoggingMiddleware)
7477

zebra_day/web/routers/ui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def get_modern_context(request: Request, active_page: str = "", **kwargs) -> dic
5858
"request": request,
5959
"active_page": active_page,
6060
"local_ip": request.app.state.local_ip,
61-
"version": getattr(request.app.state, "version", "0.7.0"),
61+
"version": getattr(request.app.state, "version", "unknown"),
6262
"cache_bust": str(int(time.time())),
6363
**kwargs,
6464
}

0 commit comments

Comments
 (0)