forked from fastats/fastats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·109 lines (79 loc) · 2.76 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
#!/usr/bin/env python3
import codecs
import importlib.util
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
def read_utf8(filename):
"""
Ensure consistent encoding
"""
with codecs.open(path.join(here, filename), encoding='utf-8') as f:
return f.read()
def read_reqs(filename):
"""
For a given requirements file, return the lines as a list of strings
"""
with open(filename) as file:
return file.readlines()
long_description = read_utf8('README.md')
# import just the _version module, don't pull in any fastats dependencies
spec = importlib.util.spec_from_file_location(
'_version', path.join(here, 'fastats', '_version.py')
)
version_module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(version_module)
version = version_module.VERSION
setup_kwargs = dict(
name='fastats',
version=version,
description='A pure Python library for benchmarked, scalable numerics '
'using numba',
url='https://github.com/fastats/fastats',
author_email='fastats@googlegroups.com',
# Represents the body of text which users will see when they visit PyPI
long_description=long_description,
# For a list of valid classifiers, see
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering',
'Operating System :: OS Independent',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
keywords='algorithmics ast linear-algebra numba numerics',
packages=find_packages(exclude=['tests', 'tests.*']),
setup_requires=[
'pytest-runner', # to enable pytest for setup.py test via setup.cfg
],
install_requires=read_reqs('requirements.txt'),
tests_require=read_reqs('requirements-dev.txt'),
extras_require={
'doc': [ # documentation
'sphinx',
'sphinx_rtd_theme',
],
},
)
# CI-specific test utilities, e.g. travis, appveyor
setup_kwargs['extras_require']['ci_test'] = (
setup_kwargs['tests_require']
+ [
'codecov',
'httpie',
]
)
# All ("development") requirements, including docs generation and tests,
# but no CI-specific ones
setup_kwargs['extras_require']['dev'] = (
setup_kwargs['tests_require']
+ setup_kwargs['extras_require']['doc']
)
setup(**setup_kwargs)