-
Notifications
You must be signed in to change notification settings - Fork 16
/
setup.py
executable file
·93 lines (82 loc) · 3.04 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
#!/usr/bin/env python
#
# Copyright (C) 2015 Leo Goodstadt <[email protected]>
#
# This file is part of nested_dict.
#
# nested_dict is free software: you can redistribute it and/or modify
# it under the terms of the MIT license as found here
# http://opensource.org/licenses/MIT.
#
"""Setup module for nested-dict."""
import re
import os
# First, we try to use setuptools. If it's not available locally,
# we fall back on ez_setup.
try:
from setuptools import setup
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
# Following the recommendations of PEP 396 we parse the version number
# out of the module.
def parse_version(module_file):
"""
Parse the version string from the specified file.
This implementation is ugly, but there doesn't seem to be a good way
to do this in general at the moment.
"""
f = open(module_file)
s = f.read()
f.close()
match = re.findall("__version__ = '([^']+)'", s)
return match[0]
f = open(os.path.join(os.path.dirname(__file__), "README.rst"))
nested_dict_readme = f.read()
f.close()
nested_dict_version = parse_version(os.path.join("nested_dict", "__init__.py"))
setup(
name="nested_dict",
version=nested_dict_version,
description="Python dictionary with automatic and arbitrary levels of nestedness",
long_description=nested_dict_readme,
packages=["nested_dict"],
author='Leo Goodstadt',
author_email='[email protected]',
url="http://pypi.python.org/pypi/nested_dict",
install_requires=[],
setup_requires=[],
keywords=["nested", "dict", "defaultdict", "dictionary", "auto-vivification"],
license="MIT",
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: Implementation :: PyPy",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: Science/Research",
"Intended Audience :: Financial and Insurance Industry",
"Intended Audience :: Developers",
'Intended Audience :: Information Technology',
"License :: OSI Approved :: MIT License",
"Topic :: Scientific/Engineering",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries",
"Topic :: Scientific/Engineering",
"Topic :: Utilities",
],
test_suite="tests.test_nested_dict",
)
# python setup.py register
# flake8 *.py tests --exclude=ez_setup.py --max-line-length=100
# nosetests --with-coverage --cover-package nested_dict --cover-inclusive --cover-min-percentage 85
# make -C docs html
# git tag -a v1.5.1 -m "Version 1.5.1"
# python setup.py sdist --format=gztar,zip upload