diff options
author | Jenkins <jenkins@review.openstack.org> | 2017-09-13 21:31:56 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2017-09-13 21:31:56 +0000 |
commit | 249ea7cc3ea68fbdbae80ac06cd78a6249652a50 (patch) | |
tree | 40000110a227a27a67026d5592ded888d2a616a9 | |
parent | dfbb2b5dd2a75a85fa0dccade5d2ce35d48a04c0 (diff) | |
parent | a514c89d888fc6677d4c988f297563616eaf2e82 (diff) | |
download | pyeclib-249ea7cc3ea68fbdbae80ac06cd78a6249652a50.tar.gz |
Merge "Add tox environment to test against liberasurecode master"
-rw-r--r-- | bindep.txt | 3 | ||||
-rw-r--r-- | setup.py | 14 | ||||
-rwxr-xr-x | tools/pip-install-with-liberasurecode.sh | 23 | ||||
-rw-r--r-- | tox.ini | 7 |
4 files changed, 47 insertions, 0 deletions
@@ -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] @@ -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 "$@" @@ -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= |