-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsetup.py
executable file
·110 lines (97 loc) · 3.41 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
SnapSearch Client Python
~~~~~~~~~~~~~~~~~~~~~~~~
Pythonic HTTP Client and Middleware for `SnapSearch`_.
.. _`SnapSearch`: https://snapsearch.io/
:copyright: 2014 by `SnapSearch`_
:license: MIT, see LICENSE for more details.
:author: `LIU Yu <[email protected]>`_
:date: 2014/03/08
"""
PACKAGE = "snapsearch-client-python"
import os
import sys
from distutils.core import setup
from glob import glob
from os.path import isfile, join
# auxiliary data files for installation
def get_data_files():
#
data_files = []
if sys.platform == "win32":
datadir = join("doc", PACKAGE)
else:
datadir = join("share", "doc", PACKAGE)
#
files = ["README.rst", "LICENSE", ]
if files:
data_files.append((join(datadir), files))
#
files = glob(join("docs", "*.rst"))
if files:
data_files.append((join(datadir, "docs"), files))
#
for example in ("flask", "cgi", ):
files = glob(join("examples", example, "*.py")) + \
glob(join("examples", example, "*.rst"))
if files:
data_files.append((join(datadir, "examples", example), files))
#
files = glob(join("tests", "*.py"))
if files:
data_files.append((join(datadir, "tests"), files))
#
files = glob(join("tests", "_config", "*.*"))
if files:
data_files.append((join(datadir, "tests", "_config"), files))
#
assert data_files
for install_dir, files in data_files:
assert files
for f in files:
assert isfile(f), (f, install_dir)
return data_files
# make sure local package takes precedence over installed (old) package
sys.path.insert(0, join('src', ))
import SnapSearch as pkg
setup(
name=PACKAGE,
packages=["SnapSearch", "SnapSearch.api"],
package_dir={"SnapSearch": join("src", "SnapSearch", ),
"SnapSearch.api": join("src", "SnapSearch", "api"), },
package_data={"SnapSearch.api": ["*.pem", "*.json", ], },
data_files=get_data_files(),
version=".".join(map(str, pkg.__version__)),
author=pkg.__author__,
license=pkg.__license__,
author_email=pkg.__contact__,
description="Pythonic HTTP Client and Middleware Library for SnapSearch",
long_description=open("README.rst").read(),
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 3.3",
"Operating System :: OS Independent",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content :: "
"CGI Tools/Libraries",
"Topic :: Internet :: WWW/HTTP :: WSGI",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware",
"Topic :: Software Development :: Libraries :: Python Modules",
],
keywords=["SnapSearch", "client", "SEO"],
platforms="All",
provides=["SnapSearch", ],
requires=["pycurl", ],
url="https://github.com/liuyu81/SnapSearch-Client-Python",
)