|
| 1 | +# pylint: disable=invalid-name |
| 2 | + |
1 | 3 | from setuptools import setup, find_packages |
2 | 4 | import platform |
3 | 5 |
|
4 | 6 | try: |
5 | 7 | import distro |
| 8 | + |
6 | 9 | distro, version, _ = distro.linux_distribution(full_distribution_name=False) |
7 | 10 | except ImportError: |
8 | | - distro = version = '' |
| 11 | + distro = version = "" |
9 | 12 |
|
10 | | -platform_name=platform.system() |
| 13 | +platform_name = platform.system() |
11 | 14 |
|
12 | 15 | # Default to CentOS7 |
13 | | -data_files = [('/usr/lib/systemd/system', ['pkg/source/hubble.service']), |
14 | | - ('/etc/hubble', ['conf/hubble']), ] |
| 16 | +data_files = [ |
| 17 | + ("/usr/lib/systemd/system", ["pkg/source/hubble.service"]), |
| 18 | + ("/etc/hubble", ["conf/hubble"]), |
| 19 | +] |
15 | 20 |
|
16 | 21 | build_dependencies = [ |
17 | | - 'distro', |
18 | | - 'msgpack', |
19 | | - 'pyyaml', |
20 | | - 'objgraph', |
21 | | - 'pycryptodome', |
22 | | - 'cryptography', |
23 | | - 'pyopenssl', |
24 | | - 'requests>=2.13.0', |
25 | | - 'daemon', |
26 | | - 'defusedxml', |
27 | | - 'pygit2', |
28 | | - 'gitpython', |
29 | | - 'pyinotify', |
30 | | - 'cffi', |
31 | | - 'croniter', |
32 | | - 'vulners', |
33 | | - 'ntplib', |
34 | | - 'patch==1.*', |
35 | | - 'packaging', |
36 | | - 'pyparsing', |
37 | | - 'urllib3==1.25.8' |
| 22 | + "distro", |
| 23 | + "msgpack", |
| 24 | + "pyyaml", |
| 25 | + "objgraph", |
| 26 | + "pycryptodome", |
| 27 | + "cryptography", |
| 28 | + "pyopenssl", |
| 29 | + "requests>=2.13.0", |
| 30 | + "daemon", |
| 31 | + "pygit2", |
| 32 | + "gitpython", |
| 33 | + "pyinotify", |
| 34 | + "cffi", |
| 35 | + "croniter", |
| 36 | + "vulners", |
| 37 | + "ntplib", |
| 38 | + "patch==1.*", |
| 39 | + "packaging", |
| 40 | + "pyparsing", |
| 41 | + "urllib3>=1.26.5", |
38 | 42 | ] |
39 | 43 |
|
40 | | -if distro == 'redhat' or distro == 'centos': |
41 | | - if version.startswith('6'): |
42 | | - data_files = [('/etc/init.d', ['pkg/hubble']), |
43 | | - ('/etc/hubble', ['conf/hubble']), ] |
44 | | - elif version.startswith('7'): |
45 | | - data_files = [('/usr/lib/systemd/system', ['pkg/source/hubble.service']), |
46 | | - ('/etc/hubble', ['conf/hubble']), ] |
47 | | -elif distro == 'Amazon Linux AMI': |
48 | | - data_files = [('/etc/init.d', ['pkg/hubble']), |
49 | | - ('/etc/hubble', ['conf/hubble']), ] |
| 44 | +if distro == "redhat" or distro == "centos": |
| 45 | + if version.startswith("6"): |
| 46 | + data_files = [ |
| 47 | + ("/etc/init.d", ["pkg/hubble"]), |
| 48 | + ("/etc/hubble", ["conf/hubble"]), |
| 49 | + ] |
| 50 | + elif version.startswith("7"): |
| 51 | + data_files = [ |
| 52 | + ("/usr/lib/systemd/system", ["pkg/source/hubble.service"]), |
| 53 | + ("/etc/hubble", ["conf/hubble"]), |
| 54 | + ] |
| 55 | +elif distro == "Amazon Linux AMI": |
| 56 | + data_files = [ |
| 57 | + ("/etc/init.d", ["pkg/hubble"]), |
| 58 | + ("/etc/hubble", ["conf/hubble"]), |
| 59 | + ] |
| 60 | + |
| 61 | +if platform_name == "Windows": |
| 62 | + build_dependencies.remove("pyinotify") |
50 | 63 |
|
51 | | -if platform_name == 'Windows': |
52 | | - build_dependencies.remove('pyinotify') |
53 | 64 |
|
54 | 65 | def _hubble_version(): |
55 | 66 | try: |
56 | 67 | from hubblestack.version import __version__ |
| 68 | + |
57 | 69 | return __version__ |
58 | 70 | except: |
59 | 71 | pass |
60 | | - return 'unknown' |
| 72 | + return "unknown" |
| 73 | + |
61 | 74 |
|
62 | 75 | setup( |
63 | | - name='hubblestack', |
| 76 | + name="hubblestack", |
64 | 77 | version=_hubble_version(), |
65 | | - description='Modular, open-source security compliance framework', |
66 | | - author='Colton Myers', |
67 | | - |
68 | | - maintainer='Colton Myers', |
69 | | - maintainer_email='[email protected]', |
70 | | - url='https://hubblestack.io', |
71 | | - license='Apache 2.0', |
| 78 | + description="Modular, open-source security compliance framework", |
| 79 | + author="Colton Myers", |
| 80 | + |
| 81 | + maintainer="Colton Myers", |
| 82 | + maintainer_email="[email protected]", |
| 83 | + url="https://hubblestack.io", |
| 84 | + license="Apache 2.0", |
72 | 85 | packages=find_packages(), |
73 | 86 | entry_points={ |
74 | | - 'console_scripts': [ |
75 | | - 'hubble = hubblestack.daemon:run', |
| 87 | + "console_scripts": [ |
| 88 | + "hubble = hubblestack.daemon:run", |
76 | 89 | ], |
77 | 90 | }, |
78 | 91 | install_requires=build_dependencies, |
79 | 92 | data_files=data_files, |
80 | 93 | classifiers=[ |
81 | | - 'Development Status :: 4 - Beta', |
82 | | - 'Environment :: Console', |
83 | | - 'Intended Audience :: System Administrators', |
84 | | - 'License :: OSI Approved :: Apache Software License', |
85 | | - 'Natural Language :: English', |
86 | | - 'Operating System :: Unix', |
87 | | - 'Operating System :: POSIX', |
88 | | - 'Operating System :: POSIX :: Linux', |
89 | | - 'Operating System :: Microsoft :: Windows', |
90 | | - 'Programming Language :: Python', |
91 | | - 'Programming Language :: Python :: 2.6', |
92 | | - 'Programming Language :: Python :: 2.7', |
93 | | - 'Topic :: Security', |
94 | | - 'Topic :: System', |
95 | | - 'Topic :: System :: Logging', |
96 | | - 'Topic :: System :: Monitoring', |
97 | | - 'Topic :: System :: Systems Administration', |
| 94 | + "Development Status :: 4 - Beta", |
| 95 | + "Environment :: Console", |
| 96 | + "Intended Audience :: System Administrators", |
| 97 | + "License :: OSI Approved :: Apache Software License", |
| 98 | + "Natural Language :: English", |
| 99 | + "Operating System :: Unix", |
| 100 | + "Operating System :: POSIX", |
| 101 | + "Operating System :: POSIX :: Linux", |
| 102 | + "Operating System :: Microsoft :: Windows", |
| 103 | + "Programming Language :: Python", |
| 104 | + "Programming Language :: Python :: 2.6", |
| 105 | + "Programming Language :: Python :: 2.7", |
| 106 | + "Topic :: Security", |
| 107 | + "Topic :: System", |
| 108 | + "Topic :: System :: Logging", |
| 109 | + "Topic :: System :: Monitoring", |
| 110 | + "Topic :: System :: Systems Administration", |
98 | 111 | ], |
99 | 112 | ) |
0 commit comments