Commit graph

2653 commits

Author SHA1 Message Date
Icxolu 10152a7078
feature gate PyCell (#4177)
* feature gate `PyCell`

* feature gate `HasPyGilRef` completely

* bump version
2024-05-12 18:30:08 +00:00
Alex Gaynor 57500d9b09
Updates comments regarding the reference pool that were inaccurate (#4176) 2024-05-11 16:48:38 +00:00
Adam Reichold c5f9001985
Remove deferred reference count increments and make the global reference pool optional (#4095)
* 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
2024-05-11 14:48:45 +00:00
Icxolu 033caa8fd1
split more impl blocks (#4175) 2024-05-11 13:48:17 +00:00
Icxolu 444be3bafa
feature gate deprecated APIs for Python (#4173) 2024-05-10 18:28:30 +00:00
Icxolu 1e8e09dce3
feature gate as/into_gil_ref APIs (Part 3) (#4172) 2024-05-10 17:03:57 +00:00
Icxolu aef0a05719
deprecate implicit default for trailing optional arguments (#4078)
* deprecate "trailing optional arguments" implicit default behaviour

* add newsfragment

* generate individual deprecation messages per function

* add migration guide entry
2024-05-10 10:34:58 +00:00
Alex Gaynor 104328ce14
feature gate deprecated more APIs for Py (#4169) 2024-05-10 05:54:08 +00:00
David Hewitt f3c7b90def
remove function pointer wrappers no longer needed for MSRV (#4167) 2024-05-09 22:22:17 +00:00
Icxolu 21c02484d0
feature gate APIs using into_gil_ref (Part 2) (#4166) 2024-05-09 22:21:48 +00:00
David Matos 2d19b7e2a7
Add num-rational support for Python's fractions.Fraction type (#4148)
* 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
2024-05-09 15:37:53 +00:00
Icxolu 635cb8075c
feature gate APIs using into_gil_ref (Part 1) (#4160) 2024-05-09 07:58:44 +00:00
Icxolu 72be1cddba
emit cargo:rustc-check-cfg=CHECK_CFG for pyo3s config names (#4163) 2024-05-08 05:46:00 +00:00
Icxolu 7263fa92ef
feature gate deprecated APIs for PyBool (#4159) 2024-05-04 17:45:27 +00:00
Alex Gaynor d1a0c7278f
feature gate deprecated APIs for PyCFunction (#4154) 2024-05-03 19:50:38 +00:00
Icxolu c08f6c77a6
feature gate deprecated APIs for marshal (#4149) 2024-05-03 18:15:25 +00:00
Alex Gaynor f3ab62cb7e
feature gate deprecated APIs for PyModule (#4151) 2024-05-03 17:10:49 +00:00
Alex Gaynor 93cfb51ebb
feature gate deprecated APIs for PyMemoryView (#4152) 2024-05-03 16:02:19 +00:00
Icxolu cd3f3ed67c
ci: updates for Rust 1.78 (#4150)
* ci: updates for Rust 1.78

* ci: fix clippy

* restrict `invalid_pymethods_duplicates` to unlimited api with `full`
2024-05-03 07:42:30 +00:00
Icxolu a454f6e9cc
feature gate deprecated APIs for PyFloat and PyComplex (#4145) 2024-05-01 17:13:49 +00:00
Alex Gaynor 5534a7bee8
feature gate deprecated APIs for PyBuffer (#4144) 2024-05-01 12:18:12 +00:00
Icxolu dc9a41521a
feature gate deprecated APIs for Py (#4142) 2024-05-01 10:57:03 +00:00
Alex Gaynor 261d27d197
feature gate deprecated APIs for PySlice (#4141) 2024-04-30 23:55:43 +00:00
Icxolu 2f3a33fda1
feature gate deprecated APIs for PyList (#4127) 2024-04-30 22:00:31 +00:00
Icxolu 82c00a2fe4
port PyAny tests to Bound API (#4140) 2024-04-30 21:49:00 +00:00
Icxolu 4616838ee1
port PySequence tests to Bound API (#4139) 2024-04-30 18:53:40 +00:00
Icxolu 22c5cff039
feature gate deprecated APIs for PyErr and exceptions (#4136) 2024-04-30 16:58:53 +00:00
Icxolu d5452bcd8d
feature gate deprecated APIs for PyType, PyTypeInfo and PySuper (#4134) 2024-04-28 21:03:51 +00:00
Alex Gaynor 9e1960ea34
Update MSRV to 1.63 (#4129)
* Bump MSRV to 1.63

* Drop parking_lot in favor of std::sync

* Make portable-atomic dep conditional

* Remove no longer required cfg
2024-04-28 16:11:28 +00:00
Icxolu 6fb972b232
feature gate deprecated APIs for PyEllipsis, PyNone and PyNotImplemented (#4132) 2024-04-27 15:34:13 +00:00
Icxolu 059c8b3862
feature gate deprecated APIs for PyBytes and PyPyByteArray (#4131) 2024-04-27 11:34:27 +00:00
David Matos c66ed292ec
Disable PyUnicode_DATA on PyPy (#4116)
* Disable PYUNICODE_DATA on PyPy

* Add newsfragment

* Adjust import on PyString
2024-04-26 06:00:13 +00:00
Icxolu 8734b76f60
feature gate deprecated APIs for PyIterator (#4119) 2024-04-25 17:44:42 +00:00
Icxolu 6c2e6f8bcc
feature gate deprecated APIs for PyFrozenSet (#4118) 2024-04-24 21:13:27 +00:00
Icxolu c951bf86de
feature gate deprecated APIs for PyCapsule (#4112) 2024-04-24 17:34:19 +00:00
Icxolu 013a4476ea
feature gate deprecated APIs for datetime types (#4111) 2024-04-24 17:33:53 +00:00
Icxolu 5d2f5b5702
feature gate deprecated APIs for PyDict (#4108) 2024-04-23 05:48:27 +00:00
Icxolu da2d1aa8b4
feature gate deprecated APIs for PyString (#4101) 2024-04-22 07:20:32 +00:00
Icxolu b0ad1e10aa
feature gate deprecated APIs for PyTuple (#4107) 2024-04-22 07:19:01 +00:00
David Hewitt 947b372dcc
change PyAnyMethods::dir to be fallible (#4100) 2024-04-19 19:35:52 +00:00
David Hewitt cd28e1408e
add #[track_caller] to all Py/Bound/Borrowed methods which panic (#4098) 2024-04-19 11:44:36 +00:00
Icxolu d42c00d21d
feature gate deprecated APIs for PySet (#4096) 2024-04-19 07:24:26 +00:00
Jacob Zhong 03c50a1839
Change the types of PySliceIndices and `PySlice::indices (#3761)
* Change the type of `PySliceIndices::slicelength` and `PySlice::indices()`

* Fix example

* Fix fmt
2024-04-18 07:33:07 +00:00
Icxolu 03f59eaf45
fix declarative module compile error with create_exception! (#4086)
* fix declarative module compile error with `create_exception!`

* add newsfragment
2024-04-16 20:12:18 +00:00
David Hewitt a5201c04af
Deprecate the PySet::empty gil-ref constructor (#4082)
* Deprecate the `PySet::empty` gil-ref constructor

* add newsfragment
2024-04-14 21:38:40 +00:00
David Matos 8ed5c17b93
Allow use of scientific notation on rust decimal (#4079)
* Allow use of scientific notation on rust decimal

* Add newsfragment

* Pull out var

* Fix clippy warning

* Modify let bindings location
2024-04-14 20:07:17 +00:00
Adam Reichold 721100a9e9
Suppress non_local_definitions lint as we often want the non-local effects in macro code (#4074)
* Resolve references to legacy numerical constants and use the associated constants instead

* Suppress non_local_definitions lint as we often want the non-local effects in macro code
2024-04-13 12:59:44 +00:00
Joseph Perez 2f0869a6d6
fix: allow impl of Ungil for deprecated PyCell in nightly (#4053) 2024-04-06 22:36:52 +00:00
Icxolu 8f87b8636d
refactor #[setter] argument extraction (#4002) 2024-04-01 12:10:18 +00:00
Icxolu 63ba371db0
added various std traits for PyBackedStr and PyBackedBytes (#4020)
* added various std traits for `PyBackedStr` and `PyBackedBytes`

* add newsfragment

* add tests
2024-04-01 07:10:40 +00:00