pyo3/pytests
newcomertv 88f2f6f4d5
feat: support pyclass on tuple enums (#4072)
* 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>
2024-05-17 02:59:00 +00:00
..
src feat: support pyclass on tuple enums (#4072) 2024-05-17 02:59:00 +00:00
tests feat: support pyclass on tuple enums (#4072) 2024-05-17 02:59:00 +00:00
build.rs
Cargo.toml ci: move lints to new 1.74 cargo.toml tables 2023-11-17 15:41:52 +00:00
MANIFEST.in
noxfile.py feat: support pyclass on complex enums 2024-01-18 22:04:42 +09:00
pyproject.toml ci: tidy ups for 3.7 (#3969) 2024-03-19 19:36:22 +00:00
README.md

pyo3-pytests

An extension module built using PyO3, used to test and benchmark PyO3 from Python.

Testing

This package is intended to be built using maturin. Once built, you can run the tests using pytest:

pip install maturin
maturin develop
pytest

Alternatively, install nox and run the tests inside an isolated environment:

nox

Running benchmarks

You can install the module in your Python environment and then run the benchmarks with pytest:

pip install .
pytest --benchmark-enable

Or with nox:

nox -s bench