This repository has been archived by the owner on Dec 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
125 lines (99 loc) · 3.3 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# -*- coding: UTF-8 -*-
#
# Copyright (C) 2014 by Alex Brandt <[email protected]>
#
# margarine is freely distributable under the terms of an MIT-style license.
# See COPYING or http://www.opensource.org/licenses/mit-license.php.
# =============================================================================
# Monkey Patch as outlined in #23. TODO Remove this someday…
# -----------------------------------------------------------------------------
import sys
import ConfigParser # flake8: noqa
import traceback
original_sections = sys.modules['ConfigParser'].ConfigParser.sections
def monkey_sections(self):
'''Return a list of sections available; DEFAULT is not included in the list.
Monkey patched to exclude the nosetests section as well.
'''
_ = original_sections(self)
if any([ 'distutils/dist.py' in frame[0] for frame in traceback.extract_stack() ]) and _.count('nosetests'):
_.remove('nosetests')
return _
sys.modules['ConfigParser'].ConfigParser.sections = monkey_sections
# -----------------------------------------------------------------------------
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
from margarine import information
PARAMS = {}
PARAMS['name'] = information.NAME
PARAMS['version'] = information.VERSION
PARAMS['description'] = information.DESCRIPTION
PARAMS['long_description'] = information.LONG_DESCRIPTION
PARAMS['author'] = information.AUTHOR
PARAMS['author_email'] = information.AUTHOR_EMAIL
PARAMS['url'] = information.URL
PARAMS['license'] = information.LICENSE
PARAMS['classifiers'] = [
'Development Status :: 2 - Pre-Alpha',
'Environment :: No Input/Output (Daemon)',
'Environment :: Web Environment',
'Intended Audience :: End Users/Desktop',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Topic :: Internet :: WWW/HTTP :: Site Management',
]
PARAMS['keywords'] = [
'readability',
'delicious',
'bookmarks',
'margins',
'notes',
]
PARAMS['provides'] = [
'margarine',
]
with open('requirements.txt', 'r') as req_fh:
PARAMS['install_requires'] = req_fh.readlines()
with open('test_margarine/requirements.txt', 'r') as req_fh:
PARAMS['tests_require'] = req_fh.readlines()
PARAMS['test_suite'] = 'nose.collector'
PARAMS['entry_points'] = {
'console_scripts': [
'blend = margarine.blend:run',
'margarine = margarine:run',
'spread = margarine.spread:run',
'tinge = margarine.tinge:run',
],
}
PARAMS['packages'] = [
'margarine',
'margarine.blend',
'margarine.parameters',
'margarine.spread',
'margarine.tinge',
]
PARAMS['package_data'] = {
'': [
'templates/*.html',
'static/js/*.js',
'static/img/*.png',
'static/css/*.css',
],
}
PARAMS['data_files'] = [
('share/doc/{P[name]}-{P[version]}'.format(P = PARAMS), [
'README.rst',
]),
('share/doc/{P[name]}-{P[version]}/conf'.format(P = PARAMS), [
'conf/logging.ini',
'conf/margarine.ini',
]),
]
setup(**PARAMS)