Repository navigation
Expand file tree
/
Copy pathsetup.py
More file actions
57 lines (47 loc) · 1.71 KB
/
Copy pathsetup.py
File metadata and controls
57 lines (47 loc) · 1.71 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
#!/usr/bin/env python
# coding: utf-8
import os
import re
from setuptools import setup
def ascii_bytes_from(path, *paths):
"""
Return the ASCII characters in the file specified by *path* and *paths*.
The file path is determined by concatenating *path* and any members of
*paths* with a directory separator in between.
"""
file_path = os.path.join(path, *paths)
with open(file_path) as f:
ascii_bytes = f.read()
return ascii_bytes
# read required text from files
thisdir = os.path.dirname(__file__)
init_py = ascii_bytes_from(thisdir, "src", "cr", "cube", "__init__.py")
readme = ascii_bytes_from(thisdir, "README.md")
# Read the version from cr.cube.__version__ without importing the package
# (and thus attempting to import packages it depends on that may not be
# installed yet). This allows users to check installed version with
# `python -c 'from cr.cube import __version__; print(__version__)`
version = re.search('__version__ = "([^"]+)"', init_py).group(1)
install_requires = ["scipy", "tabulate"]
test_requires = ["pytest", "pytest-cov", "mock", "coverage"]
setup(
name="cr_cube",
version=version,
description="Crunch.io Cube library",
long_description=readme,
long_description_content_type="text/markdown",
url="https://github.com/Crunch-io/crunch-cube/",
classifiers=[
"Programming Language :: Python",
"Topic :: Software Development :: Libraries :: Python Modules",
],
author="Crunch.io",
author_email="dev@crunch.io",
license="MIT License",
install_requires=install_requires,
extras_require={"testing": test_requires},
package_dir={"": "src"},
include_package_data=True,
entry_points={},
zip_safe=True,
)