- 19 Aug, 2020 2 commits
-
-
Henry Schreiner authored
* tests: keep source dir clean * ci: make first build inplace * ci: drop dev setting (wasn't doing anything) * tests: warn if source directory is dirty
-
Henry Schreiner authored
* feat: FindPython support * refactor: rename to PYBIND11_FINDPYTHON * docs: Caps fixes * feat: NOPYTHON mode * test: check simple call * docs: add changelog/upgrade guide * feat: Support Python3 and Python2 * refactor: Use targets in tests * fix: support CMake 3.4+ * feat: classic search also finds virtual environments * docs: some updates from @wjakob's review * fix: wrong name for QUIET mode variable, reported by @skoslowski * refactor: cleaner output messaging * fix: support debug Python's in FindPython mode too * fixup! refactor: cleaner output messaging * fix: missing pybind11_FOUND and pybind11_INCLUDE_DIR restored to subdir mode * fix: nicer reporting of Python / PyPy * fix: out-of-order variable fix * docs: minor last-minute cleanup
-
- 18 Aug, 2020 1 commit
-
-
Paul Fultz II authored
-
- 06 Aug, 2020 1 commit
-
-
Henry Schreiner authored
-
- 01 Aug, 2020 1 commit
-
-
Henry Schreiner authored
Added a check on CMake 3.12+ to make sure the file listing is up to date. And caught a missing file with it!
-
- 31 Jul, 2020 6 commits
-
-
Henry Schreiner authored
-
acxz authored
* add uninstall target for cmake * only add target when built as master project Co-authored-by:
Henry Schreiner <HenrySchreinerIII@gmail.com> Co-authored-by:
Henry Schreiner <HenrySchreinerIII@gmail.com>
-
Henry Schreiner authored
-
Henry Schreiner authored
-
Henry Schreiner authored
-
Henry Schreiner authored
fix: include PYTHON_IS_DEBUG
-
- 24 Jun, 2018 1 commit
-
-
Axel Huebl authored
It is useful not only to remember the python libs and includes but also the interpreter version in cache. If users call pybind11 throught `add_subdirectories` they will otherwise have no access to the selected interpreter version. The interpreter version is useful for downstream projects, e.g. to select default `lib/pythonX.Y/site-packages/` install paths.
-
- 06 Sep, 2017 1 commit
-
-
Dean Moldovan authored
-
- 30 Aug, 2017 1 commit
-
-
Florian Apolloner authored
-
- 23 Aug, 2017 1 commit
-
-
Dean Moldovan authored
-
- 17 Aug, 2017 3 commits
-
-
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. -
Jason Rhinelander authored
Embedding may well be used in places where hidden visibility isn't desired. It should be relatively safe to allow it there; any potential conflict would come in if modules are loaded into that embedded interpreter, but as long as the modules are compiled with hidden visibility they shouldn't conflict. There could still be warnings if the embedded code attempts to export classes with internal (hidden) pybind members, but that seems a legitimate warning (and already has a FAQ entry).
-
Dean Moldovan authored
-
- 14 Aug, 2017 1 commit
-
-
Jason Rhinelander authored
This updates the compilation to always apply hidden visibility to resolve the issues with default visibility causing problems under debug compilations. Moreover using the cmake property makes it easier for a caller to override if absolutely needed for some reason. For `pybind11_add_module` we use cmake to set the property; for the targets, we append to compilation option to non-MSVC compilers.
-
- 07 Aug, 2017 2 commits
-
-
Dean Moldovan authored
-
Ben Boeckel authored
When Pybind11 is used via `add_subdirectory`, when targets are installed from the parent project, CMake wants all of the dependencies built by the project in the same export set. Projects may now set `PYBIND11_EXPORT_NAME` to have Pybind11 put it targets into the project's export set. If so, do not install Pybind11's export file.
-
- 28 May, 2017 2 commits
-
-
Dean Moldovan authored
-
Dean Moldovan authored
All targets provided by pybind11: * pybind11::module - the existing target for creating extension modules * pybind11::embed - new target for embedding the interpreter * pybind11::pybind11 - common "base" target (headers only)
-
- 07 May, 2017 1 commit
-
-
Jason Rhinelander authored
-
- 13 Apr, 2017 1 commit
-
-
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.)
-
- 24 Mar, 2017 1 commit
-
-
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.
-
- 24 Feb, 2017 1 commit
-
-
Jason Rhinelander authored
* Make tests buildable independently This makes "tests" buildable as a separate project that uses find_package(pybind11 CONFIG) when invoked independently. This also moves the WERROR option into tests/CMakeLists.txt, as that's the only place it is used. * Use Eigen 3.3.1's cmake target, if available This changes the eigen finding code to attempt to use Eigen's system-installed Eigen3Config first. In Eigen 3.3.1, it exports a cmake Eigen3::Eigen target to get dependencies from (rather than setting the include path directly). If it fails, we fall back to the trying to load allowing modules (i.e. allowing our tools/FindEigen3.cmake). If we either fallback, or the eigen version is older than 3.3.1 (or , we still set the include directory manually; otherwise, for CONFIG + new Eigen, we get it via the target. This is also needed to allow 'tests' to be built independently, when the find_package(Eigen3) is going to find via the system-installed Eigen3Config.cmake. * Add a install-then-build test, using clang on linux This tests that `make install` to the actual system, followed by a build of the tests (without the main pybind11 repository available) works as expected. To also expand the testing variety a bit, it also builds using clang-3.9 instead of gcc. * Don't try loading Eigen3Config in cmake < 3.0 It could FATAL_ERROR as the newer cmake includes a cmake 3.0 required line. If doing an independent, out-of-tree "tests" build, the regular find_package(Eigen3) is likely to fail with the same error, but I think we can just let that be: if you want a recent Eigen with proper cmake loading support *and* want to do an independent tests build, you'll need at least cmake 3.0.
-
- 23 Feb, 2017 1 commit
-
-
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.
-
- 14 Feb, 2017 1 commit
-
-
Sylvain Corlay authored
* Add flag for installation of headers under python include directory * Allow the disabling of distutils install_headers
-
- 08 Feb, 2017 1 commit
-
-
Matthew Woehlke authored
* Avoid C-style const casts Replace C-style casts that discard `const` with `const_cast` (and, where necessary, `reinterpret_cast` as well). * Warn about C-style const-discarding casts Change pybind11_enable_warnings to also enable `-Wcast-qual` (warn if a C-style cast discards `const`) by default. The previous commit should have gotten rid of all of these (at least, all the ones that tripped in my build, which included the tests), and this should discourage more from newly appearing.
-
- 26 Dec, 2016 1 commit
-
-
Jason Rhinelander authored
Fixes #567. If pybind's CMakeLists gets loaded via an include_directory from another CMakeLists with a higher minimum version (e.g. 3.0), the project() command without a version produces a CMP0048 warning. This commit explicitly requests the new behaviour if the policy exists, as it won't cause problems (we set VERSION later).
-
- 19 Dec, 2016 2 commits
-
-
Dean Moldovan authored
Makes room for an eventual pybind11::embedded target.
-
Dean Moldovan authored
Add a BUILD_INTERFACE and a pybind11::pybind11 alias for the interface library to match the installed target. Add new cmake tests for add_subdirectory and consolidates the .cpp and .py files needed for the cmake build tests: Before: tests |-- test_installed_module | |-- CMakeLists.txt | |-- main.cpp | \-- test.py \-- test_installed_target |-- CMakeLists.txt |-- main.cpp \-- test.py After: tests \-- test_cmake_build |-- installed_module/CMakeLists.txt |-- installed_target/CMakeLists.txt |-- subdirectory_module/CMakeLists.txt |-- subdirectory_target/CMakeLists.txt |-- main.cpp \-- test.py
-
- 13 Dec, 2016 3 commits
-
-
Lori A. Burns authored
-
Lori A. Burns authored
-
Lori A. Burns authored
-
- 15 Nov, 2016 1 commit
-
-
Alexander Stukowski authored
Added the docstring_options class, which gives global control over the generation of docstrings and function signatures.
-
- 09 Oct, 2016 2 commits
-
-
Wenzel Jakob authored
-
Wenzel Jakob authored
-
- 29 Sep, 2016 1 commit
-
-
Wenzel Jakob authored
-