Skip to content

Display application version in footer using uv-dynamic-versioning - #52

Draft
zenitraM with Copilot wants to merge 4 commits into
mainfrom
copilot/add-version-display
Draft

Display application version in footer using uv-dynamic-versioning#52
zenitraM with Copilot wants to merge 4 commits into
mainfrom
copilot/add-version-display

Conversation

Copilot AI commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

Adds version display to page footers for the rolling release model. Uses uv-dynamic-versioning to automatically generate version strings from git metadata.

Changes

Version Display

  • Footer shows Powered by Malla v{version} on all pages via template context injection
  • /health and /info endpoints return dynamic version

Build System

  • Migrated to uv-dynamic-versioning for automatic version management
  • Configured PEP440 style with git metadata: 0.0.0.post3.dev0+abc1234.dirty
  • Auto-generates src/malla/_version.py during build via Hatch hook
  • Fallback to 0.1.0 for non-git environments (PyPI installs)

Implementation

# src/malla/__init__.py
try:
    from ._version import __version__  # Generated by uv-dynamic-versioning
except ImportError:
    __version__ = "0.1.0.dev0+unknown"

def get_version():
    return __version__
# pyproject.toml
[build-system]
requires = ["hatchling", "uv-dynamic-versioning"]

[tool.uv-dynamic-versioning]
vcs = "git"
style = "pep440"
metadata = true
dirty = true
fallback-version = "0.1.0"

Removed manual subprocess git calls in favor of build-time version generation. Check version with uvx uv-dynamic-versioning.

Original prompt

This section details on the original issue you should resolve

<issue_title>Feature Request: Show version</issue_title>
<issue_description>It would be nice if Malla showed the version on the bottom of the pages.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits December 2, 2025 19:04
- Import get_version() function from __init__.py
- Inject APP_VERSION into Flask template context
- Display version in footer as "Malla v{version}"
- Update /health and /info endpoints to use get_version()
- Add get_version() function that returns git commit hash or falls back to package version
- Update integration tests to verify version is displayed correctly
- All tests pass (44 unit, 183 integration)

Co-authored-by: zenitraM <863975+zenitraM@users.noreply.github.com>
- Add uv-dynamic-versioning to build-system requirements
- Configure uv-dynamic-versioning in pyproject.toml with PEP440 style
- Generate _version.py file automatically during build with version info
- Simplify __init__.py to import version from _version.py
- Remove manual git subprocess calls - now handled by uv-dynamic-versioning
- Add _version.py to .gitignore (auto-generated file)
- Configure fallback version for non-git environments (PyPI installs)
- All tests pass (44 unit + 183 integration)
- Version now follows PEP440: 0.0.0.post3.dev0+60259be.dirty

Co-authored-by: zenitraM <863975+zenitraM@users.noreply.github.com>
Co-authored-by: zenitraM <863975+zenitraM@users.noreply.github.com>
Copilot AI changed the title [WIP] Add version display at the bottom of pages Display application version in footer using uv-dynamic-versioning Dec 2, 2025
Copilot AI requested a review from zenitraM December 2, 2025 19:15
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.

Feature Request: Show version

2 participants