Commit Graph

2669 Commits

Author SHA1 Message Date
Yannick Jadoul
3e448c0b5e
Enable py::ellipsis on Python 2 (#2360)
* Enable py::ellipsis on Python 2

* Enable py::ellipsis tests on Python 2 and mention `Ellipsis` in the docs
2020-08-04 14:45:55 +02:00
Henry Schreiner
1caf1d0613
fix: check list validity and add missing file (#2352)
Added a check on CMake 3.12+ to make sure the file listing is up to date. And caught a missing file with it!
2020-08-01 15:24:30 -04:00
jbarlow83
4d90f1a199
Add error_scope to py::class_::dealloc() to protect destructor calls (#2342)
Fixes issue #1878
2020-07-31 17:46:12 -07:00
Henry Schreiner
b8047245bb
fix: uninstall cleanup (#2346) 2020-07-31 10:16:40 +02:00
acxz
6f6e9394ce
feat: add uninstall target for CMake (#2265)
* 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>
2020-07-30 21:16:50 -04:00
Henry Schreiner
94db5c5ed1 format: apply cmake-format 2020-07-30 20:27:55 -04:00
Henry Schreiner
e2a96890e1 format: add cmake-format to pre-commit 2020-07-30 20:27:55 -04:00
Henry Schreiner
1651c32492 update: address review points 2020-07-30 20:27:55 -04:00
Henry Schreiner
f64d5aa6da fix: typo for warning on C++17, support Win + 2.7 2020-07-30 20:27:55 -04:00
Henry Schreiner
1b92cd1703 fix: address review points from @YannickJadoul 2020-07-30 20:27:55 -04:00
Henry Schreiner
6ec1775fff feat: drop CMake 3.6 and below, modernize CMake
fix: include PYTHON_IS_DEBUG
2020-07-30 20:27:55 -04:00
Henry Schreiner
1491c94c9d
ci: cmake Configure test (#2327) 2020-07-28 20:13:09 -04:00
Marcin Wojdyr
8e40e389fd
cast pointer to std::tuple and std::pair (#2334) 2020-07-28 21:44:19 +02:00
Henry Schreiner
c51b3f436d ci: change caching 2020-07-27 22:12:19 -04:00
Henry Schreiner
a632486865 ci: Windows 2016 test 2020-07-27 22:12:19 -04:00
Henry Schreiner
88b3e5c68d ci: nicer naming scheme 2020-07-27 22:12:19 -04:00
Henry Schreiner
ff39ad3f31 ci: include scipy for tests 2020-07-27 22:12:19 -04:00
Henry Schreiner
249a13bd6e ci: move docs check to GHA 2020-07-27 22:12:19 -04:00
Henry Schreiner
e450ea0536 ci: add docker build to GHA 2020-07-27 22:12:19 -04:00
Henry Schreiner
2fbbd51084 ci: add gcc 2020-07-27 22:12:19 -04:00
Henry Schreiner
2ee1bcd9a4 ci: add GHA badge 2020-07-27 22:12:19 -04:00
Henry Schreiner
1b880dfd5a ci: download EIGEN 2020-07-27 22:12:19 -04:00
Henry Schreiner
9521bc56a8 ci: drop parts from Travis 2020-07-27 22:12:19 -04:00
Henry Schreiner
78069057b2 ci: trim down Appveyor 2020-07-27 22:12:19 -04:00
Sergei Izmailov
7b067cc387
Set __hash__ to None for types that defines __eq__, but not __hash__ (#2291)
fixes #2191
2020-07-27 01:44:25 +02:00
Henry Schreiner
aab701399a ci: cache, build wheels on macOS PyPy3 2020-07-26 09:25:27 -04:00
Henry Schreiner
5927c5819f chore: update Catch 2020-07-26 09:25:27 -04:00
Henry Schreiner
4470671796 fix: too many braces on clang 3.6 2020-07-26 09:25:27 -04:00
Henry Schreiner
1f53c373e4 fix: C++17 mode on Clang may error 2020-07-26 09:25:27 -04:00
Henry Schreiner
e428a7f6b8 ci: fix clang warnings 2020-07-26 09:25:27 -04:00
Henry Schreiner
6a80171c42 ci: Add clang builds & C++17 2020-07-26 09:25:27 -04:00
tuxmaster5000
7e0a4fb7d0
Fix for #2168 (#2299) 2020-07-24 19:00:48 +02:00
Boris Staletic
2819ce64a4
Avoid attr("__repr__") in initialize_generic (#2317)
If the default argument value is a class, and not an instance of a
class, `a.value.attr("__repr__")` raises a `ValueError`. Switching to
`repr(a.value)` makes this use case work.

Fixes #2028
2020-07-24 18:43:59 +02:00
Henry Schreiner
6f3e5e38c9 ci: keep travis from running twice 2020-07-23 19:47:53 -04:00
Henry Schreiner
5c936d4b22 refactor: issue fixed upstream 2020-07-23 19:47:53 -04:00
Henry Schreiner
8b0ccf7657 style: adding pre-commit check-style.sh 2020-07-23 19:47:53 -04:00
Henry Schreiner
b16347e51d ci: enable GHA testing
Adds requirements file too.
2020-07-23 17:42:53 -04:00
Henry Schreiner
73dc978683 style: avoid adding virtual environment directories 2020-07-23 17:42:53 -04:00
Henry Schreiner
a59c6de821 test: allow MSVC/Xcode to run the embed test 2020-07-23 17:42:53 -04:00
Henry Schreiner
49007b7ff3 test: fix warning/error on Python 2 in 14/17 mode 2020-07-23 17:42:53 -04:00
Henry Schreiner
3d20b73e87 test: pass through C++ std for cmake test 2020-07-23 17:42:53 -04:00
Henry Schreiner
ef057f12b6 test: support pypy2 7.3 2020-07-23 17:42:53 -04:00
xkszltl
134a2ec3f7
Add .git suffix to URL because only GitHub itself works without it. (#2319)
Fix https://github.com/pybind/pybind11/issues/2318
2020-07-23 13:21:09 -04:00
Boris Staletic
441e777040
Use new style __init__ in numpy docs (#2316) 2020-07-23 16:03:55 +02:00
Ralf W. Grosse-Kunstleve
96c6763613
test_builtin_casters.py test_string_view: Python 2 c++17, c++2a compatibility. (#2314)
Tested with 2.7.18rc1, built with Py_UNICODE_SIZE 4.
Change also tested with Python 3.8.
2020-07-22 12:05:16 -07:00
Liam Keegan
c4fd1fd987
CMake improvement: support windows python on msys (#2312)
- look for windows python lib when using mingw & msys
  - if not found, then look for system python lib as before
2020-07-21 19:17:22 +02:00
Henry Schreiner
d8c7ee00a6
ci: GHA basic format & pre-commit (#2309) 2020-07-20 13:35:21 -04:00
Kota Yamaguchi
e248869893
Fix undefined memoryview format (#2223)
* Fix undefined memoryview format

* Add missing <algorithm> header

* Add workaround for py27 array compatibility

* Workaround py27 memoryview behavior

* Fix memoryview constructor from buffer_info

* Workaround PyMemoryView_FromMemory availability in py27

* Fix up memoryview tests

* Update memoryview test from buffer to check signedness

* Use static factory method to create memoryview

* Remove ndim arg from memoryview::frombuffer and add tests

* Allow ndim=0 memoryview and documentation fixup

* Use void* to align to frombuffer method signature

* Add const variants of frombuffer and frommemory

* Add memory view section in doc

* Fix docs

* Add test for null buffer

* Workaround py27 nullptr behavior in test

* Rename frombuffer to from_buffer
2020-07-15 08:50:43 -07:00
Boris Staletic
aa982e131d
Small fixes in numpy.h (#2293)
- `PyArray_NewFromDescr_` should have been using `Py_intptr_t const *`
  - 18a6e3e505/numpy/core/src/multiarray/ctors.h (L5-L8)
- `PyArray_GetArrayParamsFromObject_` should be using `NPY_BOOL`
  - 18a6e3e505/numpy/core/src/multiarray/ctors.c (L1350-L1355)
  - https://docs.scipy.org/doc/numpy-1.13.0/reference/c-api.dtype.html#c.npy_bool
- `PyArray_DescrNewFromType` is at offset 96
  - 36e017194c/numpy/core/code_generators/numpy_api.py (L141)
- `array_t` constructor that takes a size and a pointer should take `ssize_t`.
  - Fixes #1599
2020-07-12 16:45:13 +02:00
Florian Apolloner
fe1392d089
Silence Clang 10 compiler warnings. Fixes #2225. (#2294) 2020-07-12 14:16:19 +02:00