summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-09-13 21:31:56 +0000
committerGerrit Code Review <review@openstack.org>2017-09-13 21:31:56 +0000
commit249ea7cc3ea68fbdbae80ac06cd78a6249652a50 (patch)
tree40000110a227a27a67026d5592ded888d2a616a9
parentdfbb2b5dd2a75a85fa0dccade5d2ce35d48a04c0 (diff)
parenta514c89d888fc6677d4c988f297563616eaf2e82 (diff)
downloadpyeclib-249ea7cc3ea68fbdbae80ac06cd78a6249652a50.tar.gz
Merge "Add tox environment to test against liberasurecode master"
-rw-r--r--bindep.txt3
-rw-r--r--setup.py14
-rwxr-xr-xtools/pip-install-with-liberasurecode.sh23
-rw-r--r--tox.ini7
4 files changed, 47 insertions, 0 deletions
diff --git a/bindep.txt b/bindep.txt
index 9302ef5..ea8cf54 100644
--- a/bindep.txt
+++ b/bindep.txt
@@ -4,6 +4,9 @@
build-essential [platform:dpkg]
gcc [platform:rpm]
make [platform:rpm]
+autoconf
+automake
+libtool
liberasurecode-dev [platform:dpkg]
liberasurecode-devel [platform:rpm]
python-dev [platform:dpkg]
diff --git a/setup.py b/setup.py
index 66e3470..4482491 100644
--- a/setup.py
+++ b/setup.py
@@ -55,6 +55,18 @@ default_python_incdir = get_python_inc()
def _find_library(name):
target_lib = find_library(name)
if platform_str.find("Darwin") > -1:
+ # If we didn't find it, try extending our search a bit
+ if not target_lib:
+ if 'DYLD_LIBRARY_PATH' in os.environ:
+ os.environ['DYLD_LIBRARY_PATH'] += ':%s/lib' % sys.prefix
+ else:
+ os.environ['DYLD_LIBRARY_PATH'] = '%s/lib' % sys.prefix
+ target_lib = find_library(name)
+
+ # If we *still* don't find it, bail
+ if not target_lib:
+ return target_lib
+
target_lib = os.path.abspath(target_lib)
if os.path.islink(target_lib):
p = os.readlink(target_lib)
@@ -167,6 +179,8 @@ module = Extension('pyeclib_c',
'%s/include/liberasurecode' % sys.prefix,
'%s/include' % sys.prefix],
libraries=['erasurecode'],
+ library_dirs=['%s/lib' % sys.prefix],
+ runtime_library_dirs=['%s/lib' % sys.prefix],
# The extra arguments are for debugging
# extra_compile_args=['-g', '-O0'],
sources=['src/c/pyeclib_c/pyeclib_c.c'])
diff --git a/tools/pip-install-with-liberasurecode.sh b/tools/pip-install-with-liberasurecode.sh
new file mode 100755
index 0000000..2be036f
--- /dev/null
+++ b/tools/pip-install-with-liberasurecode.sh
@@ -0,0 +1,23 @@
+#!/bin/bash -xe
+if [ -z "$VIRTUAL_ENV" ]; then
+ echo "Expected VIRTUAL_ENV to be set!"
+ exit 1
+fi
+if [ -z "$LIBERASURECODE_DIR" ]; then
+ echo "Expected LIBERASURECODE_DIR to be set!"
+ exit 1
+fi
+if [ ! -d "$LIBERASURECODE_DIR" ]; then
+ git clone git://git.openstack.org/openstack/liberasurecode "$LIBERASURECODE_DIR"
+fi
+pushd "$LIBERASURECODE_DIR"
+if [ -n "$LIBERASURECODE_REF" ]; then
+ git fetch origin "$LIBERASURECODE_REF"
+ git checkout FETCH_HEAD
+fi
+./autogen.sh
+./configure --prefix "$VIRTUAL_ENV"
+make
+make install
+popd
+pip install "$@"
diff --git a/tox.ini b/tox.ini
index 2f2f09c..b68e8c7 100644
--- a/tox.ini
+++ b/tox.ini
@@ -7,7 +7,14 @@ deps =
commands=
nosetests --no-path-adjustment -v test/
+[testenv:liberasurecode-git]
+setenv = LIBERASURECODE_DIR={envdir}/liberasurecode
+passenv = LIBERASURECODE_REF
+install_command =
+ {toxinidir}/tools/pip-install-with-liberasurecode.sh {opts} {packages}
+
[testenv:pep8]
+skip_install = True
deps=
pep8
commands=