forked from couchbase/couchbase-python-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
82 lines (70 loc) · 2.39 KB
/
Copy pathsetup.py
File metadata and controls
82 lines (70 loc) · 2.39 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env python
import sys
import os.path
import platform
import warnings
from distutils.core import setup, Extension
extoptions = {}
LCB_NAME = None
if sys.platform != 'win32':
extoptions['libraries'] = ['couchbase']
else:
warnings.warn("I'm detecting you're running windows."
"You might want to modify "
"the 'setup.py' script to use appropriate paths")
# The layout i have here is an ..\lcb-winbuild, in which there are subdirs
# called 'x86' and 'x64', for x86 and x64 architectures. The default
# 'nmake install' on libcouchbase will install them to 'deps'
bit_type = platform.architecture()[0]
lcb_root = os.path.join(os.path.pardir, 'lcb-winbuild')
if bit_type.startswith('32'):
lcb_root = os.path.join(lcb_root, 'x86')
else:
lcb_root = os.path.join(lcb_root, 'x64')
lcb_root = os.path.join(lcb_root, 'deps')
extoptions['libraries'] = ['libcouchbase']
## Enable these lines for debug builds
#extoptions['extra_compile_args'] = ['/Zi']
#extoptions['extra_link_args'] = ['/DEBUG']
extoptions['library_dirs'] = [os.path.join(lcb_root, 'lib')]
extoptions['include_dirs'] = [os.path.join(lcb_root, 'include')]
SOURCEMODS = (
'argument',
'exceptions',
'ext',
'result',
'opresult',
'callbacks',
'convert',
'connection',
'store',
'constants',
'multiresult',
'miscops',
'typeutil',
'oputil',
'get',
'arithmetic',
'http',
'htresult',
'ctranscoder'
)
extoptions['sources'] = [ os.path.join("src", m + ".c") for m in SOURCEMODS ]
module = Extension('couchbase._libcouchbase', **extoptions)
setup(
name = 'couchbase', version = '0.10',
url="https://github.com/couchbase/couchbase-python-client",
author="Couchbase, Inc.",
author_email="mark.nunberg@couchbase.com",
license="Apache License 2.0",
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules"],
ext_modules = [module],
packages = ['couchbase']
)