Repository navigation
Expand file tree
/
Copy pathsetup.py
More file actions
66 lines (56 loc) · 1.86 KB
/
Copy pathsetup.py
File metadata and controls
66 lines (56 loc) · 1.86 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
# -*- coding: utf-8 -*-
from distutils.core import setup
import os.path
# Read package version without importing it
for line in open(os.path.join(os.path.dirname(__file__), "src", "tarantool", "__init__.py")):
if line.startswith("__version__"):
exec line
break
# Extra commands for documentation management
cmdclass = {}
command_options = {}
# Build Sphinx documentation (html)
# python setup.py build_sphinx
# generates files into build/sphinx/html
try:
from sphinx.setup_command import BuildDoc
cmdclass["build_sphinx"] = BuildDoc
except ImportError:
pass
# Upload Sphinx documentation to PyPI (using Sphinx-PyPI-upload)
# python setup.py build_sphinx
# updates documentation at http://packages.python.org/tarantool/
try:
from sphinx_pypi_upload import UploadDoc
cmdclass["upload_sphinx"] = UploadDoc
command_options["upload_sphinx"] = {
'upload_dir': ('setup.py', os.path.join(os.path.dirname(__file__), "build", "sphinx", "html"))
}
except ImportError:
pass
# Test runner
# python setup.py test
from tests.setup_command import test
cmdclass["test"] = test
setup(
name = "tarantool",
packages = ["tarantool"],
package_dir = {"tarantool": os.path.join("src", "tarantool")},
version = __version__,
platforms = ["all"],
author = "Konstantin Cherkasoff",
url = "https://github.com/coxx/tarantool-python",
license = "BSD",
description = "Python client library for Tarantool Database",
long_description = open("README.rst").read(),
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Database :: Front-Ends"
],
cmdclass = cmdclass,
command_options = command_options
)