Commit graph

462 commits

Author SHA1 Message Date
Adam Reichold 5738edfdd4 Bump MSRV to 1.56 2023-06-04 23:02:30 +01:00
David Hewitt 996305ac62 remove other deprecations from 0.17 2023-05-09 09:39:23 +02:00
David Hewitt dd24c9ea71 remove Python::acquire_gil 2023-05-09 09:39:23 +02:00
Doug Goldstein 8e0bde14c9 implement Decimal to rust_decimal conversions
Implement conversion between rust_decimal::Decimal and decimal.Decimal
from Python's stdlib. The C API does not appear to be exposed on the
Python side so we need to call into it via Python.
2023-04-22 19:55:21 +02:00
Adam Reichold 9534749d8b Add GILProtected synchronization primitive replacement and use it for LazyTypeObjectInner. 2023-02-23 09:38:02 +01:00
David Hewitt 20ca3be659 inspect: gate behind experimental-inspect feature 2023-01-15 12:41:23 +00:00
Georg Brandl 62e2d6094e
crate doc: add missing links to chrono subpage/crate doc (#2743) 2022-11-16 20:39:59 +00:00
David Hewitt 372176630e guide: doctest function/ subpages 2022-09-27 07:52:14 +01:00
Federico Dolce 63f7df905d
Add chrono 0.4 integration (#2612)
Co-authored-by: Ivan Tham <pickfire@riseup.net>
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-09-22 09:00:09 +02:00
David Hewitt ab8f940e46 docs: require docs on all public APIs 2022-09-07 07:42:23 +01:00
Ivan “CLOVIS” Canet 8898bc9900
Represent Python types
The TypeInfo structure represents Python types used in hints. Its Display implementation converts it to the exact syntax for it to appear in a type hint.
2022-09-06 21:30:16 +02:00
David Hewitt 5718adeec7 pyproto: remove deprecated feature 2022-09-06 08:38:44 +01:00
mejrs ae50da1e3e Mention a concrete pyo3 version 2022-08-22 21:14:07 +02:00
mejrs db8b55a3fc pyproto is no longer enabled by default 2022-08-21 17:51:11 +02:00
David Hewitt d5e99b635d refactor: remove all 0.15 deprecations 2022-07-15 06:33:14 +01:00
mejrs e4e7e6e51c Add frozen documentation 2022-06-22 01:47:40 +02:00
David Hewitt 7a9e70e2c7 wrap_x: change macros back to macro_rules! 2022-05-14 20:42:07 +01:00
mejrs f1e5d4c9a1 Un-ignore and expand on doc examples 2022-05-03 00:47:09 +02:00
David Hewitt 71f9f18d54 remove toborrowedobject trait 2022-04-26 05:48:34 +01:00
Rico Hageman c281275a29 Gather test coverage with stable rust 2022-04-08 14:24:10 +02:00
Adam Reichold db109867d3 Add intern! macro which can be used to amortize the cost of creating Python objects by storing them inside a GILOnceCell. 2022-04-03 21:16:42 +02:00
mejrs 00ea040834 Feedback 2022-03-23 13:30:32 +01:00
mejrs 6f1cf1b662 Add more lints 2022-03-23 08:07:28 +01:00
David Hewitt 2bd64c4962 guide: tidy up doctests 2022-03-04 22:50:12 +00:00
David Hewitt b59ee9b54b misc: tidy ups pre 0.16 2022-02-27 10:02:28 +00:00
mejrs be84e0fbb9 Add numeric and object protocol examples 2022-02-23 10:09:45 +01:00
David Hewitt e33b3e6a5b opt: don't emit T::dict_offset and T::weakref_offset without attributes 2021-12-30 14:57:27 +00:00
David Hewitt ff37f24625 macros: accept paths in wrap_x macros 2021-12-30 12:46:57 +00:00
David Hewitt 75fe8e50ed ci: ignore coverage for test_hygiene, try 2 2021-12-20 21:13:42 +00:00
Georg Brandl 681217d8d9 pyo3_path, part 3: move test_hygiene into lib crate
This removes the crate-root `pyo3` item to ensure that our
selected pyo3_path needs to be taken into account.
2021-12-09 07:36:48 +01:00
David Hewitt 70030f130d python: drop support for 3.6 2021-11-20 13:02:42 +00:00
David Hewitt 6a65f98bd2 msrv: bump to 1.48 2021-11-19 10:10:59 +00:00
David Hewitt a978b0875a
Merge pull request #1968 from KRunchPL/guide-python-typing-hints
#1959 - Add Python Typing Hints to the Guide
2021-11-11 23:00:53 +00:00
mejrs a156158d7b add doc_auto_cfg feature 2021-11-10 22:37:20 +01:00
KRunchPL 5011ac7ce8 Fix formatting 2021-11-06 17:26:43 +01:00
KRunchPL 1531ac8d7e #1959 - Add Python Typing Hints to the Guide 2021-11-06 15:34:30 +01:00
mejrs bfb33da168 Merge branch 'remove_doc_cfg' of https://github.com/mejrs/pyo3 into remove_doc_cfg 2021-10-17 15:47:18 +02:00
mejrs 20c3c068f8 Remove doc_cfg attributes 2021-10-17 15:47:09 +02:00
Chris Laplante 3b94f4b70c
Add anyhow-integration feature which implements From<anyhow::Error> for PyErr (#1822)
* Add 'anyhow' feature which provides simple From<anyhow::Error> for PyErr impl

This makes it possible to use anyhow::Result<T> as the return type for
methods and functions exposed to Python.

The current implementation just stringifies the anyhow::Error before
shoving it into a PyRuntimeError. Conversion back to the anyhow::Error
is not possible, but it is better than nothing.

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>

* Document `anyhow` feature in the guide

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>

* update changelog to document anyhow feature

* WIP adding tests

* Finish up anyhow feature

* Fix formatting

* Fix tests

* Fix tests

* Apply review suggestions

Co-authored-by: Bruno Kolenbrander <59372212+mejrs@users.noreply.github.com>
Co-authored-by: mejrs <brunokolenbrander@hotmail.com>
2021-10-17 07:54:29 +01:00
Bruno Kolenbrander 8a57fe2d20
Clean up doctests, deny some lints (#1900)
* Clean up doctests, deny some lints

* Apply suggestions from review.

* replace \" with '

* Fix some more doc examples

* Fix formatting

* Fix some more things

* Remove unused parentheses

* Only test class sig on supported abi/platforms

* Only test class signature on correct versions

* Fix tests to compile on msrv

* msrv strikes yet again

* Add feedback

* Pin `half` to 1.7.1 on msrv
2021-10-14 22:15:25 +01:00
Bruno Kolenbrander ae873698d4
Implement eyre feature (#1893)
* Implement `eyre` feature

* Punctuation

* Add `eyre` entry in changelog

* Add `eyre` feature entry to guide

* Set eyre upper bound and move comment back

* Add eyre feature to docs.rs metadata

* Finish up review suggestions

* Update CHANGELOG.md

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2021-10-13 22:36:06 +00:00
Ben Kooiman-Cox f0ff4156bb
Add missing preposition in docs 2021-10-02 15:49:49 -04:00
mejrs 55ff51307d fix broken link 2021-09-22 22:56:40 +02:00
mejrs dcc148abe7 Fix some links 2021-09-14 19:33:59 +02:00
mejrs 4cd9f4b570 import FromPyObject into crate root 2021-09-14 14:07:23 +02:00
mejrs 6fe52fce2f msrv strikes again 2021-09-14 00:22:58 +02:00
mejrs d6973b1b6a clean up lib.rs 2021-09-13 22:58:15 +02:00
David Hewitt 9676c88a1b conversions: move more features inside the module 2021-09-06 21:07:23 +01:00
David Hewitt 313610993a pyo3-macros-backend: more tests for macro hygiene 2021-08-28 10:28:27 +01:00
mejrs e753d77e4a deduplicate documentation 2021-08-19 22:55:39 +02:00