Skip to content

Commit

Permalink
Merge pull request #228 from aerospike/3.4.2-in-progress
Browse files Browse the repository at this point in the history
3.4.2 in progress
  • Loading branch information
aerospikerobertmarks authored Oct 2, 2018
2 parents c0976ce + c3df260 commit 58d1f4e
Show file tree
Hide file tree
Showing 32 changed files with 163 additions and 752 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "modules/aerospike-lua-core"]
path = modules/aerospike-lua-core
url = https://github.com/aerospike/aerospike-lua-core
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.4.1
3.4.2
4 changes: 2 additions & 2 deletions doc/scan.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Scan Class --- :class:`Scan`
:class:`list` of records.

:param dict policy: optional :ref:`aerospike_scan_policies`.
:param str nodename: optional name of node used to limit the scan to a single node.
:param str nodename: optional Node ID of node used to limit the scan to a single node.

:return: a :class:`list` of :ref:`aerospike_record_tuple`.

Expand Down Expand Up @@ -89,7 +89,7 @@ Scan Class --- :class:`Scan`
:param callable callback: the function to invoke for each record.
:param dict policy: optional :ref:`aerospike_scan_policies`.
:param dict options: the :ref:`aerospike_scan_options` that will apply to the scan.
:param str nodename: optional name of node used to limit the scan to a single node.
:param str nodename: optional Node ID of node used to limit the scan to a single node.

.. note:: A :ref:`aerospike_record_tuple` is passed as the argument to the callback function.

Expand Down
1 change: 0 additions & 1 deletion modules/aerospike-lua-core
Submodule aerospike-lua-core deleted from acb9eb
81 changes: 5 additions & 76 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,53 +16,11 @@
################################################################################

from __future__ import print_function
import errno
from subprocess import Popen
import os
import platform
import sys
from distutils.command.build import build
from setuptools.command.install import install
from distutils.sysconfig import get_config_vars
from setuptools import setup, Extension
from shutil import copytree, copy2
from subprocess import Popen


class InstallCommand(install):
user_options = install.user_options + [
('lua-system-path=', None, 'Path to the lua system files')
]

def initialize_options(self):
install.initialize_options(self)
self.lua_system_path = None

def finalize_options(self):
install.finalize_options(self)

def run(self):
global lua_system_path
lua_system_path = self.lua_system_path
install.run(self)


class BuildCommand(build):
user_options = build.user_options + [
('lua-system-path=', None, 'Path to the lua system files')
]

def initialize_options(self):
build.initialize_options(self)
self.lua_system_path = None

def finalize_options(self):
build.finalize_options(self)

def run(self):
global lua_system_path
lua_system_path = self.lua_system_path
build.run(self)


################################################################################
# ENVIRONMENT VARIABLES
Expand All @@ -72,7 +30,7 @@ def run(self):
os.environ['ARCHFLAGS'] = '-arch x86_64'
AEROSPIKE_C_VERSION = os.getenv('AEROSPIKE_C_VERSION')
if not AEROSPIKE_C_VERSION:
AEROSPIKE_C_VERSION = '4.3.14'
AEROSPIKE_C_VERSION = '4.3.17'
DOWNLOAD_C_CLIENT = os.getenv('DOWNLOAD_C_CLIENT')
AEROSPIKE_C_HOME = os.getenv('AEROSPIKE_C_HOME')
PREFIX = None
Expand All @@ -86,7 +44,7 @@ def run(self):
################################################################################


def resolve_c_client(lua_src_path):
def resolve_c_client():
global PREFIX, AEROSPIKE_C_VERSION, DOWNLOAD_C_CLIENT
global extra_objects, include_dirs

Expand Down Expand Up @@ -210,43 +168,24 @@ def resolve_c_client(lua_src_path):
sys.exit(8)

################################################################################
# RESOLVE C CLIENT DEPENDENCY AND LUA SYSTEM PATH
# RESOLVE C CLIENT DEPENDENCY
################################################################################

lua_system_path = ''


# If the C client is packaged elsewhere, assume the libraries are available
lua_src_path = "modules/aerospike-lua-core/src"

if os.environ.get('NO_RESOLVE_C_CLIENT_DEP', None):
has_c_client = True
libraries = libraries + ['aerospike']
lua_src_path = os.environ.get('AEROSPIKE_LUA_PATH', lua_src_path)
else:
has_c_client = False

lua_files = [
lua_src_path + '/aerospike.lua',
lua_src_path + '/as.lua',
lua_src_path + '/stream_ops.lua'
]

for file in lua_files:
if not os.path.isfile(file):
print("Warning: lua file {} not found, exiting".format(file), file=sys.stderr)
sys.exit(4)


# If system-path isn't specified this will install relative to sys.exec_prefix
data_files = [
('aerospike/lua', lua_files)
]

if not has_c_client:
if (('build' in sys.argv or 'build_ext' in sys.argv or
'install' in sys.argv or 'bdist_wheel' in sys.argv)):
resolve_c_client(lua_src_path)
resolve_c_client()

################################################################################
# SETUP
Expand All @@ -261,10 +200,6 @@ def resolve_c_client(lua_src_path):
version = f.read()

setup(
cmdclass={
'build': BuildCommand,
'install': InstallCommand,
},
name='aerospike',
version=version.strip(),
description='Aerospike Client Library for Python',
Expand All @@ -288,14 +223,8 @@ def resolve_c_client(lua_src_path):
# Package Data Files
zip_safe=False,
include_package_data=True,
package_data={
'aerospike': [
lua_src_path + '/*.lua',
]
},

# Data files
data_files=data_files,
ext_modules=[
Extension(
# Extension Name
Expand Down
2 changes: 1 addition & 1 deletion src/main/aerospike.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ AerospikeConstants operator_constants[] = {
MOD_INIT(aerospike)
{

const char version[8] = "3.4.1";
const char version[8] = "3.4.2";
// Makes things "thread-safe"
PyEval_InitThreads();
int i = 0;
Expand Down
Loading

0 comments on commit 58d1f4e

Please sign in to comment.