forked from clips/pattern
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
138 lines (131 loc) · 5.22 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
126
127
128
129
130
131
132
133
134
135
136
137
138
#### PATTERN #######################################################################################
import sys
import os
from setuptools import setup
from pattern import __version__
#---------------------------------------------------------------------------------------------------
# "python setup.py zip" will create the zipped distribution and checksum.
if sys.argv[-1] == "zip":
import zipfile
import hashlib
import codecs
import re
n = "pattern-%s.zip" % __version__
p = os.path.join(os.path.dirname(os.path.realpath(__file__)))
z = zipfile.ZipFile(os.path.join(p, "..", n), "w", zipfile.ZIP_DEFLATED)
for root, folders, files in os.walk(p):
for f in files:
f = os.path.join(root, f)
# Exclude private settings.
if f.endswith(os.path.join("web", "api.py")):
d = "#--- PRIVATE"
s = codecs.open(f, "r", encoding="utf-8").read().split(d)
x = codecs.open(f, "w", encoding="utf-8")
x.write(s[0])
x.close()
# Exclude revision history (.git).
# Exclude development files (.dev).
if not re.search(r"\.DS|\.git[^i]|\.pyc|\.dev|tmp", f):
z.write(f, os.path.join("pattern-" + __version__, os.path.relpath(f, p)))
if f.endswith(os.path.join("web", "api.py")):
x = codecs.open(f, "w", encoding="utf-8")
x.write(d.join(s))
x.close()
z.close()
print n
print hashlib.sha256(open(z.filename).read()).hexdigest()
sys.exit(0)
#---------------------------------------------------------------------------------------------------
# "python setup.py install" will install /pattern in /site-packages.
setup(
name = "Pattern",
version = "2.6",
description = "Web mining module for Python.",
license = "BSD",
author = "Tom De Smedt",
author_email = "tom@organisms.be",
url = "http://www.clips.ua.ac.be/pages/pattern",
packages = [
"pattern",
"pattern.web",
"pattern.web.cache",
"pattern.web.docx",
"pattern.web.feed",
"pattern.web.imap",
"pattern.web.json",
"pattern.web.locale",
"pattern.web.oauth",
"pattern.web.pdf",
"pattern.web.soup",
"pattern.db",
"pattern.text",
"pattern.text.de",
"pattern.text.en",
"pattern.text.en.wordlist",
"pattern.text.en.wordnet",
"pattern.text.en.wordnet.pywordnet",
"pattern.text.es",
"pattern.text.fr",
"pattern.text.it",
"pattern.text.nl",
"pattern.vector",
"pattern.vector.svm",
"pattern.graph",
"pattern.server"
],
package_data = {
"pattern" : ["*.js"],
"pattern.web.cache" : ["tmp/*"],
"pattern.web.docx" : ["*"],
"pattern.web.feed" : ["*"],
"pattern.web.json" : ["*"],
"pattern.web.locale" : ["*"],
"pattern.web.pdf" : ["*.txt", "cmap/*"],
"pattern.web.soup" : ["*"],
"pattern.text.de" : ["*.txt", "*.xml"],
"pattern.text.en" : ["*.txt", "*.xml", "*.slp"],
"pattern.text.en.wordlist": ["*.txt"],
"pattern.text.en.wordnet" : ["*.txt", "dict/*"],
"pattern.text.en.wordnet.pywordnet": ["*"],
"pattern.text.es" : ["*.txt", "*.xml"],
"pattern.text.fr" : ["*.txt", "*.xml"],
"pattern.text.it" : ["*.txt", "*.xml"],
"pattern.text.nl" : ["*.txt", "*.xml"],
"pattern.vector" : ["*.txt"],
"pattern.vector.svm" : ["*.txt", "libsvm-3.11/*", "libsvm-3.17/*", "liblinear-1.93/*"],
"pattern.graph" : ["*.js", "*.csv"],
"pattern.server" : ["static/*", "cherrypy/cherrypy/*.*",
"cherrypy/cherrypy/*/*",
"cherrypy/cherrypy/cherryd"],
},
py_modules = [
"pattern.metrics",
"pattern.text.search",
"pattern.text.tree"
],
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Natural Language :: Dutch",
"Natural Language :: English",
"Natural Language :: French",
"Natural Language :: German",
"Natural Language :: Italian",
"Natural Language :: Spanish",
"Operating System :: OS Independent",
"Programming Language :: JavaScript",
"Programming Language :: Python",
"Topic :: Internet :: WWW/HTTP :: Indexing/Search",
"Topic :: Multimedia :: Graphics",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Visualization",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Text Processing :: Linguistic",
"Topic :: Text Processing :: Markup :: HTML"
],
zip_safe = False
)