From 6b8ab7a5a3f0ef263055cb2a4b745d1304f0b528 Mon Sep 17 00:00:00 2001 From: Stefan Seefeld Date: Fri, 9 Mar 2018 13:08:07 -0500 Subject: [PATCH 01/11] Conditionalize tests. --- test/Jamfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/Jamfile b/test/Jamfile index 7f088cf7..9a5c7569 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -50,6 +50,8 @@ rule require-windows ( properties * ) } } +if [ python.configured ] +{ test-suite python : @@ -97,12 +99,16 @@ bpl-test crossmod_exception [ bpl-test polymorphism2_auto_ptr : polymorphism2_auto_ptr.py polymorphism2.py polymorphism2_auto_ptr.cpp + : [ requires auto_ptr ] ] [ bpl-test polymorphism ] [ bpl-test polymorphism2 ] -[ bpl-test auto_ptr ] +[ bpl-test auto_ptr + : # files + : [ requires auto_ptr ] +] [ bpl-test minimal ] [ bpl-test args ] @@ -248,3 +254,4 @@ bpl-test crossmod_opaque ; +} From 61591f7ad2619e44a800f0b091143fa6eb6a55e2 Mon Sep 17 00:00:00 2001 From: Stefan Seefeld Date: Fri, 9 Mar 2018 13:17:24 -0500 Subject: [PATCH 02/11] Enable more MSVC versions. --- .appveyor.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.appveyor.yml b/.appveyor.yml index 4993cdc8..1770d871 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -33,6 +33,12 @@ environment: MSVC: "12.0" ARCH: x86_64 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + PYTHON_VERSION: "3.6.x" + PYTHON_ARCH: "64" + MSVC: "14.1" + ARCH: x86_64 + install: # If there is a newer build queued for the same PR, cancel this one. # The AppVeyor 'rollout builds' option is supposed to serve the same From 0021720a464742aec04b996e55c7f04560d6dad1 Mon Sep 17 00:00:00 2001 From: Stefan Seefeld Date: Sun, 11 Mar 2018 10:31:21 -0400 Subject: [PATCH 03/11] Conditionalize targets on Python configuration. --- build/Jamfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/Jamfile b/build/Jamfile index 98c386c7..220a9aa4 100644 --- a/build/Jamfile +++ b/build/Jamfile @@ -30,6 +30,8 @@ else ; } +if [ python.configured ] +{ project boost/python : source-location ../src ; @@ -130,3 +132,4 @@ lib boost_numpy static:BOOST_NUMPY_STATIC_LIB on:BOOST_DEBUG_PYTHON ; +} \ No newline at end of file From d515eb82c8a1e007651b1e7d75a3141fdc0c7ab3 Mon Sep 17 00:00:00 2001 From: Stefan Seefeld Date: Thu, 15 Mar 2018 15:29:06 -0400 Subject: [PATCH 04/11] Fix build warning. --- Jamfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jamfile b/Jamfile index 3a35dde0..32e87d80 100644 --- a/Jamfile +++ b/Jamfile @@ -46,7 +46,7 @@ rule version-suffix ( version ) python-id = [ option.get "python-buildid" ] ; if $(python-id) { - PYTHON_ID = [ regex.replace $(python-id) [*\\/:.\"\'] _ ] ; + PYTHON_ID = [ regex.replace $(python-id) "[*\\/:.\"\']" _ ] ; } rule python-tag ( name : type ? : property-set ) From f3df1bf91254d312db3e09d85ee5551e72c38c9d Mon Sep 17 00:00:00 2001 From: Stefan Seefeld Date: Sat, 7 Apr 2018 17:05:18 -0400 Subject: [PATCH 05/11] Remove redundant pragma once directives. --- include/boost/python/other.hpp | 8 +++----- include/boost/python/ptr.hpp | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/include/boost/python/other.hpp b/include/boost/python/other.hpp index 24a24ad8..26ebb426 100644 --- a/include/boost/python/other.hpp +++ b/include/boost/python/other.hpp @@ -1,5 +1,5 @@ -#ifndef OTHER_DWA20020601_HPP -# define OTHER_DWA20020601_HPP +#ifndef BOOST_PYTHON_OTHER_HPP +# define BOOST_PYTHON_OTHER_HPP # include // Copyright David Abrahams 2002. @@ -7,8 +7,6 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -# pragma once - # include namespace boost { namespace python { @@ -51,4 +49,4 @@ namespace detail }} // namespace boost::python -#endif // #ifndef OTHER_DWA20020601_HPP +#endif diff --git a/include/boost/python/ptr.hpp b/include/boost/python/ptr.hpp index 287daba4..8e97aa40 100644 --- a/include/boost/python/ptr.hpp +++ b/include/boost/python/ptr.hpp @@ -1,5 +1,5 @@ -#ifndef PTR_DWA20020601_HPP -# define PTR_DWA20020601_HPP +#ifndef BOOST_PYTHON_PTR_HPP +# define BOOST_PYTHON_PTR_HPP # include // Copyright David Abrahams 2002. @@ -11,8 +11,6 @@ // Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2001 Peter Dimov -# pragma once - # include # include @@ -64,4 +62,4 @@ class unwrap_pointer > }} // namespace boost::python -#endif // #ifndef PTR_DWA20020601_HPP +#endif From 19f6c782aafccba83e4486965f13c58ba3732980 Mon Sep 17 00:00:00 2001 From: Stefan Seefeld Date: Sun, 8 Apr 2018 13:07:29 -0400 Subject: [PATCH 06/11] Improve CI test coverage. --- .appveyor.yml | 25 +++++++++---------------- .travis.yml | 2 +- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 1770d871..05d2480d 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -4,7 +4,7 @@ environment: # /E:ON and /V:ON options are not enabled in the batch script intepreter # See: http://stackoverflow.com/a/13751649/163740 CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci\\run_with_env.cmd" - BOOST_PREFIX: C:\Libraries\boost_1_63_0 + BOOST_PREFIX: C:\Libraries\boost_1_66_0 matrix: @@ -18,15 +18,6 @@ environment: MSVC: "14.0" ARCH: x86 - #- PYTHON: "C:\\Python27-x64" - # PYTHON_VERSION: "2.7.x" # currently 2.7.9 - # PYTHON_ARCH: "64" - # ARCH: "x86_64" - - #- PYTHON: "C:\\Python35" - # PYTHON_VERSION: "3.5.x" # currently 3.4.3 - # PYTHON_ARCH: "32" - - PYTHON: "C:\\Python36-x64" PYTHON_VERSION: "3.6.x" PYTHON_ARCH: "64" @@ -34,9 +25,10 @@ environment: ARCH: x86_64 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + PYTHON: "C:\\Python36-x64" PYTHON_VERSION: "3.6.x" PYTHON_ARCH: "64" - MSVC: "14.1" + MSVC: "14.13.26128" ARCH: x86_64 install: @@ -53,8 +45,9 @@ install: - ps: "ls \"C:/\"" - ECHO "Installed libraries:" - ps: "ls \"C:/Libraries/\"" - - ECHO "Installed SDKs:" - - ps: "ls \"C:/Program Files/Microsoft SDKs/Windows\"" + ## This path doesn't exist with the VS 2017 worker images + #- ECHO "Installed SDKs:" + #- ps: "ls \"C:/Program Files/Microsoft SDKs/Windows\"" # Install Python (from the official .msi of http://python.org) and pip when # not already installed. @@ -78,13 +71,13 @@ install: # pip will build them from source using the MSVC compiler matching the # target Python version and architecture - | - curl -LfsS -o faber.tar.gz https://github.com/stefanseefeld/faber/archive/snapshot/2018-03-07.tar.gz + curl -LfsS -o faber.tar.gz https://github.com/stefanseefeld/faber/archive/snapshot/2018-04-08.tar.gz tar xf faber.tar.gz - CD faber-snapshot-2018-03-07 + CD faber-snapshot-2018-04-08 python setup.py install CD .. # report the available MSVC compilers - - python -m faber.tools.msvc + - faber --info=tools cxx - easy_install sphinx - pip install numpy diff --git a/.travis.yml b/.travis.yml index af460c39..04390746 100644 --- a/.travis.yml +++ b/.travis.yml @@ -81,7 +81,7 @@ install: echo "using cached Boost prerequisites." fi # Install Faber, the build tool. - date=2018-03-07 + date=2018-04-08 wget https://github.com/stefanseefeld/faber/archive/snapshot/$date.tar.gz tar xf $date.tar.gz pushd faber-snapshot-$date From 26ac881b9dfc2e26dd5f03694dd67ebefe6c1347 Mon Sep 17 00:00:00 2001 From: Stefan Seefeld Date: Sun, 8 Apr 2018 20:41:51 -0400 Subject: [PATCH 07/11] Fix CI links. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c692bb8a..e6f5d0d5 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,8 @@ See the [Boost.Python](http://boostorg.github.io/python) documentation for detai **Hint :** Check out the [development version](http://boostorg.github.io/python/develop) of the documentation to see work in progress. -# Building ![Build Status](https://travis-ci.org/boostorg/python.svg?branch=develop) +# Building [![Build Status](https://travis-ci.org/boostorg/python.svg?branch=develop)](https://travis-ci.org/boostorg/python) [![Build status](https://ci.appveyor.com/api/projects/status/cgx9xma6v3gjav92/branch/develop?svg=true)](https://ci.appveyor.com/project/stefanseefeld/python/branch/develop) + While Boost.Python is part of the Boost C++ Libraries super-project, and thus can be compiled as part of Boost, it can also be compiled and installed stand-alone, i.e. against a pre-installed Boost package. From 7352c9c0f770633e695aa8f48b647aa7a78e49c7 Mon Sep 17 00:00:00 2001 From: Gaurav Date: Tue, 3 Nov 2015 14:22:44 +0530 Subject: [PATCH 08/11] Remove not reachable condition. Line no 138-139 suggest if condition satisfy if n_actual <=max_arity : if (n_actual + f->m_nkeyword_values >= min_arity && n_actual <= max_arity) So condition at Line no 161 is not reachable. --- src/object/function.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/object/function.cpp b/src/object/function.cpp index 5c59cc77..e612963b 100644 --- a/src/object/function.cpp +++ b/src/object/function.cpp @@ -158,11 +158,6 @@ PyObject* function::call(PyObject* args, PyObject* keywords) const { // no argument preprocessing } - else if (n_actual > max_arity) - { - // too many arguments - inner_args = handle<>(); - } else { // build a new arg tuple, will adjust its size later From ac9fa536c8051774c0fec3b57189d89adcc29629 Mon Sep 17 00:00:00 2001 From: Stefan Seefeld Date: Sun, 8 Apr 2018 21:34:48 -0400 Subject: [PATCH 09/11] Add OSX to CI test matrix. --- .travis.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 04390746..8eba87ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,17 +17,19 @@ env: matrix: include: - - compiler: gcc + - os: linux env: CXX=g++ PYTHON=python CXXFLAGS=-std=c++98 - - compiler: gcc + - os: linux env: CXX=g++ PYTHON=python CXXFLAGS=-std=c++11 - - compiler: gcc + - os: linux env: CXX=g++ PYTHON=python3 CXXFLAGS=-std=c++98 - - compiler: gcc + - os: linux env: CXX=g++ PYTHON=python3 CXXFLAGS=-std=c++11 - - compiler: clang + - os: linux env: CXX=clang++ PYTHON=python3 CXXFLAGS=-std=c++98 - - compiler: clang + - os: linux + env: CXX=clang++ PYTHON=python3 CXXFLAGS=-std=c++11 + - os: osx env: CXX=clang++ PYTHON=python3 CXXFLAGS=-std=c++11 - env: PYTHON=python DOC=1 From 24313709a78c694af4ae29116cd06ea86585aa95 Mon Sep 17 00:00:00 2001 From: Stefan Seefeld Date: Thu, 12 Apr 2018 23:39:22 -0400 Subject: [PATCH 10/11] Fix auto-linking logic (Windows only). --- include/boost/python/detail/config.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/boost/python/detail/config.hpp b/include/boost/python/detail/config.hpp index acf58831..8dce9b74 100644 --- a/include/boost/python/detail/config.hpp +++ b/include/boost/python/detail/config.hpp @@ -105,7 +105,9 @@ // Set the name of our library, this will get undef'ed by auto_link.hpp // once it's done with it: // -#define BOOST_LIB_NAME boost_python##PY_MAJOR_VERSION##PY_MINOR_VERSION +#define _BOOST_PYTHON_CONCAT(N, M, m) N ## M ## m +#define BOOST_PYTHON_CONCAT(N, M, m) _BOOST_PYTHON_CONCAT(N, M, m) +#define BOOST_LIB_NAME BOOST_PYTHON_CONCAT(boost_python, PY_MAJOR_VERSION, PY_MINOR_VERSION) // // If we're importing code from a dll, then tell auto_link.hpp about it: // @@ -118,6 +120,9 @@ #include #endif // auto-linking disabled +#undef BOOST_PYTHON_CONCAT +#undef _BOOST_PYTHON_CONCAT + #ifndef BOOST_PYTHON_NO_PY_SIGNATURES #define BOOST_PYTHON_SUPPORTS_PY_SIGNATURES // enables smooth transition #endif From 77ff0d6bbc781f0f079a4c84c7d959da9c24c616 Mon Sep 17 00:00:00 2001 From: Stefan Seefeld Date: Mon, 16 Apr 2018 23:04:55 -0400 Subject: [PATCH 11/11] Fix CI OSX build failure. --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8eba87ca..5d37070b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,9 +30,10 @@ matrix: - os: linux env: CXX=clang++ PYTHON=python3 CXXFLAGS=-std=c++11 - os: osx - env: CXX=clang++ PYTHON=python3 CXXFLAGS=-std=c++11 + env: CXX=clang++ PYTHON=python CXXFLAGS=-std=c++11 - env: PYTHON=python DOC=1 - + allow_failures: + - os: osx addons: apt: @@ -66,7 +67,6 @@ install: # Install our own version of Boost (the subset we need) as the system version is # too old (for C++11 support). - | - set -e if [ ! -d $HOME/Boost/tools/boostbook ]; then echo "rebuilding Boost prerequisites." wget https://sourceforge.net/projects/boost/files/boost/1.66.0/boost_1_66_0.tar.gz/download