1. 28 Nov, 2019 1 commit
  2. 21 Jun, 2018 1 commit
  3. 23 Dec, 2017 1 commit
  4. 06 Sep, 2017 1 commit
  5. 25 Aug, 2017 1 commit
  6. 24 Aug, 2017 1 commit
    • Dean Moldovan's avatar
      Fix setup.py detail headers and add pip install tests to Travis · 1913f252
      Dean Moldovan authored
      The default `install_headers` from `distutils` flattens all the headers
      into a single directory -- `detail` subdirectory was lost. This commit
      fixes this by overriding the setup with a custom header installer.
      
      Tests are added to Travis to make sure `setup.py sdist` and `pip install`
      do not miss any headers and that the directory structure is preserved.
      
      [skip appveyor]
      1913f252
  7. 23 Aug, 2017 1 commit
  8. 17 Aug, 2017 2 commits
    • Jason Rhinelander's avatar
      Allow binding factory functions as constructors · 464d9896
      Jason Rhinelander authored
      This allows you to use:
      
          cls.def(py::init(&factory_function));
      
      where `factory_function` returns a pointer, holder, or value of the
      class type (or a derived type).  Various compile-time checks
      (static_asserts) are performed to ensure the function is valid, and
      various run-time type checks where necessary.
      
      Some other details of this feature:
      - The `py::init` name doesn't conflict with the templated no-argument
        `py::init<...>()`, but keeps the naming consistent: the existing
        templated, no-argument one wraps constructors, the no-template,
        function-argument one wraps factory functions.
      - If returning a CppClass (whether by value or pointer) when an CppAlias
        is required (i.e. python-side inheritance and a declared alias), a
        dynamic_cast to the alias is attempted (for the pointer version); if
        it fails, or if returned by value, an Alias(Class &&) constructor
        is invoked.  If this constructor doesn't exist, a runtime error occurs.
      - for holder returns when an alias is required, we try a dynamic_cast of
        the wrapped pointer to the alias to see if it is already an alias
        instance; if it isn't, we raise an error.
      - `py::init(class_factory, alias_factory)` is also available that takes
        two factories: the first is called when an alias is not needed, the
        second when it is.
      - Reimplement factory instance clearing.  The previous implementation
        failed under python-side multiple inheritance: *each* inherited
        type's factory init would clear the instance instead of only setting
        its own type value.  The new implementation here clears just the
        relevant value pointer.
      - dealloc is updated to explicitly set the leftover value pointer to
        nullptr and the `holder_constructed` flag to false so that it can be
        used to clear preallocated value without needing to rebuild the
        instance internals data.
      - Added various tests to test out new allocation/deallocation code.
      - With preallocation now done lazily, init factory holders can
        completely avoid the extra overhead of needing an extra
        allocation/deallocation.
      - Updated documentation to make factory constructors the default
        advanced constructor style.
      - If an `__init__` is called a second time, we have two choices: we can
        throw away the first instance, replacing it with the second; or we can
        ignore the second call.  The latter is slightly easier, so do that.
      464d9896
    • Dean Moldovan's avatar
      f5806498
  9. 28 May, 2017 1 commit
  10. 07 May, 2017 1 commit
  11. 23 Feb, 2017 1 commit
    • Dean Moldovan's avatar
      Reimplement static properties by extending PyProperty_Type · c91f8bd6
      Dean Moldovan authored
      Instead of creating a new unique metaclass for each type, the builtin
      `property` type is subclassed to support static properties. The new
      setter/getters always pass types instead of instances in their `self`
      argument. A metaclass is still required to support this behavior, but
      it doesn't store any data anymore, so a new one doesn't need to be
      created for each class. There is now only one common metaclass which
      is shared by all pybind11 types.
      c91f8bd6
  12. 14 Feb, 2017 1 commit
  13. 04 Jan, 2017 1 commit
  14. 01 Jan, 2017 1 commit
  15. 01 Dec, 2016 1 commit
  16. 19 Aug, 2016 1 commit
    • Dean Moldovan's avatar
      Port tests to pytest · a0c1ccf0
      Dean Moldovan authored
      Use simple asserts and pytest's powerful introspection to make testing
      simpler. This merges the old .py/.ref file pairs into simple .py files
      where the expected values are right next to the code being tested.
      
      This commit does not touch the C++ part of the code and replicates the
      Python tests exactly like the old .ref-file-based approach.
      a0c1ccf0
  17. 16 May, 2016 1 commit
  18. 05 May, 2016 1 commit
  19. 18 Apr, 2016 1 commit
  20. 08 Mar, 2016 1 commit
  21. 01 Mar, 2016 1 commit
  22. 22 Feb, 2016 1 commit
  23. 20 Feb, 2016 2 commits
  24. 07 Feb, 2016 1 commit
  25. 01 Feb, 2016 1 commit
  26. 17 Jan, 2016 2 commits
  27. 04 Dec, 2015 2 commits
  28. 15 Oct, 2015 2 commits