- 15 Nov, 2016 1 commit
-
-
Wenzel Jakob committed
-
- 13 Nov, 2016 2 commits
-
-
Jason Rhinelander committed
-
When working on some particular feature, it's nice to be able to disable all the tests except for the one I'm working on; this is currently possible by editing tests/CMakeLists.txt, and commenting out the tests you don't want. This commit goes a step further by letting you give a list of tests you do want when invoking cmake, e.g.: cmake -DPYBIND11_TEST_OVERRIDE="test_issues.cpp;test_pickling.cpp" .. changes the build to build just those two tests (and changes the `pytest` target to invoke just the two associated tests). This persists in the build directory until you disable it again by running cmake with `-DPYBIND11_TEST_OVERRIDE=`. It also adds a message after the pytest output to remind you that it is in effect: Note: not all tests run: -DPYBIND11_TEST_OVERRIDE is in effectJason Rhinelander committed
-
- 12 Nov, 2016 1 commit
-
-
Wenzel Jakob committed
-
- 11 Nov, 2016 1 commit
-
-
Jason Rhinelander committed
-
- 08 Nov, 2016 2 commits
-
-
Wenzel Jakob committed
-
Wenzel Jakob committed
-
- 07 Nov, 2016 1 commit
-
-
Wenzel Jakob committed
-
- 06 Nov, 2016 1 commit
-
-
If we need to initialize a holder around an unowned instance, and the holder type is non-copyable (i.e. a unique_ptr), we currently construct the holder type around the value pointer, but then never actually destruct the holder: the holder destructor is called only for the instance that actually has `inst->owned = true` set. This seems no pointer, however, in creating such a holder around an unowned instance: we never actually intend to use anything that the unique_ptr gives us: and, in fact, do not want the unique_ptr (because if it ever actually got destroyed, it would cause destruction of the wrapped pointer, despite the fact that that wrapped pointer isn't owned). This commit changes the logic to only create a unique_ptr holder if we actually own the instance, and to destruct via the constructed holder whenever we have a constructed holder--which will now only be the case for owned-unique-holder or shared-holder types. Other changes include: * Added test for non-movable holder constructor/destructor counts The three alive assertions now pass, before #478 they fail with counts of 2/2/1 respectively, because of the unique_ptr that we don't want and don't destroy (because we don't *want* its destructor to run). * Return cstats reference; fix ConstructStats doc Small cleanup to the #478 test code, and fix to the ConstructStats documentation (the static method definition should use `reference` not `reference_internal`). * Rename inst->constructed to inst->holder_constructed This makes it clearer exactly what it's referring to.
Jason Rhinelander committed
-
- 04 Nov, 2016 4 commits
-
-
Wenzel Jakob committed
-
There are now more places than just descr.h that make use of these. The new macro isn't quite the same: the old one only tested for a couple features, while the new one checks for the __cplusplus version (but doesn't even try to enable C++14 for MSVC/ICC). g++ 7 adds <optional>, but including it in C++14 mode isn't allowed (just as including <experimental/optional> isn't allowed in C++11 mode). (This wasn't triggered in g++-6 because it doesn't provide <optional> yet.)
Jason Rhinelander committed -
* Add debugging info about so size to build output This adds a small python script to tools that captures before-and-after .so sizes between builds and outputs this in the build output via a string such as: ------ pybind11_tests.cpython-35m-x86_64-linux-gnu.so file size: 924696 (decrease of 73680 bytes = 7.38%) ------ pybind11_tests.cpython-35m-x86_64-linux-gnu.so file size: 998376 (increase of 73680 bytes = 7.97%) ------ pybind11_tests.cpython-35m-x86_64-linux-gnu.so file size: 998376 (no change) Or, if there was no .so during the build, just the .so size by itself: ------ pybind11_tests.cpython-35m-x86_64-linux-gnu.so file size: 998376 This allows you to, for example, build, checkout a different branch, rebuild, and easily see exactly the change in the pybind11_tests.so size. It also allows looking at the travis and appveyor build logs to get an idea of .so/.dll sizes across different build systems. * Minor libsize.py script changes - Use RAII open - Remove unused libsize=-1 - Report change as [+-]xyz bytes = [+-]a.bc%
Jason Rhinelander committed -
Wenzel Jakob committed
-
- 03 Nov, 2016 10 commits
-
-
Jason Rhinelander committed
-
* Add type caster for std::experimental::optional * Add tests for std::experimental::optional * Support both <optional> / <experimental/optional> * Mention std{::experimental,}::optional in the docsIvan Smirnov committed -
Wenzel Jakob committed
-
Support for sharing dtypes across extensions + public shared data API
Wenzel Jakob committed -
(avoid code bloat if possible)
Ivan Smirnov committed -
Ivan Smirnov committed
-
NumPy internals are stored under "_numpy_internals" key.
Ivan Smirnov committed -
Ivan Smirnov committed
-
Ivan Smirnov committed
-
Overriding field names when binding structured dtypes
Wenzel Jakob committed
-
- 01 Nov, 2016 3 commits
-
-
Ivan Smirnov committed
-
PYBIND11_NUMPY_DTYPE_EX(Type, F1, "N1", F2, "N2", ...)
Ivan Smirnov committed -
* Make reference(_internal) the default return value policy for properties Before this, all `def_property*` functions used `automatic` as their default return value policy. This commit makes it so that: * Non-static properties use `reference_interal` by default, thus matching `def_readonly` and `def_readwrite`. * Static properties use `reference` by default, thus matching `def_readonly_static` and `def_readwrite_static`. In case `cpp_function` is passed to any `def_property*`, its policy will be used instead of any defaults. User-defined arguments in `extras` still have top priority and will override both the default policies and the ones from `cpp_function`. Resolves #436. * Almost always use return_value_policy::move for rvalues For functions which return rvalues or rvalue references, the only viable return value policies are `copy` and `move`. `reference(_internal)` and `take_ownership` would take the address of a temporary which is always an error. This commit prevents possible user errors by overriding the bad rvalue policies with `move`. Besides `move`, only `copy` is allowed, and only if it's explicitly selected by the user. This is also a necessary safety feature to support the new default return value policies for properties: `reference(_internal)`.
Dean Moldovan committed
-
- 27 Oct, 2016 2 commits
-
-
Wenzel Jakob committed
-
The current integer caster was unnecessarily strict and rejected various kinds of NumPy integer types when calling C++ functions expecting normal integers. This relaxes the current behavior.
Wenzel Jakob committed
-
- 25 Oct, 2016 2 commits
-
-
Prevent overwriting previous declarations
Wenzel Jakob committed -
Currently pybind11 doesn't check when you define a new object (e.g. a class, function, or exception) that overwrites an existing one. If the thing being overwritten is a class, this leads to a segfault (because pybind still thinks the type is defined, even though Python no longer has the type). In other cases this is harmless (e.g. replacing a function with an exception), but even in that case it's most likely a bug. This code doesn't prevent you from actively doing something harmful, like deliberately overwriting a previous definition, but detects overwriting with a run-time error if it occurs in the standard class/function/exception/def registration interfaces. All of the additions are in non-template code; the result is actually a tiny decrease in .so size compared to master without the new test code (977304 to 977272 bytes), and about 4K higher with the new tests.
Jason Rhinelander committed
-
- 24 Oct, 2016 3 commits
-
-
NumPy scalars to ctypes conversion support
Wenzel Jakob committed -
This reduces direct access to internals.registered_types_cpp to just a few places.
Ivan Smirnov committed -
Wenzel Jakob committed
-
- 23 Oct, 2016 1 commit
-
-
This avoid a hashmap lookup since the pointer to the list of direct converters is now cached in the typeinfo.
Ivan Smirnov committed
-
- 22 Oct, 2016 6 commits
-
-
Wenzel Jakob committed
-
Bugfix: bad delete if no copy ctor
Wenzel Jakob committed -
Ivan Smirnov committed
-
Ivan Smirnov committed
-
Ivan Smirnov committed
-
Ivan Smirnov committed
-