2818: pin CI to 3.11.0 as workaround for 2817 r=davidhewitt a=davidhewitt
While we have issues with 3.11.1, let's run 3.11.0 for now in tests so that we can make progress.
2819: netlify: add additional redirects to gh-pages r=davidhewitt a=davidhewitt
Just noticed that https://pyo3.rs/dev/bench has probably been broken since the move to netlify, and that https://pyo3.rs/v0.17.3 doesn't render nicely.
Add some redirects to netlify configuration to handle these cases.
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2800: allow `**kwargs` to take arguments which conflict with positional-only parameters r=davidhewitt a=davidhewitt
Closes#2799
I did a little bit of refactoring at the same time, sorry! The bit which changes behaviour is that in the now-factored-out `handle_kwargs` method, if the keyword argument name is found in the positional-only range then the varkeywords handler is now given a chance to accept it. (Lines 387-390 in new `extract_argument.rs`.)
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2805: check changelog using nox r=messense a=davidhewitt
I wanted to get the green tick when the `CI-skip-changelog` label was applied 😝
... and I didn't think it hurt to use the same tech we use for the rest of the pipeline.
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2806: add .python-version file r=messense a=davidhewitt
This looks like it's recommended for `actions/setup-python` if we don't specify a version in the CI.yml
It may also be helpful for contributors testing using pyenv?
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2795: accept any iterator for `PySet::new` and `PyFrozenSet::new` r=birkenfeld a=davidhewitt
Closes#2789
Looks like it's about 20% faster in the case I benchmarked to use `PySet_Add` directly without the intermediate list.
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
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>
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.
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>
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>
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>
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>
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.