chore: add version management and changelog
- Add pyproject.toml with project metadata and version (1.1.0) - Update config.py to read version from pyproject.toml - Update main.py to use centralized version in FastAPI app - Add CHANGELOG.md documenting v1.0.0 and v1.1.0 changes Version is now the single source of truth in pyproject.toml and is displayed in the health check endpoint and API docs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+12
-1
@@ -4,9 +4,20 @@ Following best practices: modular settings, environment-based config.
|
||||
"""
|
||||
|
||||
from functools import lru_cache
|
||||
from pathlib import Path
|
||||
from pydantic import Field
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
# Read version from pyproject.toml
|
||||
try:
|
||||
import tomllib
|
||||
_pyproject_path = Path(__file__).parent.parent / "pyproject.toml"
|
||||
with open(_pyproject_path, "rb") as f:
|
||||
_pyproject = tomllib.load(f)
|
||||
__version__ = _pyproject["project"]["version"]
|
||||
except Exception:
|
||||
__version__ = "0.0.0" # Fallback if pyproject.toml not found
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
"""Application settings loaded from environment variables."""
|
||||
@@ -75,7 +86,7 @@ class Settings(BaseSettings):
|
||||
|
||||
# Application
|
||||
app_name: str = Field(default="Library Desk", description="Application name")
|
||||
app_version: str = Field(default="1.0.0", description="Application version")
|
||||
app_version: str = Field(default=__version__, description="Application version")
|
||||
debug: bool = Field(default=False, description="Debug mode")
|
||||
|
||||
@property
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ from typing import Dict, Any
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
from src.config import Settings, get_settings
|
||||
from src.config import Settings, get_settings, __version__
|
||||
from src.core.dependencies import verify_api_key
|
||||
|
||||
# Configure logging
|
||||
@@ -30,7 +30,7 @@ logger = logging.getLogger(__name__)
|
||||
app = FastAPI(
|
||||
title="Library Desk API",
|
||||
description="Coordination service for The Library system - HybridRAG queries, document ingestion, entity extraction, and mind map generation",
|
||||
version="1.0.0",
|
||||
version=__version__,
|
||||
docs_url="/docs",
|
||||
redoc_url="/redoc",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user