Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f67ebededd | ||
| 79846dfed5 | |||
|
1f306cce53
|
|||
|
|
9b20484753 | ||
| e5ede589e7 | |||
| c7089edfdc | |||
|
1ed1403c43
|
|||
|
40d6e8824e
|
|||
|
|
d4ef36a54b | ||
| 8a0b73c60d | |||
|
c9d6d5de8f
|
|||
|
|
8d8e7549f6 | ||
| 5f09116071 | |||
|
26ef555765
|
|||
|
|
ea68370451 | ||
| 2343d66fe2 | |||
|
302599bb80
|
@@ -1,24 +0,0 @@
|
|||||||
[tool.bumpversion]
|
|
||||||
current_version = "0.1.7"
|
|
||||||
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
|
||||||
serialize = ["{major}.{minor}.{patch}"]
|
|
||||||
search = "{current_version}"
|
|
||||||
replace = "{new_version}"
|
|
||||||
regex = false
|
|
||||||
ignore_missing_version = false
|
|
||||||
ignore_missing_files = false
|
|
||||||
tag = true
|
|
||||||
sign_tags = false
|
|
||||||
tag_name = "v{new_version}"
|
|
||||||
tag_message = "Bump version: {current_version} → {new_version}"
|
|
||||||
allow_dirty = false
|
|
||||||
commit = true
|
|
||||||
message = "Bump version: {current_version} → {new_version}"
|
|
||||||
moveable_tags = []
|
|
||||||
commit_args = ""
|
|
||||||
setup_hooks = []
|
|
||||||
pre_commit_hooks = []
|
|
||||||
post_commit_hooks = []
|
|
||||||
|
|
||||||
[[tool.bumpversion.files]]
|
|
||||||
filename = "pyproject.toml"
|
|
||||||
@@ -1,10 +1,6 @@
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
release_notes:
|
|
||||||
description: Release notes (use \n for newlines)
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
github_release:
|
github_release:
|
||||||
description: 'Create Gitea Release'
|
description: 'Create Gitea Release'
|
||||||
default: true
|
default: true
|
||||||
@@ -48,37 +44,31 @@ jobs:
|
|||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
branch: ${{ github.ref }}
|
branch: ${{ github.ref }}
|
||||||
|
|
||||||
- name: Add release notes to environment
|
- name: Build Changelog
|
||||||
id: add_release_notes
|
id: build_changelog
|
||||||
run: |
|
uses: https://github.com/mikepenz/release-changelog-builder-action@v5
|
||||||
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
|
with:
|
||||||
echo "${{ github.event.inputs.release_notes }}" >> $GITHUB_ENV
|
platform: "gitea"
|
||||||
echo "EOF" >> $GITHUB_ENV
|
baseURL: "http://gitea:3000"
|
||||||
|
configuration: ".gitea/changelog-config.json"
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
- name: Build package
|
- name: Build package
|
||||||
run: uv build
|
run: uv build
|
||||||
- name: Publish package
|
- name: Publish package
|
||||||
env:
|
env:
|
||||||
USERNAME: ${{ github.repository_owner }}
|
USERNAME: ${{ github.repository_owner }}
|
||||||
run: uv publish --publish-url https://git.theprivateserver.de/api/packages/$USERNAME/pypi/ -t ${{ secrets.TOKEN }}
|
run: uv publish --publish-url https://git.theprivateserver.de/api/packages/$USERNAME/pypi/ -t ${{ secrets.TOKEN }}
|
||||||
- name: Generate changelog
|
|
||||||
id: changelog
|
|
||||||
uses: metcalfc/changelog-generator@v4.6.2
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.TOKEN }}
|
|
||||||
- name: Get the changelog
|
|
||||||
run: |
|
|
||||||
cat << "EOF"
|
|
||||||
${{ steps.changelog.outputs.changelog }}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
id: create_release
|
id: create_release
|
||||||
if: ${{ github.event.inputs.github_release == 'true' }}
|
if: ${{ github.event.inputs.github_release == 'true' }}
|
||||||
uses: softprops/action-gh-release@master
|
uses: softprops/action-gh-release@master
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ env.VERSION }}
|
tag_name: v${{ env.VERSION }}
|
||||||
release_name: Release ${{ env.VERSION }}
|
release_name: Release ${{ env.VERSION }}
|
||||||
body: ${{ steps.changelog.outputs.changelog }}
|
body: ${{steps.build_changelog.outputs.changelog}}
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
make_latest: true
|
make_latest: true
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "komconfig"
|
name = "komconfig"
|
||||||
version = "0.1.7"
|
version = "0.2.2"
|
||||||
description = "A small library providing a config class that provides settings data for the KomSuite"
|
description = "A small library providing a config class that provides settings data for the KomSuite"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
authors = [{ name = "WorldTeacher", email = "coding_contact@pm.me" }]
|
authors = [{ name = "WorldTeacher", email = "coding_contact@pm.me" }]
|
||||||
@@ -13,3 +13,25 @@ build-backend = "hatchling.build"
|
|||||||
|
|
||||||
[dependency-groups]
|
[dependency-groups]
|
||||||
test = ["pytest>=8.3.4"]
|
test = ["pytest>=8.3.4"]
|
||||||
|
|
||||||
|
[tool.bumpversion]
|
||||||
|
current_version = "0.2.2"
|
||||||
|
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
||||||
|
serialize = ["{major}.{minor}.{patch}"]
|
||||||
|
search = "{current_version}"
|
||||||
|
replace = "{new_version}"
|
||||||
|
regex = false
|
||||||
|
ignore_missing_version = false
|
||||||
|
ignore_missing_files = false
|
||||||
|
tag = true
|
||||||
|
sign_tags = false
|
||||||
|
tag_name = "v{new_version}"
|
||||||
|
tag_message = "Bump version: {current_version} → {new_version}"
|
||||||
|
allow_dirty = true
|
||||||
|
commit = true
|
||||||
|
message = "Bump version: {current_version} → {new_version}"
|
||||||
|
moveable_tags = []
|
||||||
|
commit_args = ""
|
||||||
|
setup_hooks = []
|
||||||
|
pre_commit_hooks = []
|
||||||
|
post_commit_hooks = []
|
||||||
@@ -1,13 +1,48 @@
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import List, Optional
|
from typing import List, Optional, Union
|
||||||
import os
|
import os
|
||||||
from omegaconf import OmegaConf, DictConfig
|
from omegaconf import OmegaConf, DictConfig
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from komconfig import CONFIG_PATH
|
from komconfig import CONFIG_PATH
|
||||||
|
from urllib.parse import quote_plus
|
||||||
|
|
||||||
SETTINGS_PATH = os.path.join(CONFIG_PATH, "config.yaml")
|
SETTINGS_PATH = os.path.join(CONFIG_PATH, "config.yaml")
|
||||||
|
@dataclass
|
||||||
|
class RemoteSettings:
|
||||||
|
url: str
|
||||||
|
port: int
|
||||||
|
user: str
|
||||||
|
password: str
|
||||||
|
database_name: str = "komcache"
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class Cache:
|
||||||
|
mode: str
|
||||||
|
remote: dict[str, Union[str, int]] |RemoteSettings
|
||||||
|
local_path: str | Path
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def __post__init__(self):
|
||||||
|
if self.mode == "remote":
|
||||||
|
self.remote = RemoteSettings(**self.remote)
|
||||||
|
else:
|
||||||
|
self.remote = None
|
||||||
|
self.local_path = Path(self.local_path).expanduser()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def path(self):
|
||||||
|
if self.mode == "local":
|
||||||
|
return Path(self.local_path).expanduser()
|
||||||
|
else:
|
||||||
|
return f"{self.remote.url}:{self.remote.port}"
|
||||||
|
|
||||||
|
@property
|
||||||
|
def url(self):
|
||||||
|
password = quote_plus(self.remote.password) if self.remote else ""
|
||||||
|
return f"mysql+pymysql://{self.remote.user}:{password}@{self.remote.url}:{self.remote.port}/{self.remote.database_name}"
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Komga:
|
class Komga:
|
||||||
"""Komga server settings."""
|
"""Komga server settings."""
|
||||||
@@ -329,6 +364,10 @@ class Settings:
|
|||||||
def komtagger(self):
|
def komtagger(self):
|
||||||
return KomTagger(**self._config.komtagger)
|
return KomTagger(**self._config.komtagger)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def cache(self):
|
||||||
|
return Cache(**self._config.cache)
|
||||||
|
|
||||||
def komtagger_attr(self, name):
|
def komtagger_attr(self, name):
|
||||||
return getattr(self.komtagger, name)
|
return getattr(self.komtagger, name)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user