Merge lp:~thisfred/u1db/dont-install-cython-wrapper into lp:u1db

Proposed by Eric Casteleijn
Status: Merged
Approved by: Eric Casteleijn
Approved revision: 397
Merged at revision: 396
Proposed branch: lp:~thisfred/u1db/dont-install-cython-wrapper
Merge into: lp:u1db
Diff against target: 120 lines (+41/-30)
2 files modified
CMakeLists.txt (+15/-6)
setup.py (+26/-24)
To merge this branch: bzr merge lp:~thisfred/u1db/dont-install-cython-wrapper
Reviewer Review Type Date Requested Status
Samuele Pedroni Approve
Review via email: mp+123307@code.launchpad.net

Commit message

Made setup.py not build cython wrapper by default.

Description of the change

Made setup.py not build cython wrapper by default.

To post a comment you must log in.
Revision history for this message
Samuele Pedroni (pedronis) wrote :

+1

review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (3.8 KiB)

The attempt to merge lp:~thisfred/u1db/dont-install-cython-wrapper into lp:u1db failed. Below is the output from the failed tests.

-- The C compiler identification is GNU 4.7.1
-- The CXX compiler identification is GNU 4.7.1
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found Cython: /usr/bin/cython
-- Found CURL: /usr/lib/x86_64-linux-gnu/libcurl.so (found version "7.27.0")
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.26")
-- checking for module 'oauth'
-- found oauth, version 0.9.7
-- Found OAuth: /usr/lib/x86_64-linux-gnu/liboauth.so
-- checking for module 'json'
-- found json, version 0.10
-- Found JSON: /usr/lib/x86_64-linux-gnu/libjson.so
-- checking for module 'sqlite3'
-- found sqlite3, version 3.7.13
-- Found Sqlite3: /usr/lib/x86_64-linux-gnu/libsqlite3.so
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/tarmac/cache/u1db/trunk
Scanning dependencies of target ReplicatePythonSourceTree
[ 0%] Built target ReplicatePythonSourceTree
[ 11%] Generating u1db_schema.c
Scanning dependencies of target u1db
[ 22%] Building C object src/CMakeFiles/u1db.dir/mkstemp_compat.c.o
[ 33%] Building C object src/CMakeFiles/u1db.dir/u1db.c.o
[ 44%] Building C object src/CMakeFiles/u1db.dir/u1db_http_sync_target.c.o
[ 55%] Building C object src/CMakeFiles/u1db.dir/u1db_query.c.o
[ 66%] Building C object src/CMakeFiles/u1db.dir/u1db_sync_target.c.o
[ 77%] Building C object src/CMakeFiles/u1db.dir/u1db_uuid.c.o
[ 88%] Building C object src/CMakeFiles/u1db.dir/u1db_vectorclock.c.o
[100%] Building C object src/CMakeFiles/u1db.dir/u1db_schema.c.o
Linking C static library libu1db.a
[100%] Built target u1db
Scanning dependencies of target build-debug
running build_ext
[100%] Built target build-debug
Scanning dependencies of target check-valgrind
Tests running...
======================================================================
FAIL: u1db.tests.test_c_backend.TestCDatabaseExists.test_c_backend_compiled
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/mnt/tarmac/cache/u1db/trunk/u1db/tests/test_c_backend.py", line 38, in test_c_backend_compiled
    " Was it compiled properly?\n%s" % (c_backend_error,))
AssertionError: Could not import the c_backend_wrapper module. Was it compiled properly?
cannot import name c_backend_wrapper

Ran 1455 tests in 162.349s
FAILED (failures=1)

[59005 refs]
==2975== Memcheck, a memory error detector
==2975== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==2975== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==2975== Command: python-dbg -m testtools.run discover
==2975==
[168478 refs]
==2975==
==2975== HEAP SUMMARY:
==2975== in use at exit: 23,995,807 bytes in 9,372 blocks
==2975== total heap usage: 1,276,168 allocs, 1,266,796 frees, 632,798,209 bytes ...

Read more...

Revision history for this message
Samuele Pedroni (pedronis) wrote :

a more meditated +1 :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2012-08-21 20:06:02 +0000
3+++ CMakeLists.txt 2012-09-07 16:55:22 +0000
4@@ -46,12 +46,12 @@
5
6 add_custom_target(check-nodoc
7 COMMAND python -m testtools.run discover
8- DEPENDS build-inplace
9+ DEPENDS build-inplace-for-tests
10 )
11
12 add_custom_target(check
13 COMMAND python -m testtools.run discover
14- DEPENDS build-inplace doctests
15+ DEPENDS build-inplace-for-tests doctests
16 )
17
18 add_custom_target(cdocs
19@@ -68,19 +68,28 @@
20 DEPENDS ReplicatePythonSourceTree u1db
21 )
22
23+add_custom_target(build-inplace-for-tests
24+ COMMAND U1DB_TEST=1 python setup.py build_ext -i -f -I ${CMAKE_SOURCE_DIR}/include
25+ DEPENDS ReplicatePythonSourceTree u1db
26+)
27+
28+add_custom_target(build-debug-for-tests
29+ COMMAND U1DB_TEST=1 python-dbg setup.py build_ext -i -f -I ${CMAKE_SOURCE_DIR}/include
30+ DEPENDS ReplicatePythonSourceTree u1db
31+)
32 add_custom_target(check-valgrind
33 COMMAND valgrind --tool=memcheck --suppressions=${CMAKE_SOURCE_DIR}/custom.supp python-dbg -m testtools.run discover
34- DEPENDS build-debug
35+ DEPENDS build-debug-for-tests
36 )
37
38 add_custom_target(check-valgrind-leaks
39 COMMAND valgrind --tool=memcheck --suppressions=${CMAKE_SOURCE_DIR}/custom.supp --track-origins=yes --num-callers=40 --leak-resolution=high --leak-check=full python-dbg -m testtools.run discover
40- DEPENDS build-debug
41+ DEPENDS build-debug-for-tests
42 )
43
44 add_custom_target(check-verbose
45- COMMAND python -c \"import unittest, sys\; from testtools import run\; run.TestProgram(argv=sys.argv, testRunner=unittest.TextTestRunner(verbosity=2), stdout=sys.stdout)\" discover
46- DEPENDS build-inplace
47+ COMMAND U1DB_TEST=1 python -c \"import unittest, sys\; from testtools import run\; run.TestProgram(argv=sys.argv, testRunner=unittest.TextTestRunner(verbosity=2), stdout=sys.stdout)\" discover
48+ DEPENDS build-inplace-for-tests
49 )
50
51 add_custom_target(html-docs
52
53=== modified file 'setup.py'
54--- setup.py 2012-08-14 14:31:45 +0000
55+++ setup.py 2012-09-07 16:55:22 +0000
56@@ -15,6 +15,7 @@
57 # You should have received a copy of the GNU Lesser General Public License
58 # along with u1db. If not, see <http://www.gnu.org/licenses/>.
59
60+import os
61 import sys
62
63
64@@ -63,31 +64,32 @@
65 synchronize them with other stores.
66 """
67 }
68- try:
69- from Cython.Distutils import build_ext
70- except ImportError:
71- print "Unable to import Cython, to test the C implementation"
72- else:
73- kwargs["cmdclass"] = {"build_ext": build_ext}
74- extra_libs = []
75- extra_defines = []
76- if sys.platform == 'win32':
77- # Used for the random number generator
78- extra_libs.append('advapi32')
79- extra_libs.append('libcurl_imp')
80- extra_libs.append('libeay32')
81- extra_defines = [('_CRT_SECURE_NO_WARNINGS', 1)]
82+ if "U1DB_TEST" in os.environ:
83+ try:
84+ from Cython.Distutils import build_ext
85+ except ImportError:
86+ print "Unable to import Cython, to test the C implementation"
87 else:
88- extra_libs.append('curl')
89- extra_libs.append('json')
90- ext.append(Extension(
91- "u1db.tests.c_backend_wrapper",
92- ["u1db/tests/c_backend_wrapper.pyx"],
93- include_dirs=['include'],
94- library_dirs=["src"],
95- libraries=['u1db', 'sqlite3', 'oauth'] + extra_libs,
96- define_macros=[] + extra_defines,
97- ))
98+ kwargs["cmdclass"] = {"build_ext": build_ext}
99+ extra_libs = []
100+ extra_defines = []
101+ if sys.platform == 'win32':
102+ # Used for the random number generator
103+ extra_libs.append('advapi32')
104+ extra_libs.append('libcurl_imp')
105+ extra_libs.append('libeay32')
106+ extra_defines = [('_CRT_SECURE_NO_WARNINGS', 1)]
107+ else:
108+ extra_libs.append('curl')
109+ extra_libs.append('json')
110+ ext.append(Extension(
111+ "u1db.tests.c_backend_wrapper",
112+ ["u1db/tests/c_backend_wrapper.pyx"],
113+ include_dirs=['include'],
114+ library_dirs=["src"],
115+ libraries=['u1db', 'sqlite3', 'oauth'] + extra_libs,
116+ define_macros=[] + extra_defines,
117+ ))
118 setup(**kwargs)
119
120 if __name__ == "__main__":

Subscribers

People subscribed via source and target branches