-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathsetup.py
More file actions
139 lines (119 loc) · 3.44 KB
/
Copy pathsetup.py
File metadata and controls
139 lines (119 loc) · 3.44 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#! /usr/bin/env python
"""Perform setup of the package for build."""
import sys
import glob
import os
import re
import io
from setuptools import setup, Command
with io.open('eql/__init__.py', 'rt', encoding='utf8') as f:
__version__ = re.search(r'__version__ = \'(.*?)\'', f.read()).group(1)
install_requires = [
"lark>=1.3.1",
]
test_requires = [
"pytest>=6.0.0",
"pytest-cov>=2.4",
"flake8>=3.8.0",
"pep257==0.7.0",
"coverage>=4.5.3",
"flake8-docstrings>=1.5.0",
"PyYAML",
"toml~=0.10",
"attrs==21.4.0"
]
etc_files = [os.path.relpath(fn, 'eql') for fn in glob.glob('eql/etc/*') if not fn.endswith('.py')]
class Lint(Command):
"""Wrapper for the standard linters."""
description = 'Lint the code'
user_options = []
def initialize_options(self):
"""Initialize options."""
def finalize_options(self):
"""Finalize options."""
def run(self):
"""Run the flake8 linter."""
import subprocess
# Run flake8 via command line (respects setup.cfg configuration)
result = subprocess.run(
[sys.executable, '-m', 'flake8', 'eql', 'tests'],
cwd=os.path.dirname(os.path.abspath(__file__))
)
sys.exit(result.returncode)
class Test(Command):
"""Use pytest (http://pytest.org/latest/) in place of the standard unittest library."""
user_options = [("pytest-args=", "a", "Arguments to pass to pytest")]
def initialize_options(self):
"""Initialize options."""
self.pytest_args = []
def finalize_options(self):
"""Finalize options."""
pass
def run(self):
"""Run pytest."""
import pytest
import eql
eql.parser.full_tracebacks = True
sys.exit(pytest.main(self.pytest_args))
setup(
name='eql',
version=__version__,
description='Event Query Language',
install_requires=install_requires,
author='Endgame, Inc.',
author_email='eql@endgame.com',
license='AGPLv3',
classifiers=[
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'Intended Audience :: Science/Research',
'Intended Audience :: System Administrators',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Database',
'Topic :: Internet :: Log Analysis',
'Topic :: Scientific/Engineering :: Information Analysis',
],
url='https://eql.readthedocs.io',
cmdclass={
'lint': Lint,
'test': Test
},
entry_points={
'console_scripts': [
'eql=eql.main:main',
],
'pygments.lexers': [
'eql=eql.highlighters:EqlLexer'
]
},
extras_require={
'docs': [
'sphinx',
'sphinx_rtd_theme',
],
'cli': [
'pygments',
'prompt_toolkit',
],
'lint': test_requires,
'test': test_requires,
'loaders': [
'pyyaml',
'toml',
],
'highlighters': [
'pygments',
]
},
packages=['eql', 'eql.tests', 'eql.etc'],
package_data={
'eql': etc_files,
},
zip_safe=False,
)