From 2f91cd6c4865dcb4d7959377bccddddabb18890b Mon Sep 17 00:00:00 2001 From: Stefan Schweter Date: Sat, 24 Dec 2016 02:09:12 +0100 Subject: [PATCH 1/2] Added new test case for split method (unicode non-breaking space) (#374) --- dlib/test/string.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlib/test/string.cpp b/dlib/test/string.cpp index c554c64a9..18f9035c5 100644 --- a/dlib/test/string.cpp +++ b/dlib/test/string.cpp @@ -243,6 +243,13 @@ namespace DLIB_TEST(wv[0] == L"test"); DLIB_TEST(wv[1] == L"string"); + wstr = L"Über alle Maßen\u00A0Öttingenstraße"; + wv = split(wstr, L" \u00A0\n\r\t"); + DLIB_TEST(wv.size() == 4); + DLIB_TEST(wv[0] == L"Über"); + DLIB_TEST(wv[1] == L"alle"); + DLIB_TEST(wv[2] == L"Maßen"); + DLIB_TEST(wv[3] == L"Öttingenstraße"); wstr = L"test string hah"; DLIB_TEST(split_on_first(wstr).first == L"test"); From c22bedc1c69cf7607b0b1f9d5b8e8e76cbf4d20e Mon Sep 17 00:00:00 2001 From: hiiwave Date: Tue, 27 Dec 2016 07:18:49 -0600 Subject: [PATCH 2/2] Modify setup.py so that it can be installed under conda environment (#377) --- setup.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 41db309c1..7b43c55a8 100644 --- a/setup.py +++ b/setup.py @@ -355,7 +355,7 @@ def read_version(): major = re.findall("set\(CPACK_PACKAGE_VERSION_MAJOR.*\"(.*)\"", open('dlib/CMakeLists.txt').read())[0] minor = re.findall("set\(CPACK_PACKAGE_VERSION_MINOR.*\"(.*)\"", open('dlib/CMakeLists.txt').read())[0] patch = re.findall("set\(CPACK_PACKAGE_VERSION_PATCH.*\"(.*)\"", open('dlib/CMakeLists.txt').read())[0] - return major + '.' + minor + '.' + patch + return major + '.' + minor + '.' + patch def rmtree(name): @@ -504,6 +504,14 @@ class build(_build): # make sure build artifacts are generated for the version of Python currently running cmake_extra_arch = [] + + if 'conda' in sys.version: + # to support conda distribution + from distutils.sysconfig import get_python_inc + import distutils.sysconfig as sysconfig + cmake_extra_arch += ['-DPYTHON_INCLUDE_DIR=' + get_python_inc()] + cmake_extra_arch += ['-DPYTHON_LIBRARY=' + sysconfig.get_config_var('LIBDIR')] + if sys.version_info >= (3, 0): cmake_extra_arch += ['-DPYTHON3=yes']