[54/89] [abbrv] qpid-proton git commit: PROTON-1794: Improve python module detection - Specifically detecting/running tox

2018-07-03 Thread aconway
PROTON-1794: Improve python module detection
- Specifically detecting/running tox

[reapplied as this was overwritten in the source tree reorg]


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/e91457c7
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/e91457c7
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/e91457c7

Branch: refs/heads/go1
Commit: e91457c7ed2bf7caee9414b19df54264fba71444
Parents: bdd986a
Author: Andrew Stitcher 
Authored: Mon Apr 9 13:41:56 2018 -0400
Committer: Andrew Stitcher 
Committed: Mon Apr 9 13:41:56 2018 -0400

--
 CMakeLists.txt | 61 +++--
 1 file changed, 31 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e91457c7/CMakeLists.txt
--
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 571fbee..4e05d48 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -378,39 +378,40 @@ if (BUILD_PYTHON)
   ${PYTHON_EXECUTABLE} -- ${python_coverage_options} 
"${py_root}/proton-test")
   set_tests_properties(python-test PROPERTIES PASS_REGULAR_EXPRESSION "Totals: 
.* 0 failed")
 
-  # Eventually, we'll get rid of this check when other
-  # platforms will be supported. Since `setup.py` will skip
-  # the build for non linux plaforms, it doesn't make sense
-  # to try to run them.
-  option(TOX_TEST "Enable muti-version python testing with TOX" ON)
-  set(tox_default "py26,py27,py33,py34,py35,py36")
-  set(TOX_ENVLIST ${tox_default} CACHE STRING "List of python environments for 
TOX tests" )
-  if (NOT (TOX_ENVLIST STREQUAL tox_default))
-message(WARNING "non-default TOX test set '${TOX_ENVLIST}' (default 
'${tox_default}')")
-  endif()
-  if (CMAKE_SYSTEM_NAME STREQUAL Linux AND TOX_TEST)
-find_program(TOX_EXE "tox")
-if (CMAKE_BUILD_TYPE MATCHES "Coverage")
-  message(STATUS "Building for coverage analysis; skipping the 
python-tox-tests")
-elseif (TOX_EXE)
-  configure_file(
-"${CMAKE_CURRENT_SOURCE_DIR}/misc/tox.ini.in"
-"${CMAKE_CURRENT_BINARY_DIR}/tox.ini")
-  add_test (NAME python-tox-test
-COMMAND ${PN_ENV_SCRIPT}
+  check_python_module("tox" TOX_MODULE_FOUND)
+  if (NOT TOX_MODULE_FOUND)
+message(STATUS "The tox tool is not available; skipping the 
python-tox-tests")
+  else ()
+option(ENABLE_TOX_TEST "Enable multi-version python testing with TOX" ON)
+
+set(tox_default "py26,py27,py33,py34,py35,py36")
+set(TOX_ENVLIST ${tox_default} CACHE STRING "List of python environments 
for TOX tests" )
+mark_as_advanced(TOX_ENVLIST)
+
+if (NOT (TOX_ENVLIST STREQUAL tox_default))
+  message(WARNING "non-default TOX test set '${TOX_ENVLIST}' (default 
'${tox_default}')")
+endif()
+if (ENABLE_TOX_TEST)
+  if (CMAKE_BUILD_TYPE MATCHES "Coverage")
+message(STATUS "Building for coverage analysis; skipping the 
python-tox-tests")
+  else ()
+configure_file(
+  "${CMAKE_CURRENT_SOURCE_DIR}/misc/tox.ini.in"
+  "${CMAKE_CURRENT_BINARY_DIR}/tox.ini")
+add_test (NAME python-tox-test
+  COMMAND ${PN_ENV_SCRIPT}
   "PATH=${py_path}"
   "SASLPASSWD=${SASLPASSWD_EXE}"
   "SWIG=${SWIG_EXECUTABLE}"
-  ${VALGRIND_ENV}
-  ${TOX_EXE})
-  set_tests_properties(python-tox-test
-   PROPERTIES
- PASS_REGULAR_EXPRESSION "Totals: .* ignored, 0 
failed"
- FAIL_REGULAR_EXPRESSION "ERROR:[ ]+py[0-9]*: 
commands failed")
-else (TOX_EXE)
-  message(STATUS "The tox tool is not available; skipping the 
python-tox-tests")
-endif ()
-  endif (CMAKE_SYSTEM_NAME STREQUAL Linux AND TOX_TEST)
+  ${VALGRIND_ENV} --
+  ${PYTHON_EXECUTABLE} -m tox)
+set_tests_properties(python-tox-test
+ PROPERTIES
+   PASS_REGULAR_EXPRESSION "Totals: .* ignored, 0 
failed"
+   FAIL_REGULAR_EXPRESSION "ERROR:[ ]+py[0-9]*: 
commands failed")
+  endif ()
+endif (ENABLE_TOX_TEST)
+  endif (NOT TOX_MODULE_FOUND)
 endif (BUILD_PYTHON)
 
 install (FILES LICENSE.txt README.md


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



qpid-proton git commit: PROTON-1794: Improve python module detection - Specifically detecting/running tox

2018-04-09 Thread astitcher
Repository: qpid-proton
Updated Branches:
  refs/heads/master bdd986a1d -> e91457c7e


PROTON-1794: Improve python module detection
- Specifically detecting/running tox

[reapplied as this was overwritten in the source tree reorg]


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/e91457c7
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/e91457c7
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/e91457c7

Branch: refs/heads/master
Commit: e91457c7ed2bf7caee9414b19df54264fba71444
Parents: bdd986a
Author: Andrew Stitcher 
Authored: Mon Apr 9 13:41:56 2018 -0400
Committer: Andrew Stitcher 
Committed: Mon Apr 9 13:41:56 2018 -0400

--
 CMakeLists.txt | 61 +++--
 1 file changed, 31 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e91457c7/CMakeLists.txt
--
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 571fbee..4e05d48 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -378,39 +378,40 @@ if (BUILD_PYTHON)
   ${PYTHON_EXECUTABLE} -- ${python_coverage_options} 
"${py_root}/proton-test")
   set_tests_properties(python-test PROPERTIES PASS_REGULAR_EXPRESSION "Totals: 
.* 0 failed")
 
-  # Eventually, we'll get rid of this check when other
-  # platforms will be supported. Since `setup.py` will skip
-  # the build for non linux plaforms, it doesn't make sense
-  # to try to run them.
-  option(TOX_TEST "Enable muti-version python testing with TOX" ON)
-  set(tox_default "py26,py27,py33,py34,py35,py36")
-  set(TOX_ENVLIST ${tox_default} CACHE STRING "List of python environments for 
TOX tests" )
-  if (NOT (TOX_ENVLIST STREQUAL tox_default))
-message(WARNING "non-default TOX test set '${TOX_ENVLIST}' (default 
'${tox_default}')")
-  endif()
-  if (CMAKE_SYSTEM_NAME STREQUAL Linux AND TOX_TEST)
-find_program(TOX_EXE "tox")
-if (CMAKE_BUILD_TYPE MATCHES "Coverage")
-  message(STATUS "Building for coverage analysis; skipping the 
python-tox-tests")
-elseif (TOX_EXE)
-  configure_file(
-"${CMAKE_CURRENT_SOURCE_DIR}/misc/tox.ini.in"
-"${CMAKE_CURRENT_BINARY_DIR}/tox.ini")
-  add_test (NAME python-tox-test
-COMMAND ${PN_ENV_SCRIPT}
+  check_python_module("tox" TOX_MODULE_FOUND)
+  if (NOT TOX_MODULE_FOUND)
+message(STATUS "The tox tool is not available; skipping the 
python-tox-tests")
+  else ()
+option(ENABLE_TOX_TEST "Enable multi-version python testing with TOX" ON)
+
+set(tox_default "py26,py27,py33,py34,py35,py36")
+set(TOX_ENVLIST ${tox_default} CACHE STRING "List of python environments 
for TOX tests" )
+mark_as_advanced(TOX_ENVLIST)
+
+if (NOT (TOX_ENVLIST STREQUAL tox_default))
+  message(WARNING "non-default TOX test set '${TOX_ENVLIST}' (default 
'${tox_default}')")
+endif()
+if (ENABLE_TOX_TEST)
+  if (CMAKE_BUILD_TYPE MATCHES "Coverage")
+message(STATUS "Building for coverage analysis; skipping the 
python-tox-tests")
+  else ()
+configure_file(
+  "${CMAKE_CURRENT_SOURCE_DIR}/misc/tox.ini.in"
+  "${CMAKE_CURRENT_BINARY_DIR}/tox.ini")
+add_test (NAME python-tox-test
+  COMMAND ${PN_ENV_SCRIPT}
   "PATH=${py_path}"
   "SASLPASSWD=${SASLPASSWD_EXE}"
   "SWIG=${SWIG_EXECUTABLE}"
-  ${VALGRIND_ENV}
-  ${TOX_EXE})
-  set_tests_properties(python-tox-test
-   PROPERTIES
- PASS_REGULAR_EXPRESSION "Totals: .* ignored, 0 
failed"
- FAIL_REGULAR_EXPRESSION "ERROR:[ ]+py[0-9]*: 
commands failed")
-else (TOX_EXE)
-  message(STATUS "The tox tool is not available; skipping the 
python-tox-tests")
-endif ()
-  endif (CMAKE_SYSTEM_NAME STREQUAL Linux AND TOX_TEST)
+  ${VALGRIND_ENV} --
+  ${PYTHON_EXECUTABLE} -m tox)
+set_tests_properties(python-tox-test
+ PROPERTIES
+   PASS_REGULAR_EXPRESSION "Totals: .* ignored, 0 
failed"
+   FAIL_REGULAR_EXPRESSION "ERROR:[ ]+py[0-9]*: 
commands failed")
+  endif ()
+endif (ENABLE_TOX_TEST)
+  endif (NOT TOX_MODULE_FOUND)
 endif (BUILD_PYTHON)
 
 install (FILES LICENSE.txt README.md


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[1/2] qpid-proton git commit: PROTON-1794: Improve python module detection - Specifically detecting/running tox

2018-03-14 Thread astitcher
Repository: qpid-proton
Updated Branches:
  refs/heads/master 241563b35 -> 04d466f36


PROTON-1794: Improve python module detection
- Specifically detecting/running tox


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/6018725a
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/6018725a
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/6018725a

Branch: refs/heads/master
Commit: 6018725aa0266df07b43ff434bba73cffd14fae7
Parents: 241563b
Author: Andrew Stitcher 
Authored: Wed Mar 14 15:30:14 2018 -0400
Committer: Andrew Stitcher 
Committed: Wed Mar 14 15:35:11 2018 -0400

--
 proton-c/CMakeLists.txt | 18 
 tools/cmake/Modules/CheckPythonModule.cmake | 56 
 2 files changed, 65 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6018725a/proton-c/CMakeLists.txt
--
diff --git a/proton-c/CMakeLists.txt b/proton-c/CMakeLists.txt
index 192d766..381d533 100644
--- a/proton-c/CMakeLists.txt
+++ b/proton-c/CMakeLists.txt
@@ -19,6 +19,7 @@
 
 include(CheckLibraryExists)
 include(CheckSymbolExists)
+include(CheckPythonModule)
 
 include(versions.cmake)
 
@@ -765,10 +766,11 @@ if (BUILD_PYTHON)
   ${PYTHON_EXECUTABLE} -- ${python_coverage_options} 
"${py_root}/proton-test")
   set_tests_properties(python-test PROPERTIES PASS_REGULAR_EXPRESSION "Totals: 
.* 0 failed")
 
-  find_program(TOX_EXECUTABLE "tox")
-  mark_as_advanced(TOX_EXECUTABLE)
-  if (TOX_EXECUTABLE)
-option(ENABLE_TOX_TEST "Enable muti-version python testing with TOX" ON)
+  check_python_module("tox" TOX_MODULE_FOUND)
+  if (NOT TOX_MODULE_FOUND)
+message(STATUS "The tox tool is not available; skipping the 
python-tox-tests")
+  else ()
+option(ENABLE_TOX_TEST "Enable multi-version python testing with TOX" ON)
 
 set(tox_default "py26,py27,py33,py34,py35,py36")
 set(TOX_ENVLIST ${tox_default} CACHE STRING "List of python environments 
for TOX tests" )
@@ -789,17 +791,15 @@ if (BUILD_PYTHON)
   "PATH=${py_path}"
   "SASLPASSWD=${SASLPASSWD_EXE}"
   "SWIG=${SWIG_EXECUTABLE}"
-  ${VALGRIND_ENV}
-  ${TOX_EXECUTABLE})
+  ${VALGRIND_ENV} --
+  ${PYTHON_EXECUTABLE} -m tox)
 set_tests_properties(python-tox-test
  PROPERTIES
PASS_REGULAR_EXPRESSION "Totals: .* ignored, 0 
failed"
FAIL_REGULAR_EXPRESSION "ERROR:[ ]+py[0-9]*: 
commands failed")
   endif ()
 endif (ENABLE_TOX_TEST)
-  else (TOX_EXECUTABLE)
-message(STATUS "The tox tool is not available; skipping the 
python-tox-tests")
-  endif(TOX_EXECUTABLE)
+  endif(NOT TOX_MODULE_FOUND)
 
   set (perf_pythonpath "${py_pythonpath}" "${CMAKE_SOURCE_DIR}/examples/cpp")
   to_native_path ("${perf_pythonpath}" perf_pythonpath)

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6018725a/tools/cmake/Modules/CheckPythonModule.cmake
--
diff --git a/tools/cmake/Modules/CheckPythonModule.cmake 
b/tools/cmake/Modules/CheckPythonModule.cmake
new file mode 100644
index 000..9e94ec3
--- /dev/null
+++ b/tools/cmake/Modules/CheckPythonModule.cmake
@@ -0,0 +1,56 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+#.rst
+# CheckPythonModule
+# 
+#
+# Provides a macro to check if a python module is available
+#
+# .. commmand:: CHECK_PYTHON_MODULE
+#
+#   ::
+#
+# CHECK_PYTHON_MODULE( )
+#
+#   Check if the given python  may be used by the detected
+#   python interpreter and store the result in an internal cache entry
+#   named .
+#
+#   The ``PYTHON_EXECUTABLE`` variable must be set before calling this
+#   macro, usually by using find_package(PythonInterp).
+
+macro (CHECK_PYTHON_MODULE