-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
37 lines (30 loc) · 1.02 KB
/
Copy pathsetup.py
File metadata and controls
37 lines (30 loc) · 1.02 KB
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
35
36
37
import os
import subprocess
import setuptools
from setuptools import find_namespace_packages, find_packages
from setuptools.dist import Distribution
# 消除whl压缩包的时间戳差异
os.environ['SOURCE_DATE_EPOCH'] = '0'
current_version = os.getenv('VERSION', '1.0.0')
class BinaryDistribution(Distribution):
"""Distribution which always forces a binary package with platform name"""
def has_ext_modules(self):
return True
try:
cmd = ["git", "rev-parse", f"--short=8", "HEAD"]
revision = '+' + subprocess.check_output(cmd).strip().decode("utf-8")
except Exception as _:
revision = ''
print(f'revision: {revision}')
setuptools.setup(
name="deep_ep",
version=current_version + revision,
author="",
author_email="",
description="python api for deep_ep",
packages=find_packages(exclude=["tests", "tests.*"]),
install_requires=["torch"],
python_requires=">=3.7",
package_data={"deep_ep": ["deep_ep_cpp.cpython*.so", "vendors", "vendors/**"]},
distclass=BinaryDistribution
)