Moved version to the FastAPI app instead

This commit is contained in:
Donkie
2023-07-10 11:45:46 +02:00
parent 85aae6119d
commit b9ee4626d3
2 changed files with 16 additions and 6 deletions

View File

@@ -7,6 +7,7 @@ from pathlib import Path
from typing import Optional
from urllib import parse
import pkg_resources
from platformdirs import user_data_dir
@@ -235,3 +236,12 @@ def get_backups_dir() -> Path:
backups_dir = data_dir.joinpath("backups")
backups_dir.mkdir(parents=True, exist_ok=True)
return backups_dir
def get_version() -> str:
"""Get the version of the package.
Returns:
str: The version.
"""
return pkg_resources.get_distribution("spoolman").version