adding package version into package

This commit is contained in:
Sefik Ilkin Serengil 2024-02-10 18:18:02 +00:00
parent c9569cd540
commit 5230943de3
5 changed files with 20 additions and 2 deletions

View File

@ -21,6 +21,7 @@ from deepface.modules import (
detection, detection,
realtime, realtime,
) )
from deepface import __version__
logger = Logger(module="DeepFace") logger = Logger(module="DeepFace")

View File

@ -0,0 +1 @@
__version__ = "0.0.85"

3
package_info.json Normal file
View File

@ -0,0 +1,3 @@
{
"version": "0.0.85"
}

View File

@ -1,3 +1,4 @@
import json
import setuptools import setuptools
with open("README.md", "r", encoding="utf-8") as fh: with open("README.md", "r", encoding="utf-8") as fh:
@ -6,16 +7,19 @@ with open("README.md", "r", encoding="utf-8") as fh:
with open("requirements.txt", "r", encoding="utf-8") as f: with open("requirements.txt", "r", encoding="utf-8") as f:
requirements = f.read().split("\n") requirements = f.read().split("\n")
with open("package_info.json", "r", encoding="utf-8") as f:
package_info = json.load(f)
setuptools.setup( setuptools.setup(
name="deepface", name="deepface",
version="0.0.85", version=package_info["version"],
author="Sefik Ilkin Serengil", author="Sefik Ilkin Serengil",
author_email="serengil@gmail.com", author_email="serengil@gmail.com",
description=( description=(
"A Lightweight Face Recognition and Facial Attribute Analysis Framework" "A Lightweight Face Recognition and Facial Attribute Analysis Framework"
" (Age, Gender, Emotion, Race) for Python" " (Age, Gender, Emotion, Race) for Python"
), ),
data_files=[("", ["README.md", "requirements.txt"])], data_files=[("", ["README.md", "requirements.txt", "package_info.json"])],
long_description=long_description, long_description=long_description,
long_description_content_type="text/markdown", long_description_content_type="text/markdown",
url="https://github.com/serengil/deepface", url="https://github.com/serengil/deepface",

9
tests/test_version.py Normal file
View File

@ -0,0 +1,9 @@
import json
from deepface import DeepFace
def test_version():
with open("../package_info.json", "r", encoding="utf-8") as f:
package_info = json.load(f)
assert DeepFace.__version__ == package_info["version"]