-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
50 lines (44 loc) · 1.35 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import os
import platform
import subprocess
import time
import numpy as np
from setuptools import find_packages, setup, Extension
from Cython.Build import cythonize
#from torch.utils.cpp_extension import BuildExtension, CUDAExtension
def get_git_hash():
def _minimal_ext_cmd(cmd):
# construct minimal environment
env = {}
for k in ['SYSTEMROOT', 'PATH', 'HOME']:
v = os.environ.get(k)
if v is not None:
env[k] = v
# LANGUAGE is used on win32
env['LANGUAGE'] = 'C'
env['LANG'] = 'C'
env['LC_ALL'] = 'C'
out = subprocess.Popen(
cmd, stdout=subprocess.PIPE, env=env).communicate()[0]
return out
try:
out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD'])
sha = out.strip().decode('ascii')
except OSError:
sha = 'unknown'
return sha
setup(name='pktool',
version='0.1',
description='paulikarl tools',
classifiers=[
'Programming Language :: Python',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
],
url='https://www.python.org/',
author='paulikarl',
author_email='[email protected]',
license='pd',
packages=find_packages(exclude=["build"]),
zip_safe=True
)