forked from couchbase/couchbase-python-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
95 lines (80 loc) · 2.96 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
#!/usr/bin/env python
import logging
import os
import couchbase_version
from cbuild_config import get_ext_options, couchbase_core, build_type
from cmodule import gen_distutils_build
from cmake_build import gen_cmake_build
import itertools
import pathlib
try:
if os.environ.get('PYCBC_NO_DISTRIBUTE'):
raise ImportError()
from setuptools import setup, Extension
except ImportError:
from distutils.core import setup, Extension
curdir = pathlib.Path(__file__).parent
try:
couchbase_version.gen_version()
except couchbase_version.CantInvokeGit:
pass
pkgversion = couchbase_version.get_version()
def handle_build_type_and_gen_deps():
cmake_build = build_type in ['CMAKE', 'CMAKE_HYBRID']
print("Build type: {}, cmake:{}".format(build_type, cmake_build))
general_requires = open(str(curdir.joinpath('requirements.txt'))).readlines()
extoptions, pkgdata=get_ext_options()
if cmake_build:
e_mods, extra_requires, cmdclass = gen_cmake_build(extoptions, pkgdata)
general_requires += extra_requires
else:
print("Legacy build")
e_mods, cmdclass = gen_distutils_build(extoptions, pkgdata)
setup_kw = {'ext_modules': e_mods}
logging.error(setup_kw)
setup_kw['setup_requires'] = general_requires
setup_kw['install_requires'] = general_requires
setup_kw['cmdclass'] = cmdclass
setup_kw['package_data'] = pkgdata
setup_kw['eager_resources'] = list(itertools.chain.from_iterable(pkgdata.values()))
return setup_kw
setup_kw = handle_build_type_and_gen_deps()
packages = {
'acouchbase',
'couchbase',
couchbase_core,
couchbase_core+'.views',
couchbase_core+'.iops',
couchbase_core+'.asynchronous',
'couchbase.asynchronous',
'couchbase.management',
'txcouchbase'
}
setup(
name = 'couchbase',
version = pkgversion,
url="https://github.com/couchbase/couchbase-python-client",
author="Couchbase, Inc.",
author_email="[email protected]",
license="Apache License 2.0",
description="Python Client for Couchbase",
long_description=open(str(curdir.joinpath("README.rst")), "r").read(),
long_description_content_type='text/x-rst',
keywords=["couchbase", "nosql", "pycouchbase", "libcouchbase"],
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Database",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules"],
python_requires=">=3.5",
packages = list(packages),
tests_require=['utilspie','nose', 'testresources>=0.2.7', 'basictracer==2.2.0'],
test_suite='couchbase_tests.test_sync',
**setup_kw
)