fix: make version display dynamic across all surfaces

- routes.py: fallback reads from importlib.metadata instead of hardcoded
- login.html: remove hardcoded default version
- README: use dynamic GitHub Release badge from shields.io
- DOCKER_README: remove hardcoded version string

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
airano
2026-02-19 04:04:15 +03:30
parent 5d97b31c12
commit f29dc299b2
4 changed files with 10 additions and 5 deletions

View File

@@ -1986,7 +1986,7 @@ def get_registered_plugins() -> list:
def _get_project_version() -> str:
"""Read version from pyproject.toml."""
"""Read version from pyproject.toml, falling back to package metadata."""
try:
toml_path = os.path.join(os.path.dirname(os.path.dirname(TEMPLATES_DIR)), "pyproject.toml")
with open(toml_path) as f:
@@ -1995,7 +1995,12 @@ def _get_project_version() -> str:
return line.split("=")[1].strip().strip('"').strip("'")
except Exception:
pass
return "3.0.1"
try:
from importlib.metadata import version
return version("mcphub-server")
except Exception:
return "unknown"
def get_about_info() -> dict: