From cedff6824787e040c7dd821fb78fc8ef6190154e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sun, 23 Apr 2023 22:14:33 +0800 Subject: [PATCH] Added the "VERSION" constant to the "flask_digest_auth" module for the package version, and revised "pyproject.toml" and "conf.py" to read the version from it. --- docs/source/conf.py | 3 ++- pyproject.toml | 5 ++++- src/flask_digest_auth/__init__.py | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 923c406..5397471 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 flask_digest_auth # -- 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 = 'Flask-DigestAuth' copyright = '2022-2023, imacat' author = 'imacat' -release = '0.5.0' +release = flask_digest_auth.VERSION # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/pyproject.toml b/pyproject.toml index dd98803..44429ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ [project] name = "Flask-DigestAuth" -version = "0.5.0" +dynamic = ["version"] description = "The Flask HTTP Digest Authentication project." readme = "README.rst" requires-python = ">=3.7" @@ -51,3 +51,6 @@ test = [ [build-system] requires = ["setuptools>=42"] build-backend = "setuptools.build_meta" + +[tool.setuptools.dynamic] +version = {attr = "flask_digest_auth.VERSION"} diff --git a/src/flask_digest_auth/__init__.py b/src/flask_digest_auth/__init__.py index d645b49..f7bd659 100644 --- a/src/flask_digest_auth/__init__.py +++ b/src/flask_digest_auth/__init__.py @@ -21,3 +21,6 @@ from flask_digest_auth.algo import make_password_hash, calc_response from flask_digest_auth.auth import DigestAuth from flask_digest_auth.test import Client + +VERSION: str = "0.5.0" +"""The package version."""