-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
137 lines (118 loc) · 3.56 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
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
import codecs
import os
import glob
import re
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
# intentionally *not* adding an encoding option to open, See:
# https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690
global here
with codecs.open(os.path.join(here, *parts), 'r') as fp:
return fp.read()
def find_version(*file_paths):
version_file = read(*file_paths)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
def _is_valid_command(file_name):
with open(file_name) as f:
return 'def cli(' in f.read()
def find_commands(path=os.path.join('skvalidate','commands')):
""" Scans path for valid commands """
command_files = glob.glob(os.path.join(path, '*.py'))
# commands = []
for file_name in command_files:
if not _is_valid_command(file_name):
continue
command_path = file_name.replace('.py', '').replace(os.path.sep, '.')
name = command_path.split('.')[-1]
yield'sv_{name}={path}:cli'.format(name=name, path=command_path)
# execute_with_metrics=skvalidate.commands.execute_with_metrics:cli
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'awkward>=1.0.0',
'Click<9.0',
'gitpython<4.0.0',
'fuzzywuzzy',
'jinja2',
'markdown2',
'matplotlib<4.0.0',
'memory_profiler>=0.54',
'numexpr',
'numpy>=1.19.0',
'pandas',
'plumbum',
'python-gitlab<3.0.0',
'python-Levenshtein',
'pyyaml',
'scipy',
'tabulate',
'tqdm',
'uproot>=4.0.0',
'xhtml2pdf',
]
setup_requirements = [
# 'pytest-runner',
]
test_requirements = [
'coverage',
'httmock',
'hypothesis',
'mock',
'pytest',
'pytest-cov',
'responses',
]
setup(
author="Luke Kreczko",
author_email='kreczko@cern.ch',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
description="Science validation toolkit",
entry_points={
'console_scripts': [
# 'skvalidate=skvalidate.cli:main',
'run-clang-tidy=skvalidate.clang_tidy:main',
] + list(find_commands()),
},
install_requires=requirements,
license="Apache Software License 2.0",
long_description=readme + '\n\n' + history,
include_package_data=True,
keywords='skvalidate',
name='scikit-validate',
packages=find_packages(include=[
'skvalidate',
'skvalidate.commands',
'skvalidate.compare',
'skvalidate.gitlab',
'skvalidate.io',
'skvalidate.operations',
'skvalidate.report',
'skvalidate.software',
'skvalidate.vis',
]),
setup_requires=setup_requirements,
test_suite='tests',
tests_require=test_requirements,
url='https://gitlab.cern.ch/fast-hep/public/scikit-validate',
version=find_version("skvalidate", '__init__.py'),
zip_safe=False,
)