-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
68 lines (60 loc) · 1.75 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
65
66
67
68
"""
Infrastructure Agent: Setup configuration
Copyright (C) 2003-2025 ITRS Group Ltd. All rights reserved
"""
import os
import sys
TOX = 'TOX_WORK_DIR' in os.environ
SCRIPT_DIR = os.path.dirname(__file__)
if TOX:
from distutils.core import setup
else:
from cx_Freeze import Executable, setup
try:
with open(os.path.join(SCRIPT_DIR, 'VERSION'), 'r') as f_in:
VERSION = f_in.read().strip()
except FileNotFoundError:
VERSION = '0.0.0' # Probably from `make test` or similar
EXECUTABLE_CONFIG = {
"copyright": "Copyright (C) 2003-2025 ITRS Group Ltd.",
"icon": "icon.ico"
}
build_exe_options = {
'excludes': ['asyncio', 'unittest', 'tkinter', 'test', 'mock'],
}
if TOX:
executables = []
elif sys.platform.startswith('win32'):
executables = [
# Service Executable
Executable(script="win_svce_config.py", target_name="infra-svce.exe", base="Win32Service", **EXECUTABLE_CONFIG),
# Main Executable
Executable(script="main.py", target_name="infra-agent.exe", **EXECUTABLE_CONFIG)
]
build_exe_options = build_exe_options | {
"include_files": ["icon.ico"],
"includes": ["cx_Logging", "win_svce_handler"],
"include_msvcr": True
}
else:
executables = [
Executable(script='main.py', target_name="infrastructure-agent", base='Console', **EXECUTABLE_CONFIG)
]
setup(
name='infrastructure-agent',
version=VERSION,
description="Infrastructure Agent",
author="ITRS Group Ltd",
author_email="",
url="https://itrsgroup.com/",
options={'build_exe': build_exe_options},
executables=executables,
py_modules=[],
tests_require=[
'coverage',
'flake8',
'pytest',
'pytest-cov',
'pytest-mock',
],
)