-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
99 lines (86 loc) · 2.93 KB
/
Copy pathsetup.py
File metadata and controls
99 lines (86 loc) · 2.93 KB
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
import sys
try:
from setuptools import setup, find_packages
except Exception:
raise ImportError("setuptools is required to install Earlytool!")
import io
import os
# Package meta-data.
NAME = "Earlytool"
DESCRIPTION = "Earlytool: An Early NIDS"
URL = "https://gitlab.abo.fi/veridevops-public/earlytool"
EMAIL = "tahmad@abo.fi"
AUTHOR = "Tanwir Ahmad"
REQUIRES_PYTHON = ">=3.6.0"
GIT_REPO_LIBS = [
"cicflowmeter @ git+https://gitlab.abo.fi/tahmad/cicflowmeter-py.git@py36"
]
VERSION = None
def get_requirements(source: str = "requirements.txt"):
requirements = []
with open(source) as f:
for line in f:
package, _, comment = line.partition("#")
package = package.strip()
if package and "git" not in package:
requirements.append(package)
return requirements
REQUIRED = get_requirements("requirements.txt")
def get_long_description():
"""Extract description from README.md, for PyPI's usage"""
def process_ignore_tags(buffer):
return "\n".join(
x for x in buffer.split("\n") if "<!-- ignore_ppi -->" not in x
)
try:
fpath = os.path.join(os.path.dirname(__file__), "README.md")
with io.open(fpath, encoding="utf-8") as f:
readme = f.read()
desc = readme.partition("<!-- start_ppi_description -->")[2]
desc = desc.partition("<!-- stop_ppi_description -->")[0]
return process_ignore_tags(desc.strip())
except IOError:
return None
setup(
name=NAME,
version=__import__('early').__version__,
description=DESCRIPTION,
long_description=get_long_description(),
long_description_content_type="text/markdown",
author=AUTHOR,
author_email=EMAIL,
python_requires=REQUIRES_PYTHON,
url=URL,
# package_dir={"": "early"},
packages=find_packages(),
# Build starting scripts automatically
entry_points={
"console_scripts": [
"early_monitor=monitor:main",
"early_display=display:main"
],
},
install_requires=REQUIRED + GIT_REPO_LIBS,
# dependency_links=DEPENDENCIES,
include_package_data=True,
license='Apache',
project_urls={
'Source Code': 'https://gitlab.abo.fi/veridevops-public/earlytool/',
},
keywords=["network"],
classifiers=[
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"Intended Audience :: System Administrators",
"Intended Audience :: Telecommunications Industry",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: Security",
"Topic :: System :: Networking",
"Topic :: System :: Networking :: Monitoring",
]
)