-
Notifications
You must be signed in to change notification settings - Fork 125
/
setup.py
executable file
·71 lines (59 loc) · 2.35 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
import os
import re
from setuptools import setup, find_packages
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
VERSION_FILE = os.path.join(BASE_DIR, 'multiscanner', 'version.py')
REQ_REGEX = re.compile(r'^(?!#)(?!git+)(?!-r).*$')
DEPS_LINKS_REGEX = re.compile(r'(^git+.*$)')
def get_version():
with open(VERSION_FILE) as f:
for line in f.readlines():
if line.startswith('__version__'):
version = line.split()[-1].strip('\'')
return version
raise AttributeError('Package does not have a __version__')
def get_requirements(filename, dep_links_only=False):
requirements = []
with open(filename) as f:
for l in f.readlines():
if dep_links_only is False and REQ_REGEX.match(l):
requirements.append(l.strip())
elif dep_links_only is True and DEPS_LINKS_REGEX.match(l):
requirements.append(l.strip())
if requirements:
return requirements
msg = 'Unable to extract requirements from {}'.format(filename)
raise RuntimeError(msg)
def get_long_description():
with open('README.md') as f:
return f.read()
setup(
name='multiscanner',
version=get_version(),
url='https://github.com/mitre/multiscanner',
license='MPL 2.0',
author='Drew Bonasera',
packages=find_packages(exclude=['*.tests']),
include_package_data=True,
description='A file analysis framework that allows the user to evaluate a set of files with a set of tools.',
long_description=get_long_description(),
long_description_content_type='text/markdown',
keywords='malware research analysis scanning framework modular',
install_requires=get_requirements('requirements.txt'),
entry_points={
'console_scripts': [
'multiscanner=multiscanner.ms:_main',
'multiscanner-web=multiscanner.web.app:_main',
'multiscanner-api=multiscanner.distributed.api:_main',
],
},
extras_require={
'dev': get_requirements('requirements-test.txt') + get_requirements('requirements-dev.txt'),
'test': get_requirements('requirements-test.txt'),
},
dependency_links=get_requirements('requirements.txt', dep_links_only=True),
classifiers=[
'Framework :: MultiScanner',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
],
)