From 1928dbae00c18afb7086418cb6033bd636e0f538 Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Fri, 5 Feb 2016 15:13:54 +0100 Subject: [PATCH 1/4] Travis: added variants to build with python versions 2.7 and 3.4 --- .travis.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8d09fa8..cf1ac0f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,19 +17,24 @@ env: - SEQUENCEPARSER_BUILD=${TRAVIS_BUILD_DIR}/build-sequenceparser - SEQUENCEPARSER_INSTALL=${TRAVIS_BUILD_DIR}/install-sequenceparser - CI_NODE_TOTAL=2 + matrix: + - PYTHON_VERSION=2.7 + - PYTHON_VERSION=3.4 -# This results in a 2×2 build matrix. -# Where the variables are: os / compiler +# This results in a 2×2x2 build matrix. +# Where the variables are: os / compiler / python version addons: apt: - sources: ['boost-latest', 'kalakris-cmake'] + sources: ['boost-latest', 'kalakris-cmake', 'pythonxy-devel'] packages: - cmake - swig - libboost1.55-all-dev - python-dev - python-nose + - python3-dev + - python3-nose cache: # Caching Ubuntu packages @@ -43,11 +48,11 @@ before_script: script: # build - mkdir ${SEQUENCEPARSER_BUILD} && cd ${SEQUENCEPARSER_BUILD} - - cmake .. -DCMAKE_INSTALL_PREFIX=${SEQUENCEPARSER_INSTALL} -DSEQUENCEPARSER_PYTHON_VERSION=2.7 + - cmake .. -DCMAKE_INSTALL_PREFIX=${SEQUENCEPARSER_INSTALL} -DSEQUENCEPARSER_PYTHON_VERSION=${PYTHON_VERSION} - make - make install # tests - cd ${TRAVIS_BUILD_DIR} - - export PYTHONPATH=$PYTHONPATH:${SEQUENCEPARSER_INSTALL}/lib/python2.7/site-packages + - export PYTHONPATH=$PYTHONPATH:${SEQUENCEPARSER_INSTALL}/lib/python${PYTHON_VERSION}/site-packages - nosetests pyTest From 31622cd36b0addae0556687473e78daff57954c9 Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Fri, 5 Feb 2016 15:28:10 +0100 Subject: [PATCH 2/4] Travis: added tools/travis build.sh and launch_tests.sh scripts --- .travis.yml | 12 ++---------- tools/travis/build.sh | 17 +++++++++++++++++ tools/travis/launch_tests.sh | 16 ++++++++++++++++ 3 files changed, 35 insertions(+), 10 deletions(-) create mode 100755 tools/travis/build.sh create mode 100755 tools/travis/launch_tests.sh diff --git a/.travis.yml b/.travis.yml index cf1ac0f..79326ed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,13 +46,5 @@ before_script: - uname -a script: - # build - - mkdir ${SEQUENCEPARSER_BUILD} && cd ${SEQUENCEPARSER_BUILD} - - cmake .. -DCMAKE_INSTALL_PREFIX=${SEQUENCEPARSER_INSTALL} -DSEQUENCEPARSER_PYTHON_VERSION=${PYTHON_VERSION} - - make - - make install - - # tests - - cd ${TRAVIS_BUILD_DIR} - - export PYTHONPATH=$PYTHONPATH:${SEQUENCEPARSER_INSTALL}/lib/python${PYTHON_VERSION}/site-packages - - nosetests pyTest + - tools/travis/build.sh + - tools/travis/launch_tests.sh diff --git a/tools/travis/build.sh b/tools/travis/build.sh new file mode 100755 index 0000000..2d6d03c --- /dev/null +++ b/tools/travis/build.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# Exit immediately if a command exits with a non-zero status +set -e +# Print commands and their arguments as they are executed. +set -x + +# Create directory of build +mkdir ${SEQUENCEPARSER_BUILD} +cd ${SEQUENCEPARSER_BUILD} + +# Build sequenceParser +cmake --version +cmake .. -DCMAKE_INSTALL_PREFIX=${SEQUENCEPARSER_INSTALL} -DSEQUENCEPARSER_PYTHON_VERSION=${PYTHON_VERSION} +make -k +make install +cd .. diff --git a/tools/travis/launch_tests.sh b/tools/travis/launch_tests.sh new file mode 100755 index 0000000..a8e659a --- /dev/null +++ b/tools/travis/launch_tests.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +# Exit immediately if a command exits with a non-zero status +set -e +# Print commands and their arguments as they are executed. +set -x + +# set env +export PYTHONPATH=$PYTHONPATH:${SEQUENCEPARSER_INSTALL}/lib/python${PYTHON_VERSION}/site-packages + +# nosetests +if [[ ${PYTHON_VERSION} == "2.7" ]]; then + nosetests ${TRAVIS_BUILD_DIR}/pyTest -v +elif [[ ${PYTHON_VERSION} == "3.4" ]]; then + nosetests3 ${TRAVIS_BUILD_DIR}/pyTest -v +fi From 47110617ba6d8f55944acb150ba5a1623a8b52ba Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Fri, 5 Feb 2016 15:36:19 +0100 Subject: [PATCH 3/4] CMake: fixed generation of both SWIG java and python3 bindings There was a SWIG error when it tries to generate the java binding: "Unrecognized option -py3". --- src/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bc2a4df..0b3c18d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -47,7 +47,7 @@ if(SWIG_FOUND) set_source_files_properties(${SEQUENCEPARSER_BINDING_FILE} PROPERTIES CPLUSPLUS ON) # Swig flags - set(CMAKE_SWIG_FLAGS -c++ -fcompact -small -O -Wall) + set(COMMON_SWIG_FLAGS -c++ -fcompact -small -O -Wall) ### PYTHON BINDING find_package(PythonLibs ${SEQUENCEPARSER_PYTHON_VERSION}) @@ -56,7 +56,7 @@ if(SWIG_FOUND) # Swig flags if(${PYTHONLIBS_VERSION_STRING} VERSION_GREATER "3") - set(CMAKE_SWIG_FLAGS ${CMAKE_SWIG_FLAGS} -py3) + set(CMAKE_SWIG_FLAGS ${COMMON_SWIG_FLAGS} -py3) endif() # Create '_sequenceparser' shared lib (python) @@ -103,7 +103,7 @@ if(SWIG_FOUND) include_directories(${JNI_INCLUDE_DIRS}) # Swig flags - set(CMAKE_SWIG_FLAGS ${CMAKE_SWIG_FLAGS} -package org.sequenceparser) + set(CMAKE_SWIG_FLAGS ${COMMON_SWIG_FLAGS} -package org.sequenceparser) # Create 'sequenceparser-java' shared lib swig_add_module(sequenceparser-java java ${SEQUENCEPARSER_BINDING_FILE}) From 4980e6a8077b385eca6bab15c4884d6b122b64c6 Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Fri, 5 Feb 2016 19:01:48 +0100 Subject: [PATCH 4/4] Up to v1.2.1 --- src/common.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.hpp b/src/common.hpp index 2440f76..9a5bcf6 100644 --- a/src/common.hpp +++ b/src/common.hpp @@ -3,7 +3,7 @@ #define SEQUENCEPARSER_VERSION_MAJOR 1 #define SEQUENCEPARSER_VERSION_MINOR 2 -#define SEQUENCEPARSER_VERSION_MICRO 0 +#define SEQUENCEPARSER_VERSION_MICRO 1 #include #include