This repository has been archived by the owner on Jun 26, 2018. It is now read-only.
forked from c0fec0de/anytree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
60 lines (52 loc) · 1.91 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
"""
Powerful and Lightweight Python Tree Data Structure with various plugins.
"""
# Always prefer setuptools over distutils
from setuptools import setup
# To use a consistent encoding
from codecs import open
from os import path
def _read_metainfo(filepath):
import re
pat = re.compile(r"__(?P<name>[a-z_]+)__ = (?P<expr>.*)")
metainfo = {}
with open(filepath) as fh:
for line in fh:
if isinstance(line, bytes):
line = line.decode("utf-8")
match = pat.match(line)
if match:
metainfo[match.group("name")] = eval(match.group("expr"))
return metainfo
config = _read_metainfo("anytree/__init__.py")
config['name'] = 'anytree'
config['license'] = 'Apache 2.0'
config['classifiers'] = [
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
]
config['keywords'] = 'tree, tree data, treelib, tree walk, tree structure'
config['packages'] = ['anytree', 'anytree.node', 'anytree.iterators', 'anytree.importer', 'anytree.exporter']
config['install_requires'] = ['six>=1.9.0']
config['extras_require'] = {
'dev': ['check-manifest'],
'test': ['coverage'],
}
config['tests_require'] = ['nose']
config['test_suite'] = 'nose.collector'
# Get the long description from the README file
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
config['long_description'] = f.read()
# python 2.6 does not implement OrderedDict, so we have to install it
try:
from collections import OrderedDict # noqa
except ImportError:
config['install_requires'].append("ordereddict")
setup(**config)