-
Notifications
You must be signed in to change notification settings - Fork 528
/
setup.py
44 lines (38 loc) · 1.11 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
#!/usr/bin/env python
import os, sys
import shutil
import datetime
from setuptools import setup, find_packages
from setuptools.command.install import install
readme = open("README.md").read()
fp = open("thop/__version__.py", "r").read()
VERSION = eval(fp.strip().split()[-1])
requirements = [
"torch",
]
# import subprocess
# commit_hash = subprocess.check_output("git rev-parse HEAD", shell=True).decode('UTF-8').rstrip()
# VERSION += "_" + str(int(commit_hash, 16))[:8]
VERSION += "_" + datetime.datetime.now().strftime("%Y%m%d%H%M")[2:]
print(VERSION)
setup(
# Metadata
name="thop",
version=VERSION,
author="Ligeng Zhu",
author_email="[email protected]",
url="https://github.com/Lyken17/pytorch-OpCounter/",
description="A tool to count the FLOPs of PyTorch model.",
long_description=readme,
long_description_content_type="text/markdown",
license="MIT",
# Package info
packages=find_packages(exclude=("*test*",)),
#
zip_safe=True,
install_requires=requirements,
# Classifiers
classifiers=[
"Programming Language :: Python :: 3",
],
)