-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
51 lines (42 loc) · 1.3 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
51
from distutils.core import setup
from setuptools import setup, Extension, distutils, Command, find_packages
import setuptools.command.install
import distutils.command.build
import distutils.command.clean
import os
import shutil
## extending the install command functionality.
class install(setuptools.command.install.install):
def run(self):
print ("INFO: Setup.py is installing")
setuptools.command.install.install.run(self)
## extending the clean command functionality.
class clean(distutils.command.clean.clean):
def run(self):
print ("INFO: setup.py is being cleaned")
cwd = os.getcwd()
build_dir = os.path.join(cwd, "build")
egg_dir = os.path.join(cwd, "pymi.egg-info")
if os.path.isdir(build_dir):
shutil.rmtree(build_dir)
shutil.rmtree(egg_dir)
print("OK: Deleted the build directory.")
distutils.command.clean.clean.run(self)
cmd_class = {
"clean" : clean,
"install" : install,
}
setup(
name='pymi',
version='0.1',
cmdclass=cmd_class,
packages=['pymi',],
long_description=open('README.md').read(),
)
setup(
name = 'pymi',
version = '0.1',
cmdclass = cmd_class,
packages = ['pymi',],
long_description = 'Pytorch Module(network) instrumentation',
)