Skip to content

Commit ae60c48

Browse files
authored
fix: pin the versions of grpcio and grpcio-tools (#173)
Changes: 1. Narrow down the version of grpcio and grpcio-tools to correctly fix protobuf 4. 2. Fix the package version fetching. 3. Remove unnecessary build_proto.py.
1 parent 3f1c3e5 commit ae60c48

File tree

3 files changed

+13
-21
lines changed

3 files changed

+13
-21
lines changed

build_proto.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

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: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Copyright 2025 Toyota Research Institute. All rights reserved.
2+
import importlib.util
23
import logging
34
import os
45
from pathlib import Path
@@ -10,10 +11,16 @@
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

@@ -30,7 +37,8 @@
3037
]
3138
setup_requires = [
3239
"protobuf>=4.0.0,<5.0.0",
33-
"grpcio-tools<1.66.0", # for protobuf 4.X.X support.
40+
"grpcio==1.62.2", # for the latest protobuf 4.X.X support.
41+
"grpcio-tools==1.62.2", # for the latest protobuf 4.X.X support.
3442
]
3543

3644

@@ -61,7 +69,7 @@ def run(self):
6169
packages = find_packages(exclude=["tests"])
6270

6371
setup(
64-
name="dgp",
72+
name=_PACKAGE,
6573
version=_VERSION,
6674
description="Dataset Governance Policy (DGP) for Autonomous Vehicle ML datasets.",
6775
long_description=open("README.md", encoding="utf-8").read(),

0 commit comments

Comments
 (0)