This repository has been archived by the owner on Nov 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsetup.py
77 lines (65 loc) · 2.39 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
import pathlib
import re
from setuptools import setup, find_packages
_HERE = pathlib.Path(__file__).parent
def _resolve_path(*parts):
"""Get a filename from a list of path components, relative to this file."""
return _HERE.joinpath(*parts).absolute()
def _read(*parts):
"""Read a file's contents into a string."""
filename = _resolve_path(*parts)
return filename.read_text()
__INIT__ = _read('src', 'logitboost', '__init__.py')
def _get_package_variable(name):
pattern = rf'^{name} = [\'"](?P<value>[^\'"]*)[\'"]'
match = re.search(pattern, __INIT__, flags=re.M)
if match:
return match.group('value')
raise RuntimeError(f'Cannot find variable {name}')
setup(
name=_get_package_variable('__package__'),
version=_get_package_variable('__version__'),
description=_get_package_variable('__description__'),
url=_get_package_variable('__url__'),
author=_get_package_variable('__author__'),
author_email=_get_package_variable('__author_email__'),
long_description=_read('README.rst'),
long_description_content_type='text/x-rst',
packages=find_packages('src', exclude=['*.tests']),
package_dir={'': 'src'},
license='MIT',
classifiers=[
'Development Status :: 1 - Planning',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
],
install_requires=_read('requirements.txt').splitlines(),
extras_require={
'dev': [
'jupyter',
'matplotlib',
'seaborn',
'pytest',
'coverage',
'sphinx',
'nbsphinx',
'sphinx-rtd-theme'
],
},
setup_requires=['pytest-runner'],
tests_require=['pytest'],
zip_safe=False,
)