forked from AlertaDengue/AlertaDengue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
87 lines (72 loc) · 2.42 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
from setuptools import setup, find_packages
import os
import subprocess
import sys
PATH_ROOT = os.path.dirname(os.path.abspath(__file__))
# Documentation building command
try:
from sphinx.setup_command import BuildDoc as SphinxBuildDoc
class BuildDoc(SphinxBuildDoc):
"""Run in-place build before Sphinx doc build"""
def run(self):
ret = subprocess.call(
[sys.executable, sys.argv[0], 'build_ext', '-i']
)
if ret != 0:
raise RuntimeError("Building Scipy failed!")
SphinxBuildDoc.run(self)
cmdclass = {'build_sphinx': BuildDoc}
except ImportError:
cmdclass = {}
def get_version(path_root: str = PATH_ROOT):
"""Obtain the version number"""
import importlib
mod = importlib.machinery.SourceFileLoader(
'version',
os.path.abspath(
os.path.join(path_root, 'AlertaDengue', 'ad_main', 'version.py',)
),
).load_module()
return mod.__version__
with open(
os.path.join(PATH_ROOT, 'README.md'), encoding='utf-8'
) as readme_file:
readme = readme_file.read()
with open(
os.path.join(PATH_ROOT, 'HISTORY.md'), encoding='utf-8'
) as history_file:
history = history_file.read()
def read(filename):
return [req.strip() for req in open(filename).readlines()]
setup(
name='AlertaDengue',
version=get_version(),
description="Dengue alert",
long_description=readme + '\n\n' + history,
author="FIOCRUZ",
author_email='alerta_dengue@fiocruz.br',
url='https://github.com/AlertaDengue/AlertaDengue',
packages=find_packages("AlertaDengue"),
install_requires=read("requirements.txt"),
extras_require={"dev": read("requirements-dev.txt")},
license="GNU General Public License v3",
zip_safe=False,
keywords='dengue',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
cmdclass=cmdclass,
scripts=['AlertaDengue/manage.py'],
include_package_data=True,
package_dir={
"": "AlertaDengue"
}, # tell distutils packages are under AlertaDengue
# test_suite='tests',
# tests_require=test_requirements
)