Skip to content

Commit d6cd17d

Browse files
committed
fix: fix package version fetching
1 parent 90c7e0e commit d6cd17d

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

dgp/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright 2021-2022 Toyota Research Institute. All rights reserved.
22
import os
33

4-
__version__ = "1.6.0"
4+
__version__ = "2.0.1"
55

66
DGP_PATH = os.getenv("DGP_PATH", default=os.getenv("HOME", os.getcwd()))
77
DGP_DATA_DIR = os.path.join(DGP_PATH, ".dgp")

setup.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,20 @@
77
from setuptools.command.build_py import build_py
88
from setuptools.command.develop import develop
99
from setuptools.command.install import install
10+
import importlib.util
1011

1112
logger = logging.getLogger(__file__)
1213

13-
__version__ = "2.0.0"
14-
14+
_PACKAGE = "dgp"
1515
_ROOT_DIRPATH = Path(__file__).parent.absolute()
1616

17+
_init_py= _ROOT_DIRPATH / _PACKAGE / "__init__.py"
18+
_spec = importlib.util.spec_from_file_location(_PACKAGE, _init_py)
19+
_module = importlib.util.module_from_spec(_spec)
20+
_spec.loader.exec_module(_module)
21+
22+
__version__ = _module.__version__
23+
1724
# Specify the dev version for development.
1825
_DEV_VERSION = str(os.environ.get("DGP_DEV_VERSION", ""))
1926

@@ -62,7 +69,7 @@ def run(self):
6269
packages = find_packages(exclude=["tests"])
6370

6471
setup(
65-
name="dgp",
72+
name=_PACKAGE,
6673
version=_VERSION,
6774
description="Dataset Governance Policy (DGP) for Autonomous Vehicle ML datasets.",
6875
long_description=open("README.md", encoding="utf-8").read(),

0 commit comments

Comments
 (0)