Commit Graph

3404 Commits

Author SHA1 Message Date
Dan
4612db54ac Try to autodetect the location of the clang standard libraries.
On some linuxes, /usr/include belongs to GCC and the standard
libraries that work with clang are in /usr/lib/clang/8.0.0 or
some variation thereof.

This results in errors such as:

```
/../lib64/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/bits/cxxabi_init_exception.h:38:10: fatal error: 'stddef.h' file not found

```

during extraction.
2019-06-11 13:49:37 +02:00
Dan
a175b21e4b Avoid decoding already-decoded strings from cindex.
Recent versions of clang.cindex include [code][1] that converts
the internal byte strings to python str for you.

  [1]: https://github.com/llvm-mirror/clang/blob/master/bindings/python/clang/cindex.py#L72
2019-06-11 13:49:37 +02:00
Yannick Jadoul
d23c821b20 Make static member functions, added with def_static, staticmethod descriptor instances (#1732) 2019-06-11 10:59:57 +02:00
Roland Dreier
7a24bcf1f6 Fix malformed reST (#1802)
Commit 2b045757b5 ("Improve documentation related to inheritance. (#1676)") left off
a ':' from a hyperlink, which breaks the Travis CI build.
2019-06-11 10:57:49 +02:00
Axel Huebl
a2cdd0b915 dict_readonly: member init (#1661)
fix missing member initialization in pytypes: read-only dict.

Found with coverity in a downstream project.
2019-06-10 22:19:41 +02:00
Axel Huebl
1c627c9ec0 pybind11_getbuffer: useless safe nullptr check (#1664)
Alternative implementation for #1657: if
we know that `obj` is never a `nullptr` [1], we should
not `nullptr`-check it *after* already dereferencing it.

[1] https://github.com/pybind/pybind11/pull/1657#issuecomment-452090058
2019-06-10 22:18:11 +02:00
Jeffrey Quesnelle
f93cd0aa72 PYBIND11_TLS_REPLACE_VALUE should use macro argument value in Python 3.7+ (#1683) 2019-06-10 22:13:35 +02:00
Ivor Wanders
2b045757b5 Improve documentation related to inheritance. (#1676)
* Adds section to the reference.
* Adds section to advanced classes page describing how to use `get_overload`.
2019-06-10 22:12:28 +02:00
Manuel Schneider
492da592c2 another typo (#1675) 2019-06-10 22:05:12 +02:00
Axel Huebl
9424d5d277 type_record: Uninit Member (#1658)
Fix an uninitialized member in `type_record`.

Found with coverity in a downstream project.
2019-06-10 22:02:40 +02:00
Jörg Kreuzberger
69dc380c0d #1208 Handle forced unwind exception (e.g. during pthread termination)
* #1208 Bugfix thread kill wihile running pybind11 module

* #1208 Bugfix missing space after catch
2019-06-10 22:00:55 +02:00
Darius Arnold
09330b94ea Fix typos in documentation (#1635)
* Always capitalize Eigen

* Fix spelling
2019-06-10 21:57:00 +02:00
luzpaz
21bf16f5b8 misc. comment typo (#1629) 2019-06-10 21:56:38 +02:00
Omar Awile
ac6cb91a34 Fixed small typo (#1633)
I think this particular method binding should not be done with `PYBIND11_OVERLOAD_PURE` but instead `PYBIND11_OVERLOAD`.
2019-06-10 21:56:17 +02:00
Steven Johnson
4ddf7c402d Add missing includes for better Bazel compatibility (#1255)
Bazel has a "strict" build model that requires all C++ header files be compilable on their own, and thus must explicitly #include all headers they require (even if de facto header inclusion order means they'd get them "for free"). This adds a couple of headers that are needed (but missing) by this model.
2019-06-10 21:54:56 +02:00
Sergei Izmailov
979d75de23 doc: Add note about casting from None to T* (#1760)
* doc: Add note about casting from `None` to `T*`

* doc: reword 'none-to-pointer' note message

* doc: mention opaque types in 'none-to-pointer' note message
2019-06-10 21:03:17 +02:00
Blake Thompson
30c0352348 Added __contains__ to stl bindings for maps (#1767)
* Added __contains__ to stl bindings for maps
2019-06-10 21:01:11 +02:00
nstelzen
c251434011 Added note in documentation regarding make install (#1801)
* Added note regarding make install
2019-06-10 16:35:36 +02:00
Yannick Jadoul
97784dad3e [BUGFIX] Fixing pybind11::error_already_set.matches to also work with exception subclasses (#1715)
* Fixing order of arguments in call to PyErr_GivenExceptionMatches in pybind11::error_already_set.matches

* Added tests on error_already_set::matches fix for exception base classes
2019-05-12 23:35:49 +02:00
Jamie Snape
a0b8f70df4 Ensure PythonLibsNew_FOUND is set in FindPythonLibsNew module (#1373)
Since the module is named FindPythonLibsNew, PythonLibsNew_FOUND should be set appropriately.
2019-05-12 19:43:44 +02:00
Boris Staletic
b3f0b4de66 new sphinx (#1786) 2019-05-12 19:27:23 +02:00
martinRenou
35045eeef8 Add getters for exception type, value and traceback (#1641) 2019-05-03 14:32:28 +02:00
Henry Schreiner
9bb3313162 Fixing warnings about conversions in GCC 7+ (#1753) 2019-04-07 10:38:10 +02:00
Henry Schreiner
73b840dc34 Fix for issue in latest conda (#1757) 2019-04-07 10:37:21 +02:00
Henry Schreiner
ae951ca085 CI fixes (#1744)
* Fix warning that not including a cmake source or build dir will be a fatal error (it is now on newest CMakes)
    * Fixes appveyor
* Travis uses CMake 3.9 for more than a year now
* Travis dropped sudo: false in December
* Dropping Sphinx 2
- clang7: Suppress self-assign warnings; fix missing virtual dtors
- pypy:
  - Keep old version (newer stuff breaks)
  - Pin packages to extra index for speed
- travis:
  - Make docker explicit; remove docker if not needed
  - Make commands more verbose (for debugging / repro)
  - Make Ubuntu dist explicit per job
- Fix Windows
- Add names to travis
2019-04-06 19:09:39 +02:00
Wenzel Jakob
25abf7efba flake8 fixes 2019-02-04 17:09:47 +01:00
Wenzel Jakob
ccbe68b084 added binding delattr() -> PyObject_DelAttr analogous to hasattr() 2019-02-04 16:24:07 +01:00
Wenzel Jakob
d1f64fa920 AppVeyor: quench pip deprecation warnings for v2.7 2019-02-04 16:18:01 +01:00
Guilhem Saurel
43a39bc7d8 ignore numpy.ufunc size warnings 2019-02-04 16:09:21 +01:00
Guilhem Saurel
e7ef34f23f compatibility with pytest 4.0, fix #1670
Cf. https://docs.pytest.org/en/latest/deprecations.html#pytest-namespace
2019-02-04 16:09:21 +01:00
Yannick Jadoul
085a29436a Increasing timeout in test_gil_scoped.py to get AppVeyor to succeed 2019-01-03 22:43:52 +01:00
Boris Staletic
0ca6867e8e Avoid Visual Studio 2017 15.9.4 ICE 2019-01-03 12:05:01 +01:00
Boris Staletic
f4b4e2e957 Use new Doxygen archive URL - fixes Travis 2019-01-03 12:05:01 +01:00
Borja Zarco
e2b884c33b Use PyGILState_GetThisThreadState when using gil_scoped_acquire. (#1211)
This avoids GIL deadlocking when pybind11 tries to acquire the GIL in a thread that already acquired it using standard Python API (e.g. when running from a Python thread).
2018-12-01 22:47:40 +09:00
Baljak
81da9888c7 Fix Intel C++ compiler warning on Windows (#1608) 2018-11-20 23:22:02 +01:00
Wenzel Jakob
64205140bd added std::deque to overview.rst
[ci skip]
2018-11-16 06:46:48 +01:00
voxmea
17983e7425 Adds type_caster support for std::deque. (#1609)
* Adds std::deque to the types supported by list_caster in stl.h.
* Adds a new test_deque test in test_stl.{py,cpp}.
* Updates the documentation to include std::deque as a default
  supported type.
2018-11-16 06:45:19 +01:00
Ahuva Kroizer
8f5b7fce84 FAQ addition (#1606)
* Add possible solution to ImportError issue
2018-11-13 13:25:57 +01:00
Karl Haubenwallner
e9d6e87949 Added a debug flag to the PYBIND11_INTERNALS_VERSION (#1549) 2018-11-11 20:49:33 +01:00
Trevor Laughlin
63c2a972fe Enable unique_ptr holder with mixed Deleters between base and derived types (#1353)
* Check default holder

-Recognize "std::unique_ptr<T, D>" as a default holder even if "D" doesn't match between base and derived holders

* Add test for unique_ptr<T, D> change
2018-11-11 19:36:55 +01:00
Wenzel Jakob
cea42467b0
fix py::cast<void *> (#1605)
Pybind11 provides a cast operator between opaque void* pointers on the
C++ side and capsules on the Python side. The py::cast<void *>
expression was not aware of this possibility and incorrectly triggered a
compile-time assertion ("Unable to cast type to reference: value is
local to type caster") that is now fixed.
2018-11-11 19:32:09 +01:00
Wenzel Jakob
e2eca4f8f8
Support C++17 aligned new statement (#1582)
* Support C++17 aligned new statement

This patch makes pybind11 aware of nonstandard alignment requirements in
bound types and passes on this information to C++17 aligned 'new'
operator. Pre-C++17, the behavior is unchanged.
2018-11-09 20:14:53 +01:00
Wenzel Jakob
adc2cdd5c4
fixed regression in STL type caster RVPs (fixes #1561) (#1603) 2018-11-09 20:12:46 +01:00
Wenzel Jakob
9f73060cc7
std::array<> caster: support arbitrary sequences (#1602)
This PR brings the std::array<> caster in sync with the other STL type
casters: to accept an arbitrary sequence as input (rather than a list,
which is too restrictive).
2018-11-09 12:32:48 +01:00
Michał Wawrzyniec Urbańczyk
978d439e92 Add PYBIND11_ prefix to the THROW macro to prevent name collisions. (#1578) 2018-11-03 13:20:08 +01:00
Josh Kelley
741576dd11 Update documentation for initialize_interpreter (#1584)
Add a detailed link to Python 3 documentation.  Add a caveat about
the program terminating if initializing the interpreter fails.
2018-11-01 02:10:11 +01:00
Rune Paamand
06d021b6e4 Issue #1532: Incompatible config options, /MP vs /Gm for MSVC in DEBUG (#1533)
* Issue #1532: Incompatible config options, /MP vs /Gm for MSVC in DEBUG
2018-10-25 01:35:33 +02:00
Wenzel Jakob
c9b8933e9a flake8 fix 2018-10-24 13:25:25 +02:00
Tarcísio Fischer
54eb8193e5 Fix scoped enums comparison for equal/not equal cases (#1339) (#1571) 2018-10-24 11:18:58 +02:00
Ryota Suzuki
1377fbf73c Fix unintentional escaping of character on Windows (#1574) (#1575) 2018-10-24 11:18:04 +02:00