setup.py 1.9 KB
Newer Older
Hang Zhang's avatar
init  
Hang Zhang committed
1
2
3
4
5
6
7
8
9
10
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Created by: Hang Zhang
## ECE Department, Rutgers University
## Email: zhang.hang@rutgers.edu
## Copyright (c) 2017
##
## This source code is licensed under the MIT-style license found in the
## LICENSE file in the root directory of this source tree 
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Hang Zhang's avatar
v1.0.1  
Hang Zhang committed
11
import io
Hang Zhang's avatar
init  
Hang Zhang committed
12
import os
13
import subprocess
Hang Zhang's avatar
init  
Hang Zhang committed
14
15
16

from setuptools import setup, find_packages

Hang Zhang's avatar
v0.1.0  
Hang Zhang committed
17
cwd = os.path.dirname(os.path.abspath(__file__))
Hang Zhang's avatar
init  
Hang Zhang committed
18

Hang Zhang's avatar
Hang Zhang committed
19
version = '1.2.0'
Hang Zhang's avatar
v0.1.0  
Hang Zhang committed
20
try:
Hang Zhang's avatar
Hang Zhang committed
21
22
    from datetime import date
    today = date.today()
Stacy Yang's avatar
Stacy Yang committed
23
    day = today.strftime("b%Y%m%d")
Hang Zhang's avatar
Hang Zhang committed
24
    version += day
Hang Zhang's avatar
v0.1.0  
Hang Zhang committed
25
26
except Exception:
    pass
27

Zhang's avatar
v0.4.2  
Zhang committed
28
29
30
31
32
33
34
35
def create_version_file():
    global version, cwd
    print('-- Building version ' + version)
    version_path = os.path.join(cwd, 'encoding', 'version.py')
    with open(version_path, 'w') as f:
        f.write('"""This is encoding version file."""\n')
        f.write("__version__ = '{}'\n".format(version))

Zhang's avatar
Zhang committed
36
37
38
39
requirements = [
    'numpy',
    'tqdm',
    'nose',
Hang Zhang's avatar
Hang Zhang committed
40
    'portalocker',
Hang Zhang's avatar
Hang Zhang committed
41
42
    'torch>=1.4.0',
    'torchvision>=0.5.0',
Zhang's avatar
v0.4.2  
Zhang committed
43
44
45
46
47
    'Pillow',
    'scipy',
    'requests',
]

Hang Zhang's avatar
Hang Zhang committed
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
if __name__ == '__main__':
    create_version_file()
    setup(
        name="torch-encoding",
        version=version,
        author="Hang Zhang",
        author_email="zhanghang0704@gmail.com",
        url="https://github.com/zhanghang1989/PyTorch-Encoding",
        description="PyTorch Encoding Package",
        long_description=open('README.md').read(),
        long_description_content_type='text/markdown',
        license='MIT',
        install_requires=requirements,
        packages=find_packages(exclude=["tests", "experiments"]),
        package_data={ 'encoding': [
            'LICENSE',
            'lib/cpu/*.h',
            'lib/cpu/*.cpp',
            'lib/gpu/*.h',
            'lib/gpu/*.cpp',
            'lib/gpu/*.cu',
        ]},
    )