forked from trec-kba/kba-corpus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
81 lines (70 loc) · 2.09 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
#!/usr/bin/env python
import os
import sys
import fnmatch
## prepare to run PyTest as a command
from distutils.core import Command
## explain this...
#from distribute_setup import use_setuptools
#use_setuptools()
from setuptools import setup, find_packages
PROJECT = 'streamcorpus'
VERSION = '0.1'
URL = 'http://github.com/trec-kba/kba-corpus'
AUTHOR = 'Diffeo, Inc.'
AUTHOR_EMAIL = '[email protected]'
DESC = 'Tools for organizing a collections of text for entity-centric stream processing.'
def read_file(file_name):
file_path = os.path.join(
os.path.dirname(__file__),
file_name
)
return open(file_path).read()
def recursive_glob(treeroot, pattern):
results = []
for base, dirs, files in os.walk(treeroot):
goodfiles = fnmatch.filter(files, pattern)
results.extend(os.path.join(base, f) for f in goodfiles)
return results
class PyTest(Command):
'''run py.test'''
description = 'runs py.test to execute all tests'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import subprocess
errno = subprocess.call([sys.executable, 'runtests.py'])
raise SystemExit(errno)
setup(
name=PROJECT,
version=VERSION,
description=DESC,
#long_description=read_file('README.md'),
long_description="",
author=AUTHOR,
author_email=AUTHOR_EMAIL,
url=URL,
packages = find_packages('src'),
package_dir = {'': 'src'},
cmdclass = {'test': PyTest},
# We can select proper classifiers later
classifiers=[
'Development Status :: 3 - Alpha',
'Topic :: Utilities',
'License :: MIT', ## MIT/X11 license http://opensource.org/licenses/MIT
],
install_requires=[
'thrift',
],
# include_package_data = True,
package_data = {
# If any package contains *.txt or *.rst files, include them:
# '': ['*.txt', '*.rst'],
# And include any files found in the 'data' package:
# '': recursive_glob('src/data/', '*')
'': recursive_glob('data/', '*')
}
)