Commit Graph

270 Commits

Author SHA1 Message Date
David Hewitt 4020e4d0c8 Add `Python::with_gil` 2020-07-13 22:37:40 +01:00
David Hewitt b1a37afa8c Fix definition of _PyLong_AsByteArray 2020-07-09 16:38:01 +01:00
David Hewitt 5d07bbb50f Correct CHANGELOG entries 2020-07-09 09:32:58 +01:00
David Hewitt e5959f268e Add CHANGELOG entry 2020-07-09 08:43:56 +01:00
Yuji Kanagawa c00080e27f
Merge pull request #1020 from PyO3/to-str
Remove PyString::as_bytes since it cannot return raw bytes
2020-07-08 15:05:58 +09:00
kngwyu 581e6e0924 Remove register_gil 2020-07-08 13:36:00 +09:00
vthriller 0f2eeea4ed
CHANGELOG.md: trivial URL typo fix 2020-07-06 21:55:00 +03:00
kngwyu 7849b74dbf Remove PyString::as_bytes since it cannot return raw bytes 2020-07-06 21:38:31 +09:00
David Hewitt a5c1c9ade9 Update FFI definitions for pylifecycle.h 2020-07-04 15:03:42 +01:00
kngwyu 6cbe9ff30d Bump version to 0.11.1 2020-06-30 14:53:55 +09:00
Yuji Kanagawa 512335186a
Merge branch 'master' into pyclass-unsendable 2020-06-30 14:17:40 +09:00
kngwyu d76fe7835a Introduce #[pyclass(unsendable)] 2020-06-30 12:30:17 +09:00
David Hewitt a250de824d Update CHANGELOG 2020-06-29 22:26:21 +01:00
David Hewitt f89e9e0eb1 Write migration guide for 0.11 2020-06-27 23:59:44 +09:00
kngwyu fd94a0d55c Bump version to 0.11.0 2020-06-27 23:59:44 +09:00
David Hewitt e140b729fc Allow #[getter] and #[setter] functions to take PyRef 2020-06-27 14:55:22 +01:00
Yuji Kanagawa e35622b941
Merge pull request #997 from davidhewitt/pyproto-next-return
Add __next__ return
2020-06-24 23:16:35 +09:00
scalexm f5e1dff7eb Update docs now that recursive `#[classattr]` are allowed again 2020-06-23 22:41:23 +02:00
David Hewitt 9f9137c6e4 Add ability to return from `__next__` / `__anext__` 2020-06-23 15:26:28 +01:00
David Hewitt a9c7e12be0 Allow skipping the return type completely for `#[pyproto]` methods returning `()`. 2020-06-23 11:51:02 +01:00
David Hewitt c7a4b4770f Refactor `#[pyproto]` Result types 2020-06-23 11:08:36 +01:00
kngwyu f053bc3881 Fix dealloc implementation to collectly use subtype's tp_free 2020-06-22 10:58:00 +09:00
kngwyu b70ee9a5ad Use subclass correctly in tp_new 2020-06-22 01:38:13 +09:00
Yuji Kanagawa 7075827a03
Merge pull request #969 from PyO3/poc-stable-rust
Stable Rust
2020-06-21 16:54:59 +09:00
kngwyu a63e426f6f Some doc and test cleanups mainly around specialization 2020-06-20 12:59:56 +09:00
David Hewitt a1dbfa8c8c Add pyo3::once_cell::GILOnceCell 2020-06-18 18:53:32 +01:00
konstin 3180e5cc06 POC stable rust (2 tests failing) 2020-06-18 17:21:09 +09:00
kngwyu 8a0c9bfcf5 Add a CHANGELOG entry for 961 2020-06-18 16:39:22 +09:00
Yuji Kanagawa 6ea834526b
Merge pull request #976 from davidhewitt/prefer-py
Add PyClass borrow methods to Py
2020-06-18 15:48:36 +09:00
David Hewitt 925986c706 Add PyCell::borrow shortcuts to Py 2020-06-17 08:58:32 +01:00
David Hewitt e377afa5de Add CHANGELOG entries for num crate version bumps 2020-06-15 20:14:56 +01:00
David Hewitt a85d157111 Cleanups to ensure GIL-safety of Py<T> and PyObject methods 2020-06-14 16:37:34 +01:00
Yuji Kanagawa bbdca6b0bd
Merge pull request #967 from davidhewitt/bytearray-as-bytes
Add accessor methods to `PyByteArray`
2020-06-13 16:53:22 +09:00
David Hewitt 8a85feca97 Change return type of `PyTuple::slice` to `&[&PyAny]` 2020-06-12 05:21:27 +01:00
David Hewitt 21d365f7d4 Add accessor methods to `PyByteArray` 2020-06-12 05:01:09 +01:00
David 33617bfffc Require Send for #[pyclass] 2020-06-08 02:06:15 +01:00
Yuji Kanagawa 5939362e72
Fix docs and comments based on the review
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2020-06-05 17:48:43 +09:00
kngwyu 688021315e Typed PyBuffer 2020-06-04 22:03:53 +09:00
Mara Bos febccbf6e7 Call Py_Finalize at exit using libc::atexit.
This makes sure buffers are flushed, threads are joined, etc. when
exiting the process.
2020-05-24 14:56:54 +02:00
David Hewitt 29c93c87c7 Remove GetPropertyValue 2020-05-21 18:06:24 +01:00
Omer Katz 6f9048cd8f
Add FFI definition for PyObject_AsFileDescriptor (#938)
Add FFI definition for PyObject_AsFileDescriptor

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2020-05-19 22:14:53 +01:00
David Hewitt 5c5527dfec Fix passing explicit None to pyfunction with default 2020-05-17 19:19:33 +01:00
Yuji Kanagawa 8e6398029d
Merge pull request #930 from davidhewitt/remove-managed-py-ref
Remove ManagedPyRef
2020-05-16 13:31:46 +09:00
David Hewitt 91d0dbceab Remove ManagedPyRef 2020-05-15 21:38:40 +01:00
David Hewitt aa81e382be
Fix changelog typo 2020-05-15 09:01:23 +01:00
kngwyu 837261c860 Bump version to 0.10.1 2020-05-14 20:57:51 +09:00
David Hewitt 3b1f720eb0 Fix deadlock in update_counts 2020-05-13 18:36:40 +01:00
Yuji Kanagawa 7e4d1c41e3
Bump version to 0.10.0 (#919)
* Bump version to 0.10.0

* Apply suggestions from code review

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>

* Improve CHANGELOG completeness and messaging

* ObjectProtocol was in prelude

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2020-05-13 13:24:36 +09:00
kngwyu 69dba08b01 Use PyMethodsImpl instead of *ProtocolImpl::methods 2020-05-11 20:08:21 +09:00
David Hewitt 86af474a95 Add Clone for PyObject / Py<T> 2020-05-10 12:01:18 +01:00
Yuji Kanagawa 8e84721438
Merge pull request #893 from davidhewitt/safe_acquire_gil
Close soundness hole with acquire_gil
2020-05-09 19:03:15 +09:00
David Hewitt 8ffe8c58b3 Close soundness hole with acquire_gil 2020-05-09 10:41:41 +01:00
scalexm 76c7f9eaa8 Add a changelog item for `#[classattr]` 2020-05-08 22:37:33 +02:00
David Hewitt 69fb04f04b Clean up CHANGELOG 2020-05-08 15:41:53 +01:00
David Hewitt a5ebef4b2e Remove ObjectProtocol; Add methods to PyAny and use Deref 2020-05-08 10:05:19 +01:00
David Hewitt b083e0babf Make allow_threads safe with panics 2020-05-07 15:29:47 +01:00
David Hewitt 9380bfde6f Add catch_unwind! macro to prevent panics crossing ffi boundaries 2020-05-05 08:17:06 +01:00
Mara Bos 39b41b3dc7 Replace num-traits dependency by std's TryFrom. 2020-05-04 15:50:07 +02:00
Yuji Kanagawa 0f07cf8db9
Merge pull request #886 from fusion-engineering-forks/dir
Add dir() to ObjectProtocol.
2020-05-04 18:07:27 +09:00
Mara Bos 36ebd0566c Update CHANGELOG.md. 2020-05-03 14:32:43 +02:00
David Hewitt b7ecec7812 Remove unsound return of borrowed objects 2020-05-02 23:35:26 +01:00
kngwyu b6befcfb93 CHANGELOG and better docs for PyMethodsImpl 2020-05-02 18:46:48 +09:00
David Hewitt 3008528fa6 Allow use of `#[pyo3(get, set)]` with `Py<T>` 2020-04-22 22:21:27 +01:00
Yuji Kanagawa ae81865232 Apply suggestions from David
Co-Authored-By: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2020-04-13 11:05:48 +09:00
kngwyu 2cd466dc46 Bound 'py lifetime by GILPool when it's possible 2020-04-12 23:55:23 +09:00
David Hewitt 97fd658593
Add IntoPy<PyObject> for HashSet and BTreeSet (#865) 2020-04-12 14:44:01 +09:00
Yuji Kanagawa 7b1e8a6daf
Merge pull request #851 from davidhewitt/pointer-optimization
Improve performance on pointer drop
2020-04-10 12:30:35 +09:00
Yuji Kanagawa 5add8d1dee
Merge branch 'master' into merge-0.9.2 2020-04-09 17:17:52 +09:00
kngwyu a73ff502ba More changelog 2020-04-09 17:13:05 +09:00
David Hewitt fe57f64435 Improve performance on pointer drop
Co-Authored-By: Yuji Kanagawa <yuji.kngw.80s.revive@gmail.com>
2020-04-09 08:51:43 +01:00
Yuji Kanagawa 53b63cddc2
Merge pull request #855 from althonos/patch-gc
Fix potential panics caused by Garbage Collector
2020-04-09 16:39:58 +09:00
kngwyu c83d88ba8d Bump version to 0.9.2 2020-04-09 13:00:13 +09:00
Martin Larralde 049202c011 Add changelog entry [ci skip] 2020-04-08 16:35:22 +02:00
David Hewitt b5b8264eb4 Tidy up changelog newlines 2020-04-08 08:02:54 +01:00
Árni Dagur 97aca504a3 Implement FromPyObject for HashSet and BTreeSet 2020-03-29 20:58:36 -04:00
kngwyu 4759358acb Bump version to 0.9.1 2020-03-23 18:55:24 +09:00
kngwyu 1e39071c04 Retrieve FromPyObject implementation for &PySequence 2020-03-22 20:00:21 +09:00
kngwyu 89e5a654ad Bump version to 0.9.0 2020-03-19 13:48:00 +09:00
kngwyu 02ee7a5afc Expose PyAny to lib.rs and prelude 2020-03-18 13:38:18 +09:00
kngwyu 40077245ea Fix PyModule::dict 2020-03-16 15:45:54 +09:00
Yuji Kanagawa b7c4fdb9bc
Update CHANGELOG.md
Co-Authored-By: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2020-03-08 00:57:11 +09:00
kngwyu cea707dd1c Inhibit positional args after * 2020-03-06 14:01:27 +09:00
kngwyu 25069baef4 Fix the interpretation of '*' 2020-03-04 23:48:46 +09:00
Yuji Kanagawa dc8e0c4c18
Merge branch 'master' into array-impls 2020-03-03 13:07:03 +09:00
Caio 6b78f1b43c Implement `*Py*` traits for arrays (up to 32) 2020-03-02 18:25:07 -03:00
kngwyu 4b9cb70c3e Update CHANGELOG 2020-03-02 20:44:29 +09:00
kngwyu ee0c178fed Remove ObjectProtocol::get_base and fix class.md 2020-03-02 13:08:37 +09:00
kngwyu ca6227c739 Address review comments 2020-03-01 12:58:28 +09:00
Yuji Kanagawa 399e4bf9b1
Apply suggestions from code review
Co-Authored-By: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2020-03-01 12:43:04 +09:00
kngwyu 05159417a8 Update CHANGELOG 2020-02-25 22:16:27 +09:00
David Hewitt d5509424b2 Make #[pymethods] aware of #[cfg] 2020-02-15 14:07:48 +00:00
Yuji Kanagawa 0eb4eb4e58 Merge branch 'master' into property-fixes 2020-02-10 15:13:19 +09:00
David Hewitt 6c25f6aacc Bump minimum Rust version to 1.42.0-nightly 2020-02-09 10:54:00 +00:00
David Hewitt 50bb41f398 Add CHANGELOG entry for msrv bump 2020-02-08 19:02:52 +00:00
David Hewitt cea8a9a2b0 Refactor to clean up property descriptor macros 2020-02-08 18:57:30 +00:00
David Hewitt f8c8b8effd Fix for PyObject with `#[pyo3(get)]` 2020-02-07 19:31:13 +00:00
Yuji Kanagawa 14980d742d
Merge pull request #755 from davidhewitt/property-doc
Fix docstrings generated by `[pyo3(get, set)]`
2020-02-03 18:14:54 +09:00
David Hewitt dfb7d7c58d Fix docstrings generated by `[pyo3(get, set)]` 2020-02-03 08:01:30 +00:00
David Hewitt 7531b9fb07 Remove even more uses of `static mut` 2020-01-30 13:24:55 +00:00
Yuji Kanagawa 3c4809bf0f
Merge branch 'master' into fix-743 2020-01-27 23:40:18 +09:00