-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.py
112 lines (102 loc) · 3.26 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import re
import ast
import sys
from urllib import request
import json
from setuptools import setup, find_packages
if sys.platform == 'win32':
from cx_Freeze import setup, Executable
base = None
executables = [Executable(
script='alcli/alertlogic_cli.py',
targetName='alcli',
base=base,
icon='icons/alertlogic-win.ico'
)
]
else:
executables = []
with open('README.md') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
try:
# This is to force definitions to be upgraded every build not related to the definitions change
sdk_pypi_url = "https://pypi.org/pypi/alertlogic-sdk-python/json"
with request.urlopen(sdk_pypi_url) as defs_rq:
defs_info = json.loads(defs_rq.read())
sdk_latest_version = defs_info['info']['version']
sdk_dependency = 'alertlogic-sdk-python>=' + sdk_latest_version
except:
sdk_dependency = 'alertlogic-sdk-python>=v1.0.47'
requirements = [
sdk_dependency,
'configparser==4.0.2',
'pyyaml>=5.4',
'jmespath==0.9.5',
'importlib_metadata==1.6.0'
]
# Prevent setuptools_scm from adding 'dev' to the version for branch CI testing
def version_generator():
def semver_version(version):
from setuptools_scm.version import guess_next_version
if version.distance==0:
return version.format_with("{tag}")
return version.format_next_version(guess_next_version, '{guessed}')
return {
'version_scheme': semver_version,
'local_scheme': 'no-local-version',
'write_to': "alcli/version.py",
}
setup(
name='alcli',
use_scm_version=version_generator,
setup_requires=['setuptools_scm'],
url='https://github.com/alertlogic/alcli',
license='MIT license',
author='Alert Logic Inc.',
author_email='devsupport@alertlogic.com',
python_requires='>=3.7',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8'
],
description='The Alert Logic Command Line Utility (CLI).',
long_description=readme + '\n\n' + history,
long_description_content_type='text/markdown',
entry_points = {
'console_scripts': [
'alcli = alcli.alertlogic_cli:main'
]
},
scripts=[],
packages=find_packages(exclude=['contrib', 'docs', 'tests*', 'troubleshooting']),
include_package_data=True,
zip_safe=False,
platforms='any',
install_requires=requirements,
extras_require={
'dev': [
'pytest>=3',
'mock>=2.0.0',
'httpretty>=0.8.14',
'pycodestyle>=2.3.1'
],
},
options = {
'build_exe': {
'packages': ['os', 'sys', 'ctypes', 'jsonschema', 'html', 'almdrlib', 'alcli'],
'excludes': ['tkinter','tcl','ttk'],
'include_msvcr': True
},
'bdist_msi': {
'add_to_path': True
}
},
executables = executables,
keywords=['alcli', 'almdr', 'alertlogic', 'alertlogic-cli']
)