diff --git a/docs/source/conf.py b/docs/source/conf.py index 3472540..007a70c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -6,6 +6,7 @@ import os import sys sys.path.insert(0, os.path.abspath('../../src/')) +import accounting # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information @@ -13,7 +14,7 @@ sys.path.insert(0, os.path.abspath('../../src/')) project = 'Mia! Accounting' copyright = '2023, imacat' author = 'imacat' -release = '1.4.1' +release = accounting.VERSION # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/pyproject.toml b/pyproject.toml index e815fdf..4728dd0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ [project] name = "mia-accounting" -version = "1.4.1" +dynamic = ["version"] description = "A Flask accounting module." readme = "README.rst" requires-python = ">=3.11" @@ -59,6 +59,9 @@ test = [ requires = ["setuptools>=42"] build-backend = "setuptools.build_meta" +[tool.setuptools.dynamic] +version = {attr = "accounting.VERSION"} + [tool.setuptools.exclude-package-data] "*" = [ "babel.cfg", diff --git a/src/accounting/__init__.py b/src/accounting/__init__.py index d2dd5b8..820363d 100644 --- a/src/accounting/__init__.py +++ b/src/accounting/__init__.py @@ -24,6 +24,8 @@ from flask_sqlalchemy import SQLAlchemy from accounting.utils.user import UserUtilityInterface +VERSION: str = "1.4.1" +"""The package version.""" db: SQLAlchemy = SQLAlchemy() """The database instance.""" data_dir: Path = Path(__file__).parent / "data"