forked from cool-RR/python_toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
174 lines (122 loc) · 4.84 KB
/
setup.py
File metadata and controls
174 lines (122 loc) · 4.84 KB
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#!/usr/bin/env python
# Copyright 2009-2014 Ram Rachum.
# This program is distributed under the MIT license.
'''Setuptools setup file for `python_toolbox`.'''
import os
import setuptools
import sys
### Confirming correct Python version: ########################################
# #
if sys.version_info[:2] <= (2, 6):
raise Exception(
"You're using Python <= 2.6, but this package requires either Python "
"2.7, or 3.3 or above, so you can't use it unless you upgrade your "
"Python version."
)
# #
### Finished confirming correct Python version. ###############################
if sys.version_info[0] == 3:
source_folder = 'source_py3'
else:
source_folder = 'source_py2'
def get_python_toolbox_packages():
'''
Get all the packages in `python_toolbox`.
Returns something like:
['python_toolbox', 'python_toolbox.caching',
'python_toolbox.nifty_collections', ... ]
'''
return ['python_toolbox.' + p for p in
setuptools.find_packages('%s/python_toolbox' % source_folder)] + \
['python_toolbox']
def get_test_python_toolbox_packages():
'''
Get all the packages in `test_python_toolbox`.
Returns something like:
['test_python_toolbox', 'test_python_toolbox.test_caching',
'test_python_toolbox.test_nifty_collections', ... ]
'''
return ['test_python_toolbox.' + p for p in
setuptools.find_packages('%s/test_python_toolbox'
% source_folder)] + \
['test_python_toolbox']
def get_packages():
'''
Get all the packages in `python_toolbox` and `test_python_toolbox`.
Returns something like:
['test_python_toolbox', 'python_toolbox', 'python_toolbox.caching',
'test_python_toolbox.test_nifty_collections', ... ]
'''
return get_python_toolbox_packages() + get_test_python_toolbox_packages()
my_long_description = \
'''\
The Python Toolbox is a collection of Python tools for various tasks. It
contains:
- ``python_toolbox.caching``: Tools for caching functions, class instances and
properties.
- ``python_toolbox.cute_iter_tools``: Tools for manipulating iterables. Adds
useful functions not found in Python's built-in ``itertools``.
- ``python_toolbox.context_management``: Pimping up your context managers.
- ``python_toolbox.emitting``: A publisher-subscriber framework that doesn't
abuse strings.
- And many, *many* more! The Python Toolbox contains **100+** useful
little tools.
Please keep in mind that Python Toolbox is still in alpha stage, and that
backward compatibility would *not* be maintained in this phase.
Documentation: http://python-toolbox.readthedocs.org
GitHub: https://github.com/cool-RR/python_toolbox
CI server: https://jenkins.shiningpanda-ci.com/python-toolbox/job/python_toolbox/
Tests
=====
Test can be run by running the ``_test_python_toolbox.py`` script that's
installed automatically with the Python Toolbox.
When ``python_toolbox`` isn't installed, you may run ``nosetests`` at the repo
root to run the tests.
Roadmap
=======
Present
-------
Python Toolbox is at version 0.6.11, which is an alpha release. It's being used
in production every day, but backward compatibility isn't guaranteed yet.
Next tasks
----------
Adding more useful tools.
Future
------
Make a 1.0 release and start maintaining backward compatibility.
'''
my_classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Utilities'
]
install_requires = ['setuptools']
if sys.version_info[:2] <= (3, 3):
install_requires.append('pathlib>=0.97')
setuptools.setup(
name='python_toolbox',
version='0.6.11',
test_suite='nose.collector',
install_requires=install_requires,
tests_require=['nose>=1.0.0',
'docutils>=0.8'],
description='A collection of Python tools for various tasks',
author='Ram Rachum',
author_email='ram@rachum.com',
package_dir={'': source_folder},
packages=get_packages(),
scripts=['%s/test_python_toolbox/scripts/_test_python_toolbox.py'
% source_folder],
long_description=my_long_description,
license='MIT',
classifiers=my_classifiers,
include_package_data=True,
zip_safe=False,
)