* Automated module= field creation in declarative modules
Sets automatically the "module" field of all contained classes and submodules in a declarative module
Adds the "module" field to pymodule attributes in order to set the name of the parent modules. By default, the module is assumed to be a root module
* fix guide test error
---------
Co-authored-by: David Hewitt <mail@davidhewitt.dev>
* feat: support pyclass on tuple enums
* cargo fmt
* changelog
* ruff format
* rebase with adaptation for FnArg refactor
* fix class.md from pr comments
* add enum tuple variant getitem implementation
* fmt
* progress toward getitem and len impl on derive pyclass for complex enum tuple
* working getitem and len slots for complex tuple enum pyclass derivation
* refactor code generation
* address PR concerns
- take py from function argument on get_item
- make more general slot def implementation
- remove unnecessary function arguments
- add testcases for uncovered cases including future feature match_args
* add tracking issue
* fmt
* ruff
* remove me
* support match_args for tuple enum
* integrate FnArg now takes Cow
* fix empty and single element tuples
* use impl_py_slot_def for cimplex tuple enum slots
* reverse erroneous doc change
* Address latest comments
* formatting suggestion
* fix :
- clippy beta
- better compile error (+related doc and test)
---------
Co-authored-by: Chris Arderne <chris@translucent.app>
* 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
* deprecate GIL Refs in function arguments
* fix deprecated gil refs in function arguments
* add notes on deprecations limitations to migration guide
* Apply suggestions from code review
Co-authored-by: Icxolu <10486322+Icxolu@users.noreply.github.com>
* review: Icxolu
* fix proto method extract failure for option
* fix gil refs in examples
---------
Co-authored-by: Icxolu <10486322+Icxolu@users.noreply.github.com>
* deprecate `wrap_pyfunction` with `py` argument
The Python token in `wrap_pyfunction` is not handled automatically by
`WrapPyFunctionArg`, for backwards compatibility. This uses deref
specialization to deprecate this variant.
* merge `Extractor`s
* add deprecation ui test, revert closure variant due to test failure
* fix nightly
* add `FromPyObjectBound` adjustment for `&str` without GIL Refs
* review: alex, Icxolu feedback
* add newsfragment
* add newsfragment for `FromPyObject` trait change
* make some examples compatible with abi3 < 3.10
* seal `FromPyObjectBound`
* fixup chrono_tz conversion
* deprecate `&PyModule` as `#[pymodule]` argument type
* cleanup
* add ui tests
* fix deprecations in tests
* fix maturin and setuptools-rust starters
* run `deprecated` ui test only when `gil-refs` as disabled
* 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
* docs: update Python function section of the guide
* update `pass_module` types
Co-authored-by: David Hewitt <mail@davidhewitt.dev>
---------
Co-authored-by: David Hewitt <mail@davidhewitt.dev>