-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
34 lines (29 loc) · 1.01 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import os
import re
from setuptools import setup, find_packages
ROOT_DIR = os.path.dirname(__file__)
def find_version(filepath: str) -> str:
"""Extract version information from the given filepath.
"""
with open(filepath) as fp:
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
fp.read(), re.M)
if version_match:
print(f"version: {version_match.group(1)}")
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
def get_path(*filepath) -> str:
return os.path.join(ROOT_DIR, *filepath)
def get_version() -> str:
version = find_version(get_path("version.py"))
return version
setup(
name="remote pdb",
version=get_version(),
author="LEI WANG",
license='MIT',
author_email='[email protected]',
url="https://github.com/yiakwy-xpu-ml-framework-team/Tooklkit-remote-pdb-for-pytorch-distributed.git",
packages=find_packages(),
python_requires='>=3.10',
)