Commit graph

5303 commits

Author SHA1 Message Date
mejrs 530c5b3193 Fix changelog 2022-12-29 15:13:38 +01:00
mejrs 8f51142013 Add changelog 2022-12-28 23:13:55 +01:00
mejrs 5198722dd9 Add test 2022-12-28 23:11:39 +01:00
bors[bot] 688c7dcebd
Merge #2844
2844: update URL in comment to point at correct place r=adamreichold a=alex



Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2022-12-28 19:49:00 +00:00
Alex Gaynor 4875e4b6bf update URL in comment to point at correct place
The branch has drifted and those line ranges are no longer accurate.
2022-12-28 20:48:11 +01:00
bors[bot] cedb5aecb2
Merge #2843
2843: remove functionality deprecated in 0.16 r=davidhewitt a=davidhewitt

Simple cleanup to remove all functionality marked deprecated in the 0.16 releases.

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-12-28 12:24:59 +00:00
David Hewitt f2608a923c remove functionality deprecated in 0.16 2022-12-28 12:23:53 +00:00
bors[bot] c2adf14f69
Merge #2842
2842: Stop leaking in `new_closure` r=adamreichold a=davidhewitt

This is a rebase of #2690 which simplifies the `MaybeLeaked` abstraction from that PR with just `Cow<'static, CStr>`.

This enabled me to annotate with `FIXME` all the places where we still leak; I wonder if we could potentially use `GILOnceCell` in future and statics to avoid those. As those callsities are in `#[pyclass]` and `#[pyfunction]` these are effectively in statics anyway, but it would be nice to tidy up.


Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-12-28 08:13:58 +00:00
David Hewitt 1e8206c0b8 Stop leaking in new_closure 2022-12-28 07:51:50 +00:00
bors[bot] 31c42cc2c8
Merge #2838
2838: pypy: re-enable PyFunction on 3.8+ r=davidhewitt a=davidhewitt

PyPy [fixed the crashes associated with `PyFunction](https://foss.heptapod.net/pypy/pypy/-/issues/3776#note_191626)  in PyPy 7.3.10 (for 3.8+) - which I think is to be released shortly. So I think we should re-enable this API and treat it as a PyPy bug which users can mitigate by updating their PyPy.

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-12-27 21:40:57 +00:00
bors[bot] 8c8a576b2d
Merge #2841
2841: correct changelog for 2772 r=mejrs a=davidhewitt

`@mejrs` how's this?

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-12-27 20:21:52 +00:00
David Hewitt f24b1370b6
correct changelog for 2772 2022-12-27 20:14:21 +00:00
bors[bot] 1598991a05
Merge #2772
2772: fix PyUnicodeDecodeError_Create r=davidhewitt a=mejrs

Fixes https://github.com/PyO3/pyo3/issues/2770

Co-authored-by: mejrs <>
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-12-27 16:22:58 +00:00
David Hewitt 5fcc8741e0 add changelog for 2772 2022-12-27 16:19:18 +00:00
mejrs faa578a7c5 fix PyUnicodeDecodeError_Create 2022-12-27 16:13:32 +00:00
David Hewitt 24032fe110 pypy: re-enable PyFunction on 3.8+ 2022-12-27 14:32:43 +00:00
bors[bot] 14d61e6c3e
Merge #2837
2837: netlify: fix examples option on latest nightly r=davidhewitt a=davidhewitt

Looks like `-Zrustdoc-scrape-examples` no longer needs `=examples` value.

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-12-27 13:22:05 +00:00
David Hewitt 850c21ab39 netlify: fix examples option on latest nightly 2022-12-27 13:07:03 +00:00
bors[bot] af2ad45c73
Merge #2833
2833: ci: fix flaky test_pyobject_drop_without_gil_doesnt_decrease_refcnt r=adamreichold a=davidhewitt

Closes #2723 

I think `@adamreichold` is correct in what causes the flakiness, and the solution in this case seems straightforward enough - just pass `reference` off to another thread to drop it (as that thread won't have the GIL), no events needed.

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-12-27 00:17:43 +00:00
David Hewitt 30c66fdb8b ci: fix flaky test_pyobject_drop_without_gil_doesnt_decrease_refcnt 2022-12-27 00:49:54 +01:00
bors[bot] 75ca1b2823
Merge #2398
2398: Add `GILOnceCell::get_or_try_init` r=mejrs a=a1phyr

This is similar to [`OnceCell::get_or_try_init`](https://docs.rs/once_cell/latest/once_cell/sync/struct.OnceCell.html#method.get_or_try_init) and is very useful for fallible initialization.

Co-authored-by: Benoît du Garreau <bdgdlm@outlook.com>
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-12-26 21:18:23 +00:00
David Hewitt a47079d858 move GILOnceCell initialization detail to the type-level docs 2022-12-26 20:38:25 +00:00
Benoît du Garreau 01fcfedbe5 Add GILOnceCell::get_or_try_init 2022-12-26 20:28:18 +00:00
bors[bot] 2430556235
Merge #2832
2832: newsfragments: remove incorrect fragment r=davidhewitt a=davidhewitt

Accidentally left this entry in #2826 after splitting out #2827.

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-12-26 20:27:39 +00:00
David Hewitt 75a120ced6 newsfragments: remove incorrect fragment 2022-12-26 20:26:06 +00:00
bors[bot] 96dd88b4b1
Merge #2831
2831: add gh-pages content directly in netlify site r=davidhewitt a=davidhewitt

Last attempt to find a solution for #2819.

By adding the GitHub pages content directly to the netlify site during build, netlify should be able to make better URL redirects.

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-12-26 12:55:11 +00:00
David Hewitt 20a7087ee0 add gh-pages content directly in netlify site 2022-12-26 12:47:57 +00:00
bors[bot] 097af010e2
Merge #2813
2813: ci: run pyo3-ffi-check using nox r=davidhewitt a=davidhewitt

Makes it easier to run pyo3-ffi-check locally :)

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-12-26 10:02:54 +00:00
David Hewitt 87b6a9bd92 ci: run pyo3-ffi-check using nox 2022-12-26 08:50:33 +00:00
bors[bot] e5cf1cb971
Merge #2826
2826: ci: run checks for all platforms on PR r=adamreichold a=davidhewitt

I've been struggling a little to merge PRs with the new bors workflow; overall I think the lighter PR workflow is better but the number of combinations of older pythons / platforms not covered makes it easy for the bors step to fail.

This PR tries to improve the situation by merging the `clippy` and `check-target` job and running it for all supported platforms on PR. Hopefully if these are green, then there's high likelihood that tests will build and should pass unless there's logic errors.

While creating this I found a build error on PyPy which made me notice we can support `PyList::get_item_unchecked` for PyPy, so I added it.

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-12-25 21:02:22 +00:00
David Hewitt 710c895d01 ci: run checks for all platforms on PR 2022-12-25 20:02:21 +00:00
bors[bot] e5ae4e266b
Merge #2784 #2827
2784: Automatically generate `__text_signature__` for all functions r=davidhewitt a=davidhewitt

This PR makes it so that PyO3 generates `__text_signature__` by default for all functions. It also introduces `#[pyo3(text_signature = false)]` to disable the built-in generation.

There are a few limitations which we can improve later:
 - All default values are currently set to `...`. I think this is ok because `.pyi` files often do the same. Maybe for numbers, strings, `None` and `True`/`False` we could render these in a future PR.
 - No support for `#[new]` yet.

Alternative design ideas:
- Only autogenerate for methods with `#[pyo3(signature = (...))]` annotation. I started with this, and then decided it made sense to do it for everything.
- Opt-out with `#[pyo3(text_signature = None)]`. This is slightly harder to parse in the macro, but matches the final result in Python better, so if this looks preferable to others, I can change from `text_signature = false` to `text_signature = None`.

There's some small tidying up / refactoring to do before this merges (happy to take suggestions on this), however the general logic, design and docs are ready for review.


2827: pypy: enable `PyList::get_item_unchecked` r=adamreichold a=davidhewitt

Split out from #2826. Approved previously as part of that review.

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-12-25 19:45:50 +00:00
bors[bot] b2906cf678
Merge #2828
2828: move set-minimal-package-versions to nox r=adamreichold a=davidhewitt

Split from #2826 because #2827 couldn't merge due to `hermit-abi` MSRV break, which this PR also fixes (by pinning its dependent `num_cpus` back). 

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-12-25 19:05:36 +00:00
David Hewitt bd2dc0835b move set-minimal-package-versions to nox 2022-12-25 19:04:56 +00:00
David Hewitt 010dd509d7 pypy: enable PyList::get_item_unchecked 2022-12-25 08:45:36 +00:00
David Hewitt 5039fd746a add automatic text signature generation 2022-12-24 09:43:02 +00:00
bors[bot] 0f70fc6e0c
Merge #2820
2820: netlify: remove trailing slash rewrites r=davidhewitt a=davidhewitt

So adding rewrite rules in #2819 didn't work, created infinite redirect loops. Instead I've enabled the pretty URLs at https://docs.netlify.com/routing/redirects/redirect-options/#trailing-slash, let's see if that works.

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-12-18 22:20:43 +00:00
bors[bot] 9082c5c7b4
Merge #2821
2821: ci: pin more to 3.11.0 r=davidhewitt a=davidhewitt

Still getting some windows failures due to #2817. Pin more stuff for now :(

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-12-18 21:06:45 +00:00
David Hewitt 3fc9c9ad95 ci: pin more to 3.11.0 2022-12-18 09:57:30 +00:00
David Hewitt 56f132599b netlify: remove trailing slash rewrites 2022-12-18 08:49:45 +00:00
bors[bot] 81db4cff0d
Merge #2818 #2819
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>
2022-12-18 07:57:56 +00:00
David Hewitt fe14d760a1 netlify: add some missing redirects 2022-12-18 07:54:55 +00:00
David Hewitt b6874b8280 pin CI to 3.11.0 as workaround for 2817 2022-12-18 07:36:19 +00:00
bors[bot] 203ac5d778
Merge #2811
2811: adjust vectorcall symbols for pypy r=davidhewitt a=davidhewitt

Closes #2738

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-12-17 11:08:00 +00:00
David Hewitt 4a6b24ea07 adjust vectorcall symbols for pypy 2022-12-17 11:07:30 +00:00
bors[bot] 239f8e67b8
Merge #2800
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>
2022-12-17 09:51:04 +00:00
bors[bot] 0c686c0db5
Merge #2805
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>
2022-12-17 07:24:45 +00:00
David Hewitt 9e04398a5e check changelog using nox 2022-12-17 07:23:22 +00:00
David Hewitt 33871b7aea allow **kwargs to take arguments which conflict with positional-only parameters 2022-12-17 07:22:28 +00:00
bors[bot] 7180a0b77c
Merge #2810
2810: CI updates for Rust 1.66 r=davidhewitt a=davidhewitt



Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-12-17 06:16:43 +00:00