|
2 | 2 | import os |
3 | 3 | from setuptools import setup, find_packages |
4 | 4 |
|
5 | | -ROOT = os.path.dirname(__file__) |
| 5 | +ROOT = os.path.dirname(os.path.abspath(__file__)) |
6 | 6 |
|
7 | 7 |
|
8 | 8 | # Read in the package version per recommendations from: |
9 | 9 | # https://packaging.python.org/guides/single-sourcing-package-version/ |
10 | | -def get_version(): |
11 | | - with open(os.path.join(ROOT, "videodb", "__init__.py")) as f: |
12 | | - for line in f.readlines(): |
13 | | - if line.startswith("__version__"): |
14 | | - return line.split("=")[1].strip().strip('''"''') |
| 10 | + |
| 11 | +about_path = os.path.join(ROOT, "videodb", "__about__.py") |
| 12 | +about = {} |
| 13 | +with open(about_path) as fp: |
| 14 | + exec(fp.read(), about) |
15 | 15 |
|
16 | 16 |
|
17 | 17 | # read the contents of README file |
18 | 18 | long_description = open(os.path.join(ROOT, "README.md"), "r", encoding="utf-8").read() |
19 | 19 |
|
20 | 20 |
|
21 | 21 | setup( |
22 | | - name="videodb", |
23 | | - version=get_version(), |
24 | | - author="videodb", |
25 | | - author_email="contact@videodb.io", |
| 22 | + name=about["__title__"], |
| 23 | + version=about["__version__"], |
| 24 | + author=about["__author__"], |
| 25 | + author_email=about["__email__"], |
26 | 26 | description="VideoDB Python SDK", |
27 | 27 | long_description=long_description, |
28 | 28 | long_description_content_type="text/markdown", |
29 | | - url="https://github.com/video-db/videodb-python", |
| 29 | + url=about["__url__"], |
30 | 30 | packages=find_packages(exclude=["tests", "tests.*"]), |
31 | 31 | python_requires=">=3.8", |
32 | 32 | install_requires=[ |
|
0 commit comments