-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
80 lines (63 loc) · 2.14 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
# -*- coding: utf-8 -*-
"""
ariseem
~~~~~~~
Minimalistic REST API for wake-on-lan
:copyright: (c) 2017 by Timo Furrer <[email protected]>
:license: MIT, see LICENSE for more details.
"""
import ast
import os
import sys
import codecs
from setuptools import setup, find_packages
#: Holds the root dir for the project.
PROJECT_ROOT = os.path.dirname(__file__)
class VersionFinder(ast.NodeVisitor):
def __init__(self):
self.version = None
def visit_Assign(self, node):
try:
if node.targets[0].id == '__version__':
self.version = node.value.s
except:
pass
def read_version():
"""Read version from __init__.py without loading any files"""
finder = VersionFinder()
path = os.path.join(PROJECT_ROOT, 'ariseem', '__init__.py')
with codecs.open(path, 'r', encoding='utf-8') as fp:
file_data = fp.read().encode('utf-8')
finder.visit(ast.parse(file_data))
return finder.version
#: Holds the requirements for ariseem
requirements = [
'flask',
'pyyaml'
]
if __name__ == '__main__':
setup(
name='ariseem',
version=read_version(),
description='Minimalistic REST API for wake-on-lan.',
long_description='Minimalistic REST API for wake-on-lan.',
url='http://github.com/timofurrer/colorful',
author='Timo Furrer',
author_email='[email protected]',
maintainer='Timo Furrer',
maintainer_email='[email protected]',
include_package_data=True,
packages=find_packages(exclude=['*tests*']),
install_requires=requirements,
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy'
]
)