* Add feature controlling the global reference pool to enable avoiding its overhead.
* Document reference-pool feature in the performance guide.
* Invert semantics of feature to disable reference pool so the new behaviour becomes opt-in
* Remove delayed reference count increments as we cannot prevent reference count errors as long as these are available
* Adjust tests to be compatible with disable-reference-pool feature
* Adjust tests to be compatible with py-clone feature
* Adjust the GIL benchmark to the updated reference pool semantics.
* Further extend and clarify the documentation of the py-clone and disable-reference-pool features
* Replace disable-reference-pool feature by pyo3_disable_reference_pool conditional compilation flag
Such a flag is harder to use and thereby also harder to abuse. This seems
appropriate as this is purely a performance-oriented change which show only be
enabled by leaf crates and brings with it additional highly implicit sources of
process aborts.
* Add pyo3_leak_on_drop_without_reference_pool to turn aborts into leaks when the global reference pool is disabled and the GIL is not held
* Add `num-rational` support for Python's `fractions.Fraction` type
* Add newsfragment
* Use Bound instead
* Handle objs which atts are incorrect
* Add extra test
* Add tests for wasm32 arch
* add type for wasm32 clipppy
* #[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>
* fix `either` feature conditional compilation, again
* test feature powerset in CI
* install `rust-src` for feature powerset tests
* review: adamreichold feedback
* Fix one more case of redundant imports.
* just check feature powerset for now
---------
Co-authored-by: Adam Reichold <adam.reichold@t-online.de>
I chose to make the dependency mandatory instead of optional as portable-atomic
itself just forwards to the native atomics when they are available so making
that choice part of our build system is not really necessary. Personally, I was
unable to perceive any noticeable compile-time hit from adding it.