mirror of
https://github.com/nomadkaraoke/karaoke-gen.git
synced 2026-11-28 01:49:00 +09:00
- Add backend/version.py to avoid circular imports - Return server_version and distribution_services from /api/jobs/upload - Display distribution service status (Dropbox, GDrive, YouTube, Discord) in remote CLI after job submission - Show which services are enabled, using defaults, and have valid credentials
28 lines
677 B
Python
28 lines
677 B
Python
"""
|
|
Version module for karaoke-gen backend.
|
|
|
|
Separated to avoid circular imports.
|
|
"""
|
|
import os
|
|
|
|
|
|
def get_version() -> str:
|
|
"""Get package version from environment variable, installed package, or fallback."""
|
|
# First check environment variable (set during deployment)
|
|
env_version = os.environ.get("KARAOKE_GEN_VERSION")
|
|
if env_version:
|
|
return env_version
|
|
|
|
# Try to get from installed package metadata
|
|
try:
|
|
from importlib.metadata import version
|
|
return version("karaoke-gen")
|
|
except Exception:
|
|
pass
|
|
|
|
# Fallback if package not installed (e.g., during development)
|
|
return "dev"
|
|
|
|
|
|
VERSION = get_version()
|