Commit graph

4896 commits

Author SHA1 Message Date
mejrs 44310ec7e0 Forward cfgs on pyclass fields to the method defs 2022-12-06 22:38:32 +01:00
bors[bot] 55592afdb9
Merge #2771
2771: ci: run pyo3-ffi-check r=davidhewitt a=messense



Co-authored-by: messense <messense@icloud.com>
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-12-03 13:35:05 +00:00
messense 272df32277
Add publish = false to pyo3-ffi-check and pytests crate 2022-12-03 21:12:54 +08:00
messense c776792f9d
Allow pyo3-ffi-check failure on PyPy for now 2022-12-03 21:11:40 +08:00
messense 272f7dd07f
Tweak pyo3-ffi-check 2022-12-03 21:11:40 +08:00
David Hewitt a63a782eec
Import pyo3-ffi-check
Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2022-12-03 21:11:40 +08:00
messense 9a164bac54
ci: run pyo3-ffi-check 2022-12-03 21:11:36 +08:00
bors[bot] 84d68d44ae
Merge #2788
2788: Define _PyErr_ChainExceptions() FFI for CPython r=davidhewitt a=ijl

This appears to be the only way to chain exceptions via the FFI. It was introduced prior to CPython 3.7. It has some description of usage in PEP 490. There was a discussion of whether it should be made stable in BPO 44938.

Co-authored-by: ijl <ijl@mailbox.org>
2022-12-01 18:57:08 +00:00
ijl d5a31706c6 Define _PyErr_ChainExceptions() FFI for CPython
This appears to be the only way to chain exceptions via the FFI. It
was introduced prior to CPython 3.7. It has some description of usage
in PEP 490. There was a discussion of whether it should be made stable
in BPO 44938.
2022-12-01 15:25:56 +00:00
bors[bot] a67c5782e8
Merge #2791
2791: netlify: fix mdbook update r=messense a=davidhewitt

Fixes the following error on netlify builds:

```text
6:34:54 PM: + '[' 'mdbook v0.4.21' '!=' 'mdbook v0.4.22' ']'
6:34:54 PM: + cargo install mdbook@0.4.22
6:34:54 PM:     Updating crates.io index
6:35:00 PM:  Downloading crates ...
6:35:00 PM:   Downloaded mdbook v0.4.22
6:35:00 PM: error: binary `mdbook` already exists in destination
6:35:00 PM: Add --force to overwrite
```

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-11-30 08:47:43 +00:00
David Hewitt 13db7348a6 netlify: fix mdbook update 2022-11-30 08:31:00 +00:00
bors[bot] a71905052e
Merge #2777
2777: ci: remove `github.sha` from concurrency group r=davidhewitt a=messense

Otherwise duplicate workflow runs on staging/trying branches won't be cancelled automatically.

Co-authored-by: messense <messense@icloud.com>
2022-11-24 08:52:10 +00:00
messense 1f6e2c4ee6
ci: remove github.sha from concurrency group
Otherwise workflow runs on staging/trying branches won't be cancelled
automatically.
2022-11-24 16:19:58 +08:00
bors[bot] 56f11c252d
Merge #2779
2779: Mention `into_py` in docs for PyTuple::new r=davidhewitt a=hauntsaninja

I'm new to Rust / PyO3, and it took me a little bit to figure this out :-)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-11-24 08:14:41 +00:00
Shantanu 95f041281f
Mention into_py in docs for PyTuple::new
I'm new to Rust / PyO3, and it took me a little bit to figure this out :-)
2022-11-23 16:34:59 -08:00
bors[bot] 79f8cbd612
Merge #2776
2776: add abi3-py311 feature r=messense a=davidhewitt

Just noticed this was missing.

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-11-23 08:31:57 +00:00
David Hewitt 97487ffbb5 add abi3-py311 feature 2022-11-23 08:08:12 +00:00
bors[bot] 101ac1b78d
Merge #2763
2763: Typos, grammar, code style, etc. r=adamreichold a=birkenfeld



Co-authored-by: Georg Brandl <georg@python.org>
2022-11-23 06:43:54 +00:00
Georg Brandl f1f1ffcdc7 More typos and grammar. 2022-11-23 07:42:53 +01:00
Georg Brandl c91ed70bbc Fix various typos/omissions in guide. 2022-11-23 07:42:17 +01:00
Georg Brandl 5f7d67615c Use PYO3_DOCS_URL in guide-to-rustdoc links. 2022-11-23 07:42:17 +01:00
Georg Brandl 717e09be13 Fix coding style in docstrings. 2022-11-23 07:42:17 +01:00
bors[bot] 08423557d4
Merge #2739
2739: error when `#[pyo3(signature = ())]` used on invalid methods r=davidhewitt a=davidhewitt

A follow-up to #2702 to reject some invalid applications of `#[pyo3(signature = (...))]` attribute, specifically on magic methods and getters / setters / class attributes.

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-11-22 19:41:27 +00:00
bors[bot] 40340062b2
Merge #2769
2769: PySlice: fix isize->long truncation in initialization r=davidhewitt a=birkenfeld



Co-authored-by: Georg Brandl <georg@python.org>
2022-11-22 19:04:30 +00:00
bors[bot] b485199cfb
Merge #2762
2762: Add a nox task to rustfmt code in the guide r=birkenfeld a=birkenfeld

Also apply it. Two caveats:

1) needs nightly rustfmt to be available
2) not all reformat diffs have been applied; using best judgment for readability


Co-authored-by: Georg Brandl <georg@python.org>
2022-11-22 11:11:19 +00:00
Georg Brandl cbae47d171 PySlice: fix isize->long truncation in initialization
Fixes #2768
2022-11-22 12:04:32 +01:00
bors[bot] d53baed0ca
Merge #2761
2761: ci: configure bors r=messense a=messense

Closes #2710 
Closes #2714 

Co-authored-by: messense <messense@icloud.com>
2022-11-22 08:30:52 +00:00
Georg Brandl a7a53d6c0d Add a nox task to rustfmt code in the guide.
Also apply it. Two caveats:

1) needs nightly rustfmt to be available
2) not all reformat diffs have been applied; using best judgment for readability.
2022-11-22 09:19:40 +01:00
David Hewitt 23fcdf950b
Merge pull request #2767 from saulshanabrook/patch-1
Add link to Python typing docs for type stubs
2022-11-22 08:12:28 +00:00
David Hewitt 4449640afc
Merge pull request #2756 from PyO3/misc
Two smallish cleanups
2022-11-22 08:11:48 +00:00
David Hewitt 4cf56669e5
Merge pull request #2765 from jqnatividad/bump-memoffset
bump memoffset from 0.6.5 to 0.7
2022-11-22 07:49:05 +00:00
Saul Shanabrook 8a75352122
Add link to Python typing docs for type stubs
AFAIK there isn't currently a link to the article on ["Type Stubs"](https://typing.readthedocs.io/en/latest/source/stubs.html) in the official Python static typing documentation. This PR adds a link to this documentation, which is the most comprehensive I have seen around type stubs.
2022-11-21 16:48:43 -05:00
messense 85b4309923
ci: try reusable workflow 2022-11-21 17:30:43 +08:00
messense d6abdc0f63
Merge pull request #2764 from matthewlloyd/patch-1
guide: linkify "Method arguments" in class.md
2022-11-21 11:17:24 +08:00
Joel Natividad 91adca3b04 bump memoffset from 0.6.5 to 0.7 2022-11-20 20:23:11 -05:00
Matthew Lloyd b2014c30aa
guide: linkify "Method arguments" in class.md 2022-11-20 16:33:15 -05:00
Georg Brandl 99c8dea30e Use Python::get_type() instead of PyTypeInfo::type_object()
The former needs one less import and uses a familiar object.
2022-11-20 15:16:18 +01:00
messense b7bbd7b497
ci: configure bors 2022-11-20 21:23:05 +08:00
Georg Brandl 21fd1a91d0 Make downcast() methods inline 2022-11-20 13:14:54 +01:00
David Hewitt 8ca41be87b
Merge pull request #2749 from PyO3/2748-fix
Fix being able to call arg-less `#[new]` with any args from Python
2022-11-20 11:39:42 +00:00
David Hewitt 6af46596e0
Merge pull request #2751 from PyO3/2601-fix
guide: better document negative index behavior w.r.t. PySequence
2022-11-20 11:34:52 +00:00
David Hewitt 7e9f3fa63b
Merge pull request #2759 from PyO3/2758-fix
ffi: use bytesobject/dictobject on PyPy
2022-11-20 11:32:18 +00:00
David Hewitt d865367c49
Merge pull request #2760 from PyO3/2750-fix
macros: fix the check for applying `METH_NOARGS`
2022-11-20 11:31:14 +00:00
Georg Brandl 4a2e6bd51a ffi: fixup bytesobject/dictobject on PyPy
Fixes #2758
2022-11-20 11:31:24 +01:00
Georg Brandl ea9da80ab1 macros: fix the check for applying METH_NOARGS
to only consider the Python argument list.

Fixes #2750
2022-11-20 09:00:42 +01:00
Georg Brandl 51eeb6db96 guide: explain how #[new] works w.r.t. native base types 2022-11-20 08:25:42 +01:00
Georg Brandl 2a630a2a52 Fix being able to call arg-less #[new] with any args from Python
Fixes #2748
2022-11-20 08:25:19 +01:00
Georg Brandl 77f5fc107e guide: better document negative index behavior w.r.t. PySequence
Fixes #2601
2022-11-20 08:09:50 +01:00
messense 3408cc4200
Merge pull request #2752 from PyO3/2737-fix
ffi: link to _PyPyBytes_Resize
2022-11-19 23:45:53 +08:00
Georg Brandl 68e82ec962 ffi: link to _PyPyBytes_Resize
Fixes #2737
2022-11-19 12:25:11 +01:00