Commit Graph

29 Commits

Author SHA1 Message Date
Icxolu 70a7aa808d
deprecate the use of `PyCell` in favor of `Bound` and `Py` (#3916)
* deprecate the use of `PyCell` in favor of `Bound` and `Py`

* update `FromPyObject` for `T: PyClass + Clone` impl

* move `PyCell` deprecation to the `gil-refs` feature gate and add a migration note
2024-03-03 14:47:25 +00:00
Matthew Neeley 68ec6de0c9
Use single-arg form of `#[pymodule]` function in docs and tests (#3899)
* Use single-arg form for `#[pymodule]` functions in docs and tests

* Update guide/src/function.md

Co-authored-by: Icxolu <10486322+Icxolu@users.noreply.github.com>

* Add test of two-argument module function

* Fix new test

---------

Co-authored-by: Icxolu <10486322+Icxolu@users.noreply.github.com>
2024-02-28 22:36:50 +00:00
David Hewitt 4efc4b82a3
ci: fix redundant import warnings on nightly (#3873) 2024-02-19 22:07:05 +00:00
Icxolu 4ce9c35983
port `Python::get_type` to `Bound` API (#3846)
* port `Python::get_type` to `Bound` API

* fix `is_subclass_and_is_instance` FIXME
2024-02-18 18:27:19 +00:00
David Hewitt ec6d587218
support `Bound` for `classmethod` and `pass_module` (#3831)
* support `Bound` for `classmethod` and `pass_module`

* `from_ref_to_ptr` -> `ref_from_ptr`

* add detailed docs to `ref_from_ptr`
2024-02-16 00:36:11 +00:00
David Hewitt 5c6d49084f remove all functionality deprecated in 0.19 2023-11-27 22:02:19 +00:00
David Hewitt 7d486bb72a tests/common.rs -> src/tests/common.rs 2023-09-24 13:34:53 +01:00
Adam Reichold bd4b550495 Do not assert class text signature using the limited API before version 3.10 as we do not support it. 2023-05-04 18:28:43 +02:00
David Hewitt 8bd17f02c7 support `text_signature` on `#[new]` 2023-05-04 07:15:11 +01:00
messense 57dbc94293
Improve default value for `None` in `text_signature` 2023-03-29 10:14:44 +08:00
messense 79a70f3923
Improve default values for str, numbers and bool in `text_signature` 2023-03-16 11:06:51 +08:00
David Hewitt 8f48d157d6 deprecate required arguments after option arguments without signature 2023-01-15 10:17:20 +00:00
David Hewitt 5039fd746a add automatic text signature generation 2022-12-24 09:43:02 +00:00
David Hewitt 8e8b484169
add `#[pyo3(signature = (...))]` attribute (#2702) 2022-10-25 07:23:21 +01:00
mejrs 984fdf57c7 Use Python:;with_gil in tests 2022-07-19 19:34:23 +02:00
mejrs 6f1cf1b662 Add more lints 2022-03-23 08:07:28 +01:00
David Hewitt 6433d884fc dev: remove self dev dependency 2021-12-08 07:48:58 +00:00
messense b5b9a480cd Add `wrap_pyfunction` macro to prelude 2021-06-24 22:34:55 +08:00
David Hewitt cec4c2d2e9 text_signature: move to `#[pyo3(text_signature = "...")]` 2021-06-05 16:33:03 +01:00
David Hewitt a109640850 pyfn: deprecate name argument 2021-05-20 08:54:29 +01:00
roblabla d479b54b94 Fix #1285, text_signature and raw ident interaction 2020-11-19 17:21:02 +00:00
Alex Gaynor aabad7cf7f Assorted updates to the abi3 branch from review 2020-10-11 19:51:27 -04:00
Alex Gaynor 9d8559158b Hack __text_signature__ back to working with abi3 2020-09-19 11:43:57 -04:00
kngwyu 7a4c5e2960 Merge branch 'master' into abi3 2020-09-10 00:48:20 +09:00
Sebastian Pütz 3214249010 Make python function wrapper creation fallible.
Wrapping a function can fail if we can't get the module name.

Based on suggestion by @kngwyu
2020-09-03 15:48:32 +02:00
Alex Gaynor 400462063d Proof of concept of using PEP384s PyType_Spec 2020-09-02 16:54:39 -04:00
kngwyu a2408cacbb Rename PyClassShell with PyCell 2020-02-08 15:05:13 +09:00
kngwyu a6639076b9 Introduce PyInternalCaster 2019-12-14 23:16:39 +09:00
Jacob Lifshay af8c0d2531 switch text_signature to arguments only & add tests 2019-11-29 12:19:56 -08:00