Add version tracking via pyproject.toml

- Add pyproject.toml with project metadata and version 1.0.0
- Update config.py to load version from pyproject.toml
- Update Dockerfile to include pyproject.toml in build
- Add CHANGELOG.md documenting initial release
- Update build workflow registry to internal domain

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-14 11:30:25 +01:00
co-authored by Claude Opus 4.5
parent 488a4e8a91
commit 2d3c2d23b5
5 changed files with 51 additions and 4 deletions
+3 -3
View File
@@ -13,7 +13,7 @@ jobs:
- name: Login to Gitea Registry - name: Login to Gitea Registry
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
registry: git.schweitz.net registry: git.schweitz.internal
username: ${{ secrets.REGISTRY_USER }} username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }} password: ${{ secrets.REGISTRY_PASSWORD }}
@@ -23,5 +23,5 @@ jobs:
context: . context: .
push: true push: true
tags: | tags: |
git.schweitz.net/jpmschweitzer/core-api:latest git.schweitz.internal/jpmschweitzer/core-api:latest
git.schweitz.net/jpmschweitzer/core-api:${{ github.ref_name }} git.schweitz.internal/jpmschweitzer/core-api:${{ github.ref_name }}
+20
View File
@@ -0,0 +1,20 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.0.0] - 2024-12-14
### Added
- Initial release of Core Code API service extracted from portainer-core
- Infrastructure management endpoints for Portainer, NPM, and Uptime Kuma
- Web scraping service with content extraction
- DNS management endpoints
- Health check endpoints with diagnostics
- OIDC authentication support via Authentik
- Ollama integration for embeddings
- OpenAPI documentation (Swagger UI and ReDoc)
- Docker containerization with CI/CD workflow
+1
View File
@@ -12,6 +12,7 @@ COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir -r requirements.txt
# Copy application # Copy application
COPY pyproject.toml .
COPY src/ ./src/ COPY src/ ./src/
COPY static/ ./static/ COPY static/ ./static/
+10
View File
@@ -0,0 +1,10 @@
[project]
name = "core-api"
version = "1.0.0"
description = "Core Code API - Infrastructure management and tools API"
readme = "README.md"
requires-python = ">=3.12"
license = {text = "MIT"}
[tool.setuptools]
packages = ["src"]
+17 -1
View File
@@ -1,9 +1,25 @@
""" """
Global configuration for Core Code API Global configuration for Core Code API
""" """
import tomllib
from pathlib import Path
from pydantic_settings import BaseSettings from pydantic_settings import BaseSettings
from functools import lru_cache from functools import lru_cache
def _get_version_from_pyproject() -> str:
"""Load version from pyproject.toml"""
pyproject_path = Path(__file__).parent.parent / "pyproject.toml"
try:
with open(pyproject_path, "rb") as f:
data = tomllib.load(f)
return data.get("project", {}).get("version", "0.0.0")
except FileNotFoundError:
return "0.0.0"
__version__ = _get_version_from_pyproject()
# Import infrastructure credentials from gitignored module # Import infrastructure credentials from gitignored module
try: try:
from src.credentials import ( from src.credentials import (
@@ -35,7 +51,7 @@ class Settings(BaseSettings):
# Application # Application
app_name: str = "Core Code API" app_name: str = "Core Code API"
app_version: str = "1.0.0" app_version: str = __version__
debug: bool = False debug: bool = False
# Server # Server