1. 13 Apr, 2017 2 commits
    • Jason Rhinelander's avatar
      Move buffer_info to its own header · dbb4c5b5
      Jason Rhinelander authored
      Upcoming changes to buffer_info make it need some things declared in
      common.h; it also feels a bit misplaced in common.h (which is arguably
      too large already), so move it out.  (Separating this and the subsequent
      changes into separate commits to make the changes easier to distinguish
      from the move.)
      dbb4c5b5
    • Jason Rhinelander's avatar
      array: set exception message on failure · 5749b502
      Jason Rhinelander authored
      When attempting to get a raw array pointer we return nullptr if given a
      nullptr, which triggers an error_already_set(), but we haven't set an
      exception message, which results in "Unknown internal error".
      
      Callers that want explicit allowing of a nullptr here already handle it
      (by clearing the exception after the call).
      5749b502
  2. 12 Apr, 2017 1 commit
    • Wenzel Jakob's avatar
      improve mkdoc.py determinism · 257df10f
      Wenzel Jakob authored
      When processing many files that contain top-level items with the same
      name (e.g. "operator<<"), the output was non-deterministic and depended
      on the order in which the different Clang processes finished. This
      commit adds sorting that also accounts for the filename to prevent
      random changes from run to run.
      257df10f
  3. 11 Apr, 2017 1 commit
  4. 10 Apr, 2017 1 commit
  5. 09 Apr, 2017 2 commits
    • Jason Rhinelander's avatar
      Appveyor: Remove /m to attempt to resolve build failures · 4c72ec22
      Jason Rhinelander authored
      /m also doesn't seem to have made the builds any faster.
      4c72ec22
    • Jason Rhinelander's avatar
      Fix Eigen argument doc strings · e9e17746
      Jason Rhinelander authored
      Many of the Eigen type casters' name() methods weren't wrapping the type
      description in a `type_descr` object, which thus wasn't adding the
      "{...}" annotation used to identify an argument which broke the help
      output by skipping eigen arguments.
      
      The test code I had added even had some (unnoticed) broken output (with
      the "arg0: " showing up in the return value).
      
      This commit also adds test code to ensure that named eigen arguments
      actually work properly, despite the invalid help output.  (The added
      tests pass without the rest of this commit).
      e9e17746
  6. 08 Apr, 2017 2 commits
    • Jason Rhinelander's avatar
      Add static_assert to holder casters · 501135fa
      Jason Rhinelander authored
      The holder casters assume but don't check that a `holder<type>`'s `type`
      is really a `type_caster_base<type>`; this adds a static_assert to make
      sure this is really the case, to turn things like
      `std::shared_ptr<array>` into a compilation failure.
      
      Fixes #785
      501135fa
    • Jason Rhinelander's avatar
      Remove gcc 6/7 LTO and -Werror workarounds · d994db2d
      Jason Rhinelander authored
      The gcc versions in Debian stretch (gcc 6) and experimental (gcc 7)
      incorporate the upstream gcc fixes.
      d994db2d
  7. 07 Apr, 2017 2 commits
  8. 06 Apr, 2017 3 commits
    • Jason Rhinelander's avatar
      Remove object::borrowed/stolen · 16c86638
      Jason Rhinelander authored
      PR #771 deprecated them as they can cause linking failures (#770), but
      the deprecation tags cause warnings on GCC 5.x through 6.2.x.  Removing
      them entirely will break backwards-compatibility consequences, but the
      effects should be minimal (only code that was inheriting from `object`
      could get at them at all as they are protected).
      
      Fixes #777
      16c86638
    • Dean Moldovan's avatar
      Fix test_cmake_build failure with bare python exe name (fix #783) · 555dc4f0
      Dean Moldovan authored
      Besides appearing in the CMake GUI, the `:FILENAME` specifier changes
      behavior as well:
      
      cmake -DPYTHON_EXECUTABLE=python ..  # FAIL, can't find python
      cmake -DPYTHON_EXECUTABLE=/path/to/python ..  # OK
      cmake -DPYTHON_EXECUTABLE:FILENAME=python ..  # OK
      cmake -DPYTHON_EXECUTABLE:FILENAME=/path/to/python ..  # OK
      555dc4f0
    • Jason Rhinelander's avatar
      Skip VS2015/x86 builds · 087b8d84
      Jason Rhinelander authored
      AppVeyor just added support for excluding specific jobs; thhis commit
      cuts the number of builds down to 6 from 8 by eliminating the VS2015 x86
      builds.
      087b8d84
  9. 05 Apr, 2017 3 commits
    • Ivan Smirnov's avatar
      Fix -Wmissing-braces warning · 7348c407
      Ivan Smirnov authored
      7348c407
    • Jason Rhinelander's avatar
      Improve make_tuple error message under debugging · 6906b270
      Jason Rhinelander authored
      When make_tuple fails (for example, when print() is called with a
      non-convertible argument, as in #778) the error message a less helpful
      than it could be:
      
          make_tuple(): unable to convert arguments of types 'std::tuple<type1, type2>' to Python object
      
      There is no actual std::tuple involved (only a parameter pack and a
      Python tuple), but it also doesn't immediately reveal which type caused
      the problem.
      
      This commit changes the debugging mode output to show just the
      problematic type:
      
          make_tuple(): unable to convert argument of type 'type2' to Python object
      6906b270
    • Wenzel Jakob's avatar
      AppVeyor: use parallel builds · 8f010cce
      Wenzel Jakob authored
      My group now has a subscription to AppVeyor pro, which also permits
      running parallel builds on the open source projects.
      8f010cce
  10. 02 Apr, 2017 3 commits
  11. 01 Apr, 2017 1 commit
  12. 30 Mar, 2017 2 commits
  13. 28 Mar, 2017 2 commits
    • Dean Moldovan's avatar
      Support raw string literals as input for py::eval (#766) · 194d8b99
      Dean Moldovan authored
      * Support raw string literals as input for py::eval
      * Dedent only when needed
      194d8b99
    • Jason Rhinelander's avatar
      Deprecated borrowed/stolen for borrowed_t{}/stolen_t{} (#771) · 6db60cd9
      Jason Rhinelander authored
      The constexpr static instances can cause linking failures if the
      compiler doesn't optimize away the reference, as reported in #770.
      
      There's no particularly nice way of fixing this in C++11/14: we can't
      inline definitions to match the declaration aren't permitted for
      non-templated static variables (C++17 *does* allows "inline" on
      variables, but that obviously doesn't help us.)
      
      One solution that could work around it is to add an extra inherited
      subclass to `object`'s hierarchy, but that's a bit of a messy solution
      and was decided against in #771 in favour of just deprecating (and
      eventually dropping) the constexpr statics.
      
      Fixes #770.
      6db60cd9
  14. 26 Mar, 2017 1 commit
  15. 24 Mar, 2017 1 commit
    • Ghislain Antony Vaillant's avatar
      Arch-indep CMake packaging (#764) · 5b503764
      Ghislain Antony Vaillant authored
      * Arch-indep CMake packaging
      
      Since pybind11 is a header-only library, the CMake packaging does not have to carry any architecture specific checks. Without this patch, the detection of pybind11 will fail on 32-bit architectures if the project was built on a 64-bit machine and vice-versa. This fix is similar to what is applied to `Eigen` and other header-only C++ libraries.
      5b503764
  16. 22 Mar, 2017 10 commits
  17. 21 Mar, 2017 3 commits
    • Jason Rhinelander's avatar
      vectorize: trivial handling for F-order arrays · b0292c1d
      Jason Rhinelander authored
      This extends the trivial handling to support trivial handling for
      Fortran-order arrays (i.e. column major): if inputs aren't all
      C-contiguous, but *are* all F-contiguous, the resulting array will be
      F-contiguous and we can do trivial processing.
      
      For anything else (e.g. C-contiguous, or inputs requiring non-trivial
      processing), the result is in (numpy-default) C-contiguous layout.
      b0292c1d
    • Jason Rhinelander's avatar
      Stop forcing c-contiguous in py::vectorize · ae5a8f7e
      Jason Rhinelander authored
      The only part of the vectorize code that actually needs c-contiguous is
      the "trivial" broadcast; for non-trivial arguments, the code already
      uses strides properly (and so handles C-style, F-style, neither, slices,
      etc.)
      
      This commit rewrites `broadcast` to additionally check for C-contiguous
      storage, then takes off the `c_style` flag for the arguments, which
      will keep the functionality more or less the same, except for no longer
      requiring an array copy for non-c-contiguous input arrays.
      
      Additionally, if we're given a singleton slice (e.g. a[0::4, 0::4] for a
      4x4 or smaller array), we no longer fail triviality because the trivial
      code path never actually uses the strides on a singleton.
      ae5a8f7e
    • Dean Moldovan's avatar
      Throw an exception when attempting to load an incompatible holder · cd3d1fc7
      Dean Moldovan authored
      Instead of a segfault. Fixes #751.
      
      This covers the case of loading a custom holder from a default-holder
      instance. Attempting to load one custom holder from a different custom
      holder (i.e. not `std::unique_ptr`) yields undefined behavior, just as
      #588 established for inheritance.
      cd3d1fc7