-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
66 lines (48 loc) · 1.66 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
#!/usr/bin/env python
import sys
from os import path
from pkg_resources import parse_requirements
from setuptools import setup, find_packages
name = 'tinbox-mx' # PyPI name
package_name = 'mx' # Python module name
package_path = 'src' # Where does the package live?
here = path.dirname(path.abspath(__file__))
# Add src dir to path
sys.path.append(package_path)
# Get the long description from the relevant file
long_description = None
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
def get_version() -> "version string":
"""
Get the version from a version module inside our package. This is
necessary since we import our main modules in package/__init__.py,
which will cause ImportErrors if we try to import package/version.py
using the regular import mechanism.
:return: Formatted version string
"""
version = {}
version_file = path.join(package_path, package_name, '__init__.py')
# exec the version module
with open(version_file) as fp:
exec(fp.read(), version)
# Call the module function 'get_version'
return version['get_version']()
def get_requirements(filename):
return [str(r) for r in parse_requirements(open(filename).read())]
setup(
name=name,
version=get_version(),
author='Jonas Lundberg',
author_email='[email protected]',
url='https://github.com/5monkeys/tinbox-mx',
license='MIT',
package_dir={'': package_path},
packages=find_packages(package_path),
entry_points={
'console_scripts': [
'mx = mx.cli.command:Interface',
]
},
install_requires=get_requirements('requirements.txt')
)