-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
105 lines (86 loc) · 3.33 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
import os
from setuptools import setup, Extension
import versioneer
# Default description in markdown
long_description = open('README.md').read()
# Converts from makrdown to rst using pandoc
# and its python binding.
# Docunetation is uploaded in PyPi when registering
# by issuing `python setup.py register`
try:
import subprocess
import pandoc
process = subprocess.Popen(
['which pandoc'],
shell=True,
stdout=subprocess.PIPE,
universal_newlines=True
)
pandoc_path = process.communicate()[0]
pandoc_path = pandoc_path.strip('\n')
pandoc.core.PANDOC_PATH = pandoc_path
doc = pandoc.Document()
doc.markdown = long_description
long_description = doc.rst
except:
pass
classifiers = [
'Environment :: No Input/Output (Daemon)',
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: Microsoft :: Windows :: Windows XP',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2.7',
'Programming Language :: SQL',
'Topic :: Scientific/Engineering :: Astronomy',
'Topic :: Scientific/Engineering :: Atmospheric Science',
'Development Status :: 4 - Beta',
]
if os.name == "posix":
setup(name = 'emadb',
version = versioneer.get_version(),
cmdclass = versioneer.get_cmdclass(),
author = 'Rafael Gonzalez',
author_email = 'astrorafael@yahoo.es',
description = 'A package to collect measurements published by EMA using MQTT and a SQlite database',
long_description = long_description,
license = 'MIT',
keywords = 'EMA Database Meteorology Astronomy Python RaspberryPi',
url = 'http://github.com/astrorafael/emadb/',
classifiers = classifiers,
packages = ["emadb","emadb.server"],
install_requires = ['paho-mqtt'],
data_files = [
('/etc/init.d' , ['init.d/emadb']),
('/etc/default', ['default/emadb']),
('/etc/emadb', ['config/config']),
('/usr/local/bin', ['scripts/emadb', 'scripts/emadbload']),
]
)
elif os.name == "nt":
import sys
import shlex
setup(name = 'emadb',
version = versioneer.get_version(),
cmdclass = versioneer.get_cmdclass(),
author = 'Rafael Gonzalez',
author_email = 'astrorafael@yahoo.es',
description = 'A package to collect measurements published by EMA using MQTT and a SQlite database',
long_description = long_description,
license = 'MIT',
keywords = 'EMA Database Meteorology Astronomy Python RaspberryPi',
url = 'http://github.com/astrorafael/emadb/',
classifiers = classifiers,
packages = ["emadb","emadb.server"],
install_requires = ['paho-mqtt'],
data_files = [
(r'C:\emadb\dbase' , ['dbase\placeholder.txt']),
(r'C:\emadb\log', ['log\placeholder.txt']),
(r'C:\emadb\config', ['config\config.ini']),
]
)
args = shlex.split( "python -m emadb --startup auto install")
subprocess.call(args)
else:
pass