pyo3/newsfragments
Thomas Tanon e0e3981e17
#[pymodule] mod some_module { ... } v3 (#3815)
* #[pymodule] mod some_module { ... } v3

Based on #2367 and #3294

Allows to export classes, native classes, functions and submodules and provide an init function

See test/test_module.rs for an example

Future work:
- update examples, README and guide
- investigate having #[pyclass] and #[pyfunction] directly in the #[pymodule]

Co-authored-by: David Hewitt <mail@davidhewitt.dev>
Co-authored-by: Georg Brandl <georg@python.org>

* tests: group exported imports

* Consolidate pymodule macro code to avoid duplicates

* Makes pymodule_init take Bound<'_, PyModule>

* Renames #[pyo3] to #[pymodule_export]

* Gates #[pymodule] mod behind the experimental-declarative-modules feature

* Properly fails on functions inside of declarative modules

---------

Co-authored-by: David Hewitt <mail@davidhewitt.dev>
Co-authored-by: Georg Brandl <georg@python.org>
2024-02-24 13:50:18 +00:00
..
.gitignore use towncrier to generate CHANGELOG 2022-09-08 07:58:53 +01:00
3514.added.md Add `PyMemoryView` type 2023-10-15 17:32:09 +08:00
3532.changed.md change `PyDict::from_sequence` to take just `&PyAny` 2023-10-20 11:59:26 +01:00
3540.added.md feat: support `async fn` in macros with coroutine implementation 2023-11-22 20:25:36 +01:00
3577.added.md Implement `PyTypeInfo` for `PyEllipsis`, `PyNone`, and `PyNotImplemented` 2023-11-24 22:31:39 +00:00
3577.changed.md Implement `PyTypeInfo` for `PyEllipsis`, `PyNone`, and `PyNotImplemented` 2023-11-24 22:31:39 +00:00
3582.added.md feat: support pyclass on complex enums 2024-01-18 22:04:42 +09:00
3588.added.md feat: add coroutine `__name__`/`__qualname__` and not-awaited warning 2023-11-25 21:51:20 +01:00
3599.added.md feat: add `coroutine::CancelHandle` 2023-12-04 07:46:51 +01:00
3600.changed.md replace `PyTryFrom` by splitting `PyTypeInfo` 2023-12-05 08:01:30 +03:00
3601.changed.md deprecate `PyTryFrom` and `PyTryInto` 2023-12-20 11:28:24 +00:00
3603.removed.md remove all functionality deprecated in 0.19 2023-11-27 22:02:19 +00:00
3609.changed.md feat: allow async methods to accept `&self`/`&mut self` 2023-12-07 07:42:10 +01:00
3632.added.md Add support for extracting Rust set types from `frozenset` 2023-12-07 20:25:31 +08:00
3638.changed.md Apply __bool__ conversion only to numpy.bool_ to avoid false positives. 2023-12-19 18:55:28 +01:00
3653.changed.md Add `AsRefSource` to `PyNativeType`. 2023-12-14 18:35:06 +00:00
3657.changed.md Transition is_true to is_truthy to clarify that the test is not based on identity with or equality to the True singleton. 2023-12-16 14:04:37 +01:00
3660.changed.md Rename name to qualname and full_name to name to better match Python 2023-12-19 16:51:24 +01:00
3661.changed.md Add change log and migration guide entries. 2023-12-20 13:07:14 +01:00
3663.changed.md Chrono: makes FromPyObject impl on DateTime generic 2023-12-18 20:12:30 +01:00
3664.changed.md Chrono: compatibility with abi3 2023-12-19 14:53:14 +01:00
3670.added.md Adds std::duration::Duration from/to Python conversions 2023-12-20 08:57:26 +01:00
3677.added.md implement `PyStringMethods` 2023-12-20 16:19:18 +00:00
3679.changed.md partially revert changes to `PyTzInfoAccess` trait 2023-12-24 15:07:42 +00:00
3686.added.md make `Bound` and `Borrowed` types public API 2023-12-21 12:20:33 +00:00
3689.changed.md Turn calls of __traverse__ into no-ops for unsendable pyclass if on the wrong thread 2023-12-23 15:01:08 +01:00
3692.added.md Add `.as_borrowed()` conversion from gil-refs to `Bound<T>` 2023-12-26 09:49:03 +00:00
3692.changed.md Add `.as_borrowed()` conversion from gil-refs to `Bound<T>` 2023-12-26 09:49:03 +00:00
3706.added.md Add `extract_bound` method to `FromPyObject` 2024-01-28 07:22:51 +00:00
3707.added.md add `gil-refs` feature to aid migration 2023-12-29 14:42:31 +00:00
3712.added.md add PyAnyMethods for binary operators 2023-12-29 18:45:18 -05:00
3730.added.md Conversion between chrono_tz::Tz and zoneinfo.ZoneInfo 2024-01-08 15:19:49 +01:00
3734.added.md ffi: Add definition for PyType_GetModuleByDef 2024-01-12 22:13:33 -06:00
3736.added.md Adds conversion between SystemTime and datetime 2024-01-27 17:43:51 +01:00
3742.changed.md improve performance of successful int extract by ~30% 2024-01-16 13:51:19 +00:00
3757.fixed.md update ffi structures for PyPy 7.3.15 2024-01-23 20:34:19 +00:00
3776.changed.md migrate `FromPyObject` for `Bound` and `Py` to `extract_bound` 2024-01-29 13:46:46 +00:00
3785.added.md add `Py::as_any` and `Py::into_any` 2024-02-01 09:07:36 +00:00
3801.added.md add `PyStringMethods::encode_utf8` 2024-02-05 13:28:46 +00:00
3802.added.md add `PyBackedStr` and `PyBackedBytes` (#3802) 2024-02-15 07:58:20 +00:00
3815.added.md #[pymodule] mod some_module { ... } v3 (#3815) 2024-02-24 13:50:18 +00:00
3818.fixed.md fix segmentation fault when `datetime` module is invalid 2024-02-11 02:44:31 +00:00
3849.added.md always use a Python iterator for sets and frozensets (#3849) 2024-02-17 10:57:53 +00:00
3849.changed.md always use a Python iterator for sets and frozensets (#3849) 2024-02-17 10:57:53 +00:00
3871.added.md Add `Py::drop_ref` method (#3871) 2024-02-21 22:56:03 +00:00