Skip to content

Commit

Permalink
Support py37 public GitHub (#180)
Browse files Browse the repository at this point in the history
Support packaging Python 3.7 wheels
  • Loading branch information
ezralanglois authored Jul 24, 2018
1 parent ec94166 commit f87d6ef
Show file tree
Hide file tree
Showing 12 changed files with 81 additions and 34 deletions.
19 changes: 16 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,25 @@ find_package(Git)
if(GIT_FOUND)
string(REGEX REPLACE "[^v]*(v[0-9]+.[0-9]+.[0-9]+)-.*" "\\1" TAG ${INTEROP_VERSION})
add_custom_target(history
COMMAND ${GIT_EXECUTABLE};log;${TAG}..HEAD;-m;--first-parent;--date=short;"--format='%ad | %b'"
COMMENT "List all commits from last tag - ${TAG}"
COMMAND ${GIT_EXECUTABLE} log ${TAG}..HEAD -m --first-parent --date=short --format='%ad | %s'
COMMENT "${GIT_EXECUTABLE} log ${TAG}..HEAD -m --first-parent --date=short --format=%ad | %s"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
endif()

set_target_properties(bundle PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1)

configure_file(interop/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/interop/config.h @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/interop/config.h DESTINATION include/interop)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/interop/config.h DESTINATION include/interop)


message(STATUS "Supported Languages")
message(STATUS " C++") # Version
if(PYTHON_BUILD_AVAILABLE)
message(STATUS " ${PYTHON_BUILD_AVAILABLE}")
endif()
if(CSHARP_BUILD_AVAILABLE)
message(STATUS " ${CSHARP_BUILD_AVAILABLE}")
endif()
if(JAVA_BUILD_AVAILABLE)
message(STATUS " ${JAVA_BUILD_AVAILABLE}")
endif()
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ environment:
PACKAGE_TARGET: package_wheel
ADDIONAL_CONFIG_OPTIONS: -DENABLE_APPS=OFF -DENABLE_EXAMPLES=OFF -DENABLE_CSHARP=OFF
PYTHON_PATH_DIR: C:\Miniconda36-x64
PYTHON_VERSION: 3.5
PYTHON_VERSION: 3.7
configuration: Release

matrix:
Expand Down Expand Up @@ -157,7 +157,6 @@ deploy:
configuration: Release
config_type: win64


########################################################################################################################
#
# These settings allow one to Remote Desktop into the VM and check what went wrong:
Expand Down
2 changes: 2 additions & 0 deletions cmake/InternalUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ macro(interop_config_compiler_and_linker)

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" OR CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(COMPILER_IS_GNUCC_OR_CLANG ON)
elseif(NOT WIN32 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
set(COMPILER_IS_GNUCC_OR_CLANG ON)
else()
set(COMPILER_IS_GNUCC_OR_CLANG OFF)
endif()
Expand Down
3 changes: 3 additions & 0 deletions cmake/Modules/FindCSBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ if(DOTNET_FOUND)
message(STATUS "Found .NET: ${DOTNET_EXECUTABLE_VERSION}")
set(CSHARP_INTERPRETER "")
set(CSHARP_TYPE "net${_version}")
set(CSHARP_BUILDER_VERSION ".NET ${DOTNET_EXECUTABLE_VERSION} - net${_version}")
elseif(MONO_FOUND)
message(STATUS "Found Mono: ${MONO_VERSION}")
set(CSBUILD_EXECUTABLE "${XBUILD_EXECUTABLE}")
set(CSBUILD_CSPROJ "msbuild.csproj")
set(CSBUILD_OUPUT_PREFIX "")
set(CSHARP_INTERPRETER "${MONO_EXECUTABLE}")
set(CSHARP_TYPE "net${_version}")
set(CSHARP_BUILDER_VERSION "Mono ${MONO_VERSION} - net${_version}")
elseif(DOTNET_CORE_FOUND)
message(STATUS "Found .NET Core: ${DOTNET_CORE_VERSION}")
set(CSBUILD_EXECUTABLE "${DOTNET_CORE_EXECUTABLE}")
Expand All @@ -84,6 +86,7 @@ elseif(DOTNET_CORE_FOUND)
set(CSHARP_INTERPRETER "${DOTNET_CORE_EXECUTABLE}")
set(CSBUILD_RESTORE_FLAGS "restore")
set(CSHARP_TYPE "${CSHARP_TARGET_FRAMEWORK}")
set(CSHARP_BUILDER_VERSION ".NET Standard ${DOTNET_CORE_VERSION} - ${CSHARP_TARGET_FRAMEWORK}")
else()
set(CSBUILD_FOUND FALSE)
endif()
Expand Down
3 changes: 2 additions & 1 deletion docs/src/changes.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Changes {#changes}

## v1.1.5 (Master)
## v1.1.5

Date | Description
---------- | -----------
2018-07-22 | Add Python 3.7 support
2018-06-28 | Future proof throw specification
2018-06-27 | Fix bug in example example_populate_qmetricset.pp
2018-05-07 | Fix C++ Linking bug with inconsistent macros
Expand Down
4 changes: 3 additions & 1 deletion src/ext/csharp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,6 @@ if(NUGET_EXE)

else()
message(STATUS "NuGet not found, nupack target will not be available")
endif()
endif()

set(CSHARP_BUILD_AVAILABLE ${CSHARP_BUILDER_VERSION} CACHE INTERNAL "All dependencies are satisfied for the C# Build" FORCE)
5 changes: 4 additions & 1 deletion src/ext/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ endif()

if(NOT PYTHON_WHEEL_PREFIX)
set(PYTHON_WHEEL_PREFIX "${PACKAGE_OUTPUT_FILE_PREFIX}")
else()
get_filename_component(PYTHON_WHEEL_PREFIX ${PYTHON_WHEEL_PREFIX} ABSOLUTE)
endif()
add_custom_target(package_wheel
COMMENT "Creating Python wheel package in ${PYTHON_WHEEL_PREFIX}"
Expand All @@ -164,4 +166,5 @@ if(NOT SKIP_PACKAGE_ALL_WHEEL)
add_dependencies(bundle package_wheel)
endif()

set(PYTHON_TARGET_FOUND ON CACHE INTERNAL "Python target is available" FORCE)

set(PYTHON_BUILD_AVAILABLE "Python ${PYTHON_VERSION_STRING}" CACHE INTERNAL "All dependencies are satisfied for the Java Build" FORCE)
2 changes: 1 addition & 1 deletion src/tests/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if(swig_major_ver LESS "3")
endif()

find_package(PythonInterp)
if(NOT PYTHON_TARGET_FOUND)
if(NOT PYTHON_BUILD_AVAILABLE)
return()
endif()

Expand Down
2 changes: 1 addition & 1 deletion tools/docker/DockerFile_Centos5
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# docker build --rm -t ezralanglois/interop -f ./tools/DockerFile tools
# sudo docker build --rm -t docker-bioinformatics.dockerhub.illumina.com/interop_centos5 -f ./tools/docker/DockerFile_Centos6 tools

FROM quay.io/pypa/manylinux1_x86_64

Expand Down
18 changes: 15 additions & 3 deletions tools/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ elif [ ! -z $SOURCE_PATH ]; then
ARTIFACT_PATH=$SOURCE_PATH/dist
fi

# ARTIFACT_PATH="$(echo $(cd $(dirname "$ARTIFACT_PATH") && pwd -P)/$(basename "$ARTIFACT_PATH"))"

if hash greadlink 2> /dev/null; then
readlink="greadlink"
else
readlink="readlink"
fi
ARTIFACT_PATH=`$readlink -f $ARTIFACT_PATH`

if [ ! -z $3 ] ; then
BUILD_SERVER=$3
DISABLE_SUBDIR=OFF
Expand Down Expand Up @@ -105,6 +114,8 @@ else
mkdir $ARTIFACT_PATH
fi



if [ "$PYTHON_VERSION" == "None" ] ; then
PYTHON_VERSION=
fi
Expand Down Expand Up @@ -132,7 +143,7 @@ fi

if [ "$PYTHON_VERSION" != "" ] ; then
if [ "$PYTHON_VERSION" == "ALL" ] ; then
python_versions="2.7.11 3.4.4 3.5.1 3.6.0"
python_versions="2.7.11 3.4.4 3.5.1 3.6.0 3.7.0"
else
python_versions="$PYTHON_VERSION"
fi
Expand All @@ -158,14 +169,15 @@ if [ "$PYTHON_VERSION" != "" ] ; then
pip install numpy
pip install wheel
fi
run "Configure $py_ver" cmake $SOURCE_PATH -B${BUILD_PATH} ${CMAKE_EXTRA_FLAGS} -DENABLE_PYTHON_DYNAMIC_LOAD=ON -DPYTHON_EXECUTABLE=`which python` -DPYTHON_WHEEL_PREFIX=${ARTIFACT_PATH}/tmp
run "Configure $py_ver" cmake $SOURCE_PATH -B${BUILD_PATH} ${CMAKE_EXTRA_FLAGS} -DENABLE_PYTHON_DYNAMIC_LOAD=ON -DPYTHON_EXECUTABLE=`which python` -DSKIP_PACKAGE_ALL_WHEEL=ON -DPYTHON_WHEEL_PREFIX=${ARTIFACT_PATH}/tmp
run "Build $py_ver" cmake --build $BUILD_PATH -- -j${THREAD_COUNT}
run "Test $py_ver" cmake --build $BUILD_PATH --target check_python -- -j${THREAD_COUNT}
run "Build Wheel $py_ver" cmake --build $BUILD_PATH --target package_wheel -- -j${THREAD_COUNT}

if hash delocate-wheel 2> /dev/null; then
ls ${ARTIFACT_PATH}/tmp/*.whl
delocate-listdeps ${ARTIFACT_PATH}/tmp/*.whl
delocate-wheel $ARTIFACT_PATH/tmp/*.whl
delocate-wheel ${ARTIFACT_PATH}/tmp/*.whl
delocate-addplat -c --rm-orig -x 10_9 -x 10_10 $ARTIFACT_PATH/tmp/*.whl -w $ARTIFACT_PATH
elif hash auditwheel 2> /dev/null; then
auditwheel --version
Expand Down
6 changes: 3 additions & 3 deletions tools/package_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ fi
sudo systemctl status docker || sudo systemctl start docker || true

docker ps 1>/dev/null 2>&1 || prefix=sudo;
#${prefix} docker rmi $(docker images --filter "dangling=true") >/dev/null 2>&1 || true
${prefix} docker rmi $(docker images) >/dev/null 2>&1 || true
${prefix} docker rm $(docker ps -a) >/dev/null 2>&1 || true
#${prefix} docker rmi $(${prefix} docker images --filter "dangling=true") >/dev/null 2>&1 || true
${prefix} docker rmi $(${prefix} docker images) >/dev/null 2>&1 || true
${prefix} docker system prune -f >/dev/null 2>&1 || true
${prefix} docker pull $image
${prefix} docker run --rm -w /tmp --user `id -u`:`id -g` -v `pwd`:/src:ro -v `pwd`/dist:/dist:rw $image sh /src/tools/package.sh /src /dist teamcity OFF Release $pyver $build_number "$extra"
48 changes: 30 additions & 18 deletions tools/prereqs/docker-centos5-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ NUNIT_HOME=${PROG_HOME}/nunit
if hash cmake 2> /dev/null; then
echo "Found CMake"
else
echo "Installing CMake"
wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C /usr


Expand All @@ -56,9 +57,31 @@ else
"/opt/python/cp36-cp36m/bin/pip" install auditwheel==1.5.0
fi


if [ -e /usr/include/gtest/gtest.h ]; then
echo "Found GTest and GMock"
else
echo "Installing GTest and GMock"
mkdir /gtest
curl -L ${GOOGLETEST_URL} -o release-1.8.0.tar.gz

tar --strip-components=1 -xzf release-1.8.0.tar.gz -C /gtest
#curl ${GOOGLETEST_URL} | tar --strip-components=1 -xz -C /gtest
mkdir /gtest/build
cmake -H/gtest -B/gtest/build
cmake --build /gtest/build -- -j4
cp -r /gtest/googletest/include/gtest /usr/include/
cp -r /gtest/googlemock/include/gmock /usr/include/
cp /gtest/build/googlemock/gtest/lib*.a /usr/lib/
cp /gtest/build/googlemock/lib*.a /usr/lib/

rm -fr /gtest release-1.8.0.tar.gz
fi

if hash swig 2> /dev/null; then
echo "Found Swig"
echo "Found SWIG"
else
echo "Installing SWIG"
if [ ! -e ${SWIG_HOME} ]; then
mkdir ${SWIG_HOME}
fi
Expand All @@ -82,6 +105,7 @@ fi
if hash mono 2> /dev/null; then
echo "Found mono"
else
echo "Installing Mono"
PATH_OLD=$PATH
export PATH=/opt/python/cp27-cp27mu/bin/:$PATH
yum install automake autoconf libtool -y
Expand Down Expand Up @@ -123,33 +147,19 @@ else
nuget help
fi

if [ -e /usr/include/gtest/gtest.h ]; then
echo "Found GTest and GMock"
else
mkdir /gtest
wget --no-check-certificate --quiet -O - ${GOOGLETEST_URL} | tar --strip-components=1 -xz -C /gtest
mkdir /gtest/build
cmake -H/gtest -B/gtest/build
cmake --build /gtest/build -- -j4
cp -r /gtest/googletest/include/gtest /usr/include/
cp -r /gtest/googlemock/include/gmock /usr/include/
cp /gtest/build/googlemock/gtest/lib*.a /usr/lib/
cp /gtest/build/googlemock/lib*.a /usr/lib/

rm -fr /gtest
fi

if hash java 2> /dev/null; then
echo "Found Java"
else
echo "Installing Java"
wget --quiet --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "${JAVA_URL}" -O ${JAVA_URL##*/}
rpm -Uvh ${JAVA_URL##*/}
rm -f ${JAVA_URL##*/}
fi

if [ ! -e ${NUNIT_HOME}/NUnit-2.6.4 ]; then
echo "Installing NUnit"
mkdir ${NUNIT_HOME}
wget --no-check-certificate --quiet ${NUNIT_URL} -O ${NUNIT_HOME}/${NUNIT_URL##*/}
curl -L ${NUNIT_URL} -o ${NUNIT_HOME}/${NUNIT_URL##*/}
unzip ${NUNIT_HOME}/${NUNIT_URL##*/} -d ${NUNIT_HOME}
rm -f ${NUNIT_HOME}/${JUNIT_URL##*/}
else
Expand All @@ -158,12 +168,14 @@ fi
NUNIT_HOME=${NUNIT_HOME}/NUnit-2.6.4

if [ ! -e ${JUNIT_HOME}/${JUNIT_URL##*/} ]; then
echo "Installing JUnit"
mkdir ${JUNIT_HOME}
wget --no-check-certificate --quiet ${JUNIT_URL} -O ${JUNIT_HOME}/${JUNIT_URL##*/}
else
echo "Found JUnit at ${JUNIT_HOME}/${JUNIT_URL##*/}"
fi

echo "Installing Valgrind"
mkdir tmp_build
wget --no-check-certificate --quiet -O - ${VALGRIND_URL} | tar --strip-components=1 -xj -C ./tmp_build
cd tmp_build
Expand Down

0 comments on commit f87d6ef

Please sign in to comment.