-
Notifications
You must be signed in to change notification settings - Fork 13
/
setup.py
72 lines (63 loc) · 1.98 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
import os
from setuptools import setup, find_packages
PKG_ROOT = os.path.abspath(os.__file__)
def files_in_pkgdir(pkg, dirname):
pkgdir = os.path.join(PKG_ROOT, *pkg.split('.'))
walkdir = os.path.join(pkgdir, dirname)
walkfiles = []
for dirpath, _, files in os.walk(walkdir):
fpaths = (os.path.relpath(os.path.join(dirpath, f), pkgdir)
for f in files)
walkfiles += fpaths
return walkfiles
try:
import spendb
release = spendb.__version__
except:
release = 'dev'
def package_filter(pkg):
"""
Filter packages so that we exclude test cases but include regular test
objects available in spendb.tests' modules (all test cases are
in subdirectories).
"""
# We want to include spendb.tests but not its subpackages
# Hence we only check for things starting with spendb.tests.
# (note the trailing period to denote subpackages)
return not pkg.startswith('spendb.tests.')
setup(
name='spendb',
version=release,
description='SpenDB',
author='Friedrich Lindenberg (formerly OKFN)',
author_email='friedrich@pudo.org',
url='http://github.com/spendb/spendb',
install_requires=[],
setup_requires=[],
packages=filter(package_filter, find_packages()),
namespace_packages=['spendb'],
package_data={
'spendb': (
files_in_pkgdir('spendb', 'static') +
files_in_pkgdir('spendb', 'templates')
)
},
test_suite='nose.collector',
zip_safe=False,
entry_points={
'console_scripts': [
'spendb = spendb.command:main'
],
'cubes.providers': [
'spending = spendb.model.provider:SpendingModelProvider'
],
'cubes.stores': [
'spending = spendb.model.provider:SpendingStore'
]
},
message_extractors={
'spendb': [('**.py', 'python', None),
('templates/**.html', 'jinja2', None),
('static/**', 'ignore', None)]
},
)