Commit Graph

5313 Commits

Author SHA1 Message Date
David Hewitt 14c4dc8855 readme: add media June 2023 2023-06-07 21:05:13 +01:00
David Hewitt c1a0b8836d
Merge pull request #3214 from davidhewitt/pypy-3-10-ci
ci: add pypy3.10-nightly
2023-06-07 08:06:46 +00:00
David Hewitt a1f0d91a67 ci: add pypy3.10-nightly 2023-06-07 08:40:47 +01:00
David Hewitt 7a5ea8cf69
Merge pull request #3212 from davidhewitt/merge-queue-fixup
fix usage for paths-filter in merge_group
2023-06-06 20:06:56 +00:00
David Hewitt 05b97dd964 fix usage for paths-filter in merge_group 2023-06-06 08:22:20 +01:00
David Hewitt 342e4ca678
Merge pull request #3206 from davidhewitt/gh-merge-queue
add github merge queue support
2023-06-06 06:32:05 +00:00
bors[bot] 894b62fba7
Merge #3211
3211: Enable v2 resolver on the workspace to enable dropping PYO3_CI workaround r=davidhewitt a=adamreichold



Co-authored-by: Adam Reichold <adam.reichold@t-online.de>
2023-06-05 18:47:00 +00:00
bors[bot] 4ca33645c8
Merge #3210
3210: Drop the xtask helper as it is superseded by Nox. r=davidhewitt a=adamreichold

While the xtask code base is better engineered than our slightly messy Nox manifest, all functionality is available via Nox including some that is not available via xtask. Finally, only the Nox sessions are used in the CI by now so that xtask does not see regular automated usage.

Co-authored-by: Adam Reichold <adam.reichold@t-online.de>
2023-06-05 17:26:21 +00:00
Adam Reichold f6e1f26676 Enable v2 resolver on the workspace to enable dropping PYO3_CI workaround. 2023-06-05 18:54:35 +02:00
Adam Reichold 1fad3916db Add docs session to Nox's default session to more closely mirror the CI. 2023-06-05 18:36:50 +02:00
Adam Reichold b816d4d561 Drop the xtask helper as it is superseded by Nox.
While the xtask code base is better engineered than our slightly messy Nox
manifest, all functionality is available via Nox including some that is not
available via xtask. Finally, only the Nox sessions are used in the CI by now so
that xtask does not see regular automated usage.
2023-06-05 17:41:41 +02:00
Adam Reichold f1b6cb9256 Add Nox session to build docs providing a replace for doc xtask subcommand. 2023-06-05 17:35:32 +02:00
Adam Reichold 1378dd58b6 Remove sleeps between publishing as cargo will do that itself by now. 2023-06-05 17:14:12 +02:00
bors[bot] e1f028f3e5
Merge #3209
3209: Remove the conditional compilation flags which are made redundant  by the MSRV bump r=davidhewitt a=adamreichold



Co-authored-by: Adam Reichold <adam.reichold@t-online.de>
2023-06-05 14:09:05 +00:00
Adam Reichold edf50eec17 Bump proptest which is possible after the MSRV bump. 2023-06-05 15:10:00 +02:00
Adam Reichold 5d4ce5799a Drop usage of rustversion from xtask. 2023-06-05 15:10:00 +02:00
Adam Reichold eb292711a7 Drop test indirection required only until Rust 1.54. 2023-06-05 12:43:15 +02:00
Adam Reichold 6f987263c1 Remove cfg addr_of made unnecessary by MSRV bump. 2023-06-05 11:12:06 +02:00
Adam Reichold eb04f54683 Remove cfg min_const_generics made unnecessary by MSRV bump. 2023-06-05 09:42:40 +02:00
Adam Reichold f7bd6ce224 Remove cfg option_insert made unnecessary by MSRV bump. 2023-06-05 09:37:13 +02:00
Adam Reichold b49e401319 Remove unmatched cfg and unused rustup component. 2023-06-05 09:36:13 +02:00
bors[bot] dbf7b233aa
Merge #3203
3203: support ordering magic methods for `#[pyclass]` r=adamreichold a=davidhewitt

Closes #2089 

This adds `__lt__`, `__le__`, `__eq__`, `__ne__`, `__gt__`, and `__ge__` as per the Python implementations of what we call `__richcmp__`.

There's a UI test confirming that the user cannot implement split forms and `__richcmp__` simultaneously.

There's also a benchmark comparing implementing these split methods against using `__richcmp__`. I couldn't see a meaningful performance difference, so I'm tempted to deprecate `__richcmp__`, given that's not a magic method which exists in Python. Potentially we can provide options such as the opt-in `#[pyclass(eq, ord)]` to avoid boilerplate for people who don't want to implement six different methods.



Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2023-06-05 07:13:23 +00:00
bors[bot] 3332f31339
Merge #3208
3208: bump msrv to 1.56 r=davidhewitt a=davidhewitt

The MSRV changes from #3204, plus a commit which should hopefully make CI pass.

With luck this is mergeable and resolves CI pain while we decide what to do about the Python version.

Co-authored-by: Adam Reichold <adam.reichold@t-online.de>
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2023-06-05 06:26:31 +00:00
David Hewitt 5bc3e6f15e fix clippy warnings uncovered by msrv bump 2023-06-05 07:08:27 +01:00
David Hewitt 1bbd556718 run cargo check instead of clippy for MSRV in CI 2023-06-04 23:15:59 +01:00
Adam Reichold 5738edfdd4 Bump MSRV to 1.56 2023-06-04 23:02:30 +01:00
David Hewitt a70e3983b4 add github merge queue support 2023-06-04 19:36:28 +01:00
David Hewitt 8850d5d384 support ordering magic methods for `#[pyclass]` 2023-06-04 13:58:18 +01:00
bors[bot] 6b85130078
Merge #3200
3200: RFC: remove copyright headers from source files r=davidhewitt a=davidhewitt

As part of our relicensing effort - I've observed that over time we haven't applied COPYRIGHT headers consistently to source files.

I've seen different organisations take different approaches to this. I note that for [`rust-lang/rust`, headers only exist where code has been moved inside the Rust repo without relicensing](https://github.com/search?q=repo%3Arust-lang%2Frust+copyright+language%3ARust&type=code&l=Rust).

For PyO3, I suggest we follow this and remove COPYRIGHT headers from source. We may wish to consider attributing to `rust-cpython` as the original project from which PyO3 was forked, possibly in the License section of the readme?

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2023-06-03 21:40:16 +00:00
David Hewitt 45b5ede26a remove copyright headers from source files 2023-06-03 22:38:54 +01:00
bors[bot] fa949ff627
Merge #3198
3198: Add abi3 + num_bigint conversion r=davidhewitt a=youknowone

<!--
Please consider adding the following to your pull request:
 - an entry for this PR in newsfragments - see [https://pyo3.rs/main/contributing.html#documenting-changes]
 - docs to all new functions and / or detail in the guide
 - tests for all new or changed functions

PyO3's CI pipeline will check your pull request. To run its tests
locally, you can run ```cargo xtask ci```. See its documentation
 [here](https://github.com/PyO3/pyo3/tree/main/xtask#readme).
-->

Fix #3196

Co-authored-by: Jeong YunWon <jeong@youknowone.org>
2023-06-02 19:06:50 +00:00
bors[bot] 95bc6d88b7
Merge #3185
3185: Fix `abi3` conversion of `__complex__` classes r=adamreichold a=jakelishman

Python classes that were not `complex` but implemented the `__complex__` magic would have that method called via `PyComplex_AsCComplex` when running against the full API, but the limited-API version `PyComplex_RealAsDouble` does not attempt this conversion.  If the input object is not already complex, we can call the magic before proceeding.

Happy to modify if I've made a mess of testing strategy - I'm not sure I've managed to do it in the same style as other tests.

Fix #3164.


Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
2023-06-02 16:47:24 +00:00
bors[bot] c94d162403
Merge #3199
3199: update PR template to detail state of licensing r=davidhewitt a=davidhewitt

Adds detail about #3108 to the README and the PR template.

`@DataTriny` - I thought that adding this would help encourage new contributors to be aware of the licensing terms and also that they would need to explicitly accept the future license.

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2023-06-02 16:03:46 +00:00
Jake Lishman 8d98b4248e
Fix `abi3` conversion of `__complex__` classes
Python classes that were not `complex` but implemented the `__complex__`
magic would have that method called via `PyComplex_AsCComplex` when
running against the full API, but the limited-API version
`PyComplex_RealAsDouble` does not attempt this conversion.  If the input
object is not already complex, we can call the magic before proceeding.
2023-06-02 10:09:45 +01:00
Jake Lishman 194d0c791f
Add `PyAny::lookup_special`
`PyAny::lookup_special` is an approximate equivalent to the CPython
internal `_PyObject_LookupSpecial`, which is used to resolve lookups of
"magic" methods.  These are only looked up from the type, and skip the
instance dictionary during the lookup.  Despite this, they are still
required to resolve the descriptor protocol.

Many magic methods have slots on the `PyTypeObject` or respective
subobjects, but these are not necessarily available when targeting the
limited API or PyPy.  In these cases, the requisite logic can be worked
around using safe but likely slower APIs.

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>

Fix up lookup-special
2023-06-02 10:09:45 +01:00
Jeong YunWon 6d830e05cd Add abi3 + num_bigint conversion 2023-06-02 16:17:49 +09:00
David Hewitt 3ac0f16247 update PR template to detail state of licensing 2023-06-02 08:09:22 +01:00
bors[bot] 451729aef0
Merge #3187
3187: release: 0.19.0 r=davidhewitt a=davidhewitt

As per #3154 I think we're ready to push 0.19.

I'll put this live on Tuesday evening unless I hear a reason to postpone.

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2023-05-31 15:00:27 +00:00
David Hewitt 2500e22e13 release: 0.19.0 2023-05-31 13:53:37 +01:00
bors[bot] c7dd2e3cd7
Merge #3194
3194: pin chrono for msrv build r=davidhewitt a=davidhewitt

Closes #3193 


Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2023-05-30 15:02:37 +00:00
David Hewitt c928a7a384 pin chrono for msrv build 2023-05-30 15:12:48 +01:00
bors[bot] 03137e411e
Merge #3188
3188: Verify that macros do work without any imports r=adamreichold a=lifthrasiir

Currently virtually all (positive) tests import `pyo3::prelude::*`, making it hard to detect a certain class of bugs. This PR adds an explicit test that never imports from `pyo3` to fix this.

Also this fixes a minor bug from #3157 which didn't work without `use pyo3::types::PyType;`. I think this should be a part of 0.19.0 (#3187), so no additional changelog would be required (as this feature is new in 0.19.0).


Co-authored-by: Kang Seonghoon <public+git@mearie.org>
2023-05-29 07:29:08 +00:00
Kang Seonghoon c2d4e8ad1f Use a full path for `#[new]` method which is also `#[classmethod]`. 2023-05-29 11:01:48 +09:00
Kang Seonghoon d930bc14d9 Verify that various macros do work without any PyO3 imports. 2023-05-29 11:01:48 +09:00
bors[bot] cd4b27ff5f
Merge #3183
3183: Add benchmark showing that extract::<i64> is costly due to PyNumber_Index trying hard. r=davidhewitt a=adamreichold

The benchmarks from #3182 to keep around for later and to play around with.

Co-authored-by: Adam Reichold <adam.reichold@t-online.de>
2023-05-26 08:28:52 +00:00
Adam Reichold f0b7399705 Add benchmark showing that extract::<i64> is costly due to PyNumber_Index trying hard. 2023-05-26 07:47:45 +02:00
bors[bot] 0e50338675
Merge #3171
3171: RFC: Simplify version handling of UI tests. r=davidhewitt a=adamreichold

 Due to checking in error outputs these tests only work reliably on stable and not on intermediate version between our MSRV (currently 1.48) and the current stable version.

Hence this simplifies things to run only MSRV-compatible tests for the MSRV builds, anything else for stable builds except for those tests which require the nightly feature, i.e. the `Ungil` being distinct from the `Send` trait.

Finally, `not_send3` is disabled when using the nightly feature since while `Rc` is not send, it also not GIL-bound and hence can be passed into `allow_threads` as it does not actually spawn a new thread.


Co-authored-by: Adam Reichold <adam.reichold@t-online.de>
2023-05-25 20:20:49 +00:00
Adam Reichold 0f628c942d Be more explicit of the soundness hole implied by tying Ungil to Send and mention the available solution. 2023-05-25 21:37:33 +02:00
Adam Reichold 4fc7b5a6e0 Manually link to the send_wrapper crate to avoid having it as a build dependencies for the docs. 2023-05-25 21:37:33 +02:00
Adam Reichold 90fcc63eda Replace the nightly UI tests by doctests since we cannot keep up with the changing error outputs of nightly in any case. 2023-05-25 21:37:32 +02:00