-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
64 lines (53 loc) · 1.73 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
52
53
54
55
56
57
58
59
60
61
62
63
64
import os
import shutil
import sys
from distutils.core import setup, Command
from log_server import shutdownLogServer
import pkg_info
import progressBar
os.chdir('..')
class Uninstall(Command):
description = 'uninstall previous version'
user_options = []
def initialize_options(self):
self.cwd = None
def finalize_options(self):
self.cwd = os.getcwd()
def run(self):
path = sys.prefix + '/Lib/site-packages/autohdl'
if os.path.exists(path):
shutil.rmtree(path)
class ShutdownLogServer(Command):
description = 'Shutdown log server'
user_options = []
def initialize_options(self):
self.cwd = None
def finalize_options(self):
self.cwd = os.getcwd()
def run(self):
progressBar.run()
shutdownLogServer()
progressBar.stop()
def getDataTree(iPath):
res = []
for root, dirs, files in os.walk(iPath):
for f in files:
res.append(os.path.join(root,f).replace('autohdl/', ''))
return res
setup(name = 'AutoHDL',
version = pkg_info.getVersion(),
description = 'Automatization Utilities',
author = 'Max Golohov',
author_email = 'hex_wer@mail.ru',
platforms = ['win32'],
packages = ['autohdl',
'autohdl.programmator',
'autohdl.verilog',
'autohdl.lib',
'autohdl.lib.yaml',
'autohdl.lib.tinydav'],
package_data = {'autohdl': ['data/*']+getDataTree('autohdl/doc')+['lib/djtgcfg.exe']},
# + getDataTree('autohdl/test/fake_repo_gold') + getDataTree('autohdl/test/fake_repo')},
data_files = [('', ['autohdl/hdl.py'])],
cmdclass = {'uninstall': Uninstall, 'shutdownlog': ShutdownLogServer},
)