This repository has been archived by the owner on Jun 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
93 lines (86 loc) · 2.48 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
import os
from setuptools import setup, find_packages
import versioneer
import sys
import sys
if sys.version_info < (3, 6):
sys.exit('Sorry, Python < 3,6 is not supported')
# vagrant doesn't appreciate hard-linking
if os.environ.get('USER') == 'vagrant' or os.path.isdir('/vagrant'):
del os.link
lmagic = 'libmagic.so'
if sys.platform == 'darwin':
lmagic = 'libmagic.dylib'
try:
from ctypes import cdll
cdll.LoadLibrary(lmagic)
except OSError:
print("")
print('libmagic is required')
print("")
raise SystemExit
# https://www.pydanny.com/python-dot-py-tricks.html
if sys.argv[-1] == 'test':
test_requirements = [
'pytest',
'coverage',
'pytest_cov',
]
try:
modules = map(__import__, test_requirements)
except ImportError as e:
err_msg = e.message.replace("No module named ", "")
msg = "%s is not installed. Install your test requirements." % err_msg
raise ImportError(msg)
r = os.system('py.test -v --cov=csirtg_fm --cov-fail-under=40')
if r == 0:
sys.exit()
else:
raise RuntimeError('tests failed')
package_data = {}
if sys.platform == 'nt':
package_data['csirtg_fm'] = os.path.join('tools', 'magic1.dll')
setup(
name="csirtg-fm",
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
package_data=package_data,
description="The FASTEST way to consume threat intel",
long_description="The FASTEST way to consume threat intel",
url="https://github.com/csirtgadgets/fuzzy-chainsaw",
classifiers=[
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
"Topic :: System :: Networking",
"Environment :: Other Environment",
"Intended Audience :: Developers",
"Programming Language :: Python",
],
keywords=['security'],
author="Wes Young",
author_email="[email protected]",
packages=find_packages(exclude=['test']),
install_requires=[
'csirtg_indicator>=2.0,<3.0',
'ipaddress',
'feedparser',
'requests',
'arrow',
'python-magic',
'pyaml',
'chardet',
'lxml',
'tzlocal',
'SQLAlchemy',
'tornado',
'nltk',
'csirtg-domainsml-tf',
'csirtg-urlsml-tf',
'csirtg-ipsml-tf',
'csirtgsdk'
],
entry_points={
'console_scripts': [
'csirtg-fm=csirtg_fm.cli:main'
]
},
)