Paul Stemmet
338c71d0ad
src/impl_: add ff unsafe-allow-subinterpreters
...
Allow the subinterpreter safeguards to be disabled, so that applications
like Ceph's manager can continue to use pyo3 modules without soft
crashing.
Enabling this feature should be done with caution, as any storage of Py
objects in rust statics can lead to undefined behavior.
However, not all consumers of pyo3 use global state, and thus a subset
of them (such as python-bcrypt) are safe to use in subinterpreter
contexts.
References: https://github.com/bazaah/aur-ceph/issues/20
References: https://github.com/PyO3/pyo3/pull/2523
References: https://github.com/pyca/cryptography/issues/9016
References: https://github.com/PyO3/pyo3/discussions/2346#discussioncomment-3246505
References: https://github.com/PyO3/pyo3/discussions/2346#discussioncomment-2911159
References: https://github.com/PyO3/pyo3/issues/3451
Signed-off-by: Paul Stemmet <github@luxolus.com>
2024-03-16 16:12:25 +00:00
David Hewitt
a22e4f6005
release: 0.20.3
2024-02-23 11:59:20 +00:00
David Hewitt
5f65a97bdc
ci: workaround more aggressive nightly rust lints
2024-02-23 11:59:20 +00:00
David Hewitt
2d5a54e4d2
ci: updates for Rust 1.76
2024-02-23 11:59:20 +00:00
David Hewitt
3447f0e77d
fix `either` feature conditional compilation, again ( #3834 )
...
* fix `either` feature conditional compilation, again
* test feature powerset in CI
* install `rust-src` for feature powerset tests
* review: adamreichold feedback
* Fix one more case of redundant imports.
* just check feature powerset for now
---------
Co-authored-by: Adam Reichold <adam.reichold@t-online.de>
2024-02-23 11:59:20 +00:00
David Hewitt
5157a45b39
add maximum Python version check ( #3821 )
...
* add maximum Python version check
* restore dependency of `pyo3-macros-backend` on `pyo3-build-config`
* fix clippy-all noxfile job
2024-02-23 11:59:20 +00:00
Adam Reichold
f7afb8157d
Use portable-atomic for targets which lack 64-bit atomics used to check interpreter ID.
...
I chose to make the dependency mandatory instead of optional as portable-atomic
itself just forwards to the native atomics when they are available so making
that choice part of our build system is not really necessary. Personally, I was
unable to perceive any noticeable compile-time hit from adding it.
2024-02-23 11:59:20 +00:00
David Hewitt
4774ded49a
Merge pull request #3725 from PyO3/release-0.20.2
...
release: 0.20.2
2024-01-04 21:31:43 +00:00
David Hewitt
bcef18b988
release: 0.20.2
2024-01-03 13:20:28 +00:00
Adam Reichold
fa6d60b77e
Use a definite version specification when depending on pyo3-build-config.
...
We already do this for other internal pyo3-* dependencies and it seems prudent
to apply this to pyo3-build-config as well.
2024-01-03 13:14:34 +00:00
Adam Reichold
f9f0bdde70
Merge pull request #3724 from davidhewitt/fix-build-config-issue
...
re-add emit_pyo3_cfgs for pyo3 0.20.0 compatibility
2024-01-03 13:42:40 +01:00
David Hewitt
cf213252fa
re-add emit_pyo3_cfgs for pyo3 0.20.0 compatibility
2024-01-02 20:58:30 +00:00
David Hewitt
f7893858d2
Merge pull request #3722 from PyO3/fix-doc-build
...
Fix missing feature flags in implementation of Either conversion.
2024-01-02 19:52:53 +00:00
Adam Reichold
9120b35f35
Include the experimental-inspect feature for the docs.rs build thereby making it equivalent to a full build.
2024-01-02 18:55:13 +01:00
Adam Reichold
2e79c557cc
Add CI job to test the equivalent of a docs.rs build.
2024-01-02 13:29:06 +01:00
Adam Reichold
2564ca4e75
Fix missing feature flags in implementation of Either conversion.
2024-01-02 09:52:45 +01:00
David Hewitt
be4d5627a3
Merge pull request #3713 from PyO3/release-0.20.1
...
release: 0.20.1
2023-12-30 21:31:58 +00:00
David Hewitt
d3f034a80f
release: 0.20.1
2023-12-30 21:20:06 +00:00
David Hewitt
985412fb8f
ci: updates for Rust 1.75
2023-12-29 23:02:19 +00:00
Adam Reichold
ecb0e9cb61
Copy note on using check_signals on non-main thread/interpreter from Python docs.
2023-12-29 22:59:45 +00:00
Alex Gaynor
b84271140e
Fixes #3645 -- added `abi3-py312` feature
2023-12-29 22:59:22 +00:00
Adam Reichold
d897479831
Fix the Crossbeam ecosystem to point releases before it required Rust 1.61.
2023-12-29 22:52:52 +00:00
Nathan Kent
8f6976d9a5
Enable `GILProtected` access via `PyVisit`
...
Closes #3615
This simply adds a new method which uses the existence of a `PyVisit`
object as proof that the GIL is held instead of a `Python` object. This
allows `GILProtected` to be used in instances where contained Python
objects need to participate in garbage collection. Usage in this
situation should be valid since no Python calls are made and this does
not provide any additional mechanism for accessing a `Python` object.
2023-12-29 22:52:22 +00:00
David Hewitt
5c1e4d10b3
ci: fixup pytests to compile in debug
2023-12-29 22:52:10 +00:00
David Hewitt
1896a32015
ci: refactor pytests dev dependencies
2023-12-29 22:51:45 +00:00
messense
7032789daf
Add additional definitions for `_PyImport_Frozen*`
2023-12-29 22:50:38 +00:00
Alex Gaynor
1166a995a4
Refactor create_type_object so that most of the code is monomorphic
...
In pyca/cryptography this function is the #1 source of lines of generated LLVM IR, because it is duplicated 42x (and growing!). By rewriting it so most of the logic is monomorphic, we reduce the generated LLVM IR for this function by 4x.
2023-12-29 22:50:23 +00:00
David Hewitt
856b859efe
fix test-serde beta clippy warning
2023-12-29 22:50:15 +00:00
David Hewitt
413dda09f5
fix pyo3-ffi beta clippy warnings
2023-12-29 22:50:08 +00:00
David Hewitt
485f5c00e2
ci: run beta clippy as an allowed-to-fail job
2023-12-29 22:50:01 +00:00
Alex Gaynor
830b3bb814
fixes #3561 -- silence new clippy warning
2023-12-29 22:49:42 +00:00
mejrs
405d722a2d
Create subinterpreter example
2023-12-29 22:49:25 +00:00
David Hewitt
b1de927a31
docs: fixup docs for smallvec feature
2023-12-29 22:49:13 +00:00
Ivan Smirnov
2312270ec1
add conversion support for `either::Either`
2023-12-29 22:49:07 +00:00
David Hewitt
e0513d74f5
improve error for invalid `#[classmethod]` receivers
2023-12-29 22:48:25 +00:00
David Hewitt
25b8a37521
remove type_is_pymodule
2023-12-29 22:47:39 +00:00
Joseph Perez
3d17f7442a
fix: replace removed `fmt` session by `rustfmt` and `ruff`
2023-12-29 22:47:27 +00:00
Joseph Perez
466359a1c8
feat: allow `classmethod`/`pass_module` to receive owned types
...
This is necessary for async functions
2023-12-29 22:47:16 +00:00
David Hewitt
9dbd81b47c
enable cargo-semver-checks, try 2
2023-12-29 22:46:49 +00:00
David Hewitt
bbc5404297
ci: move lints to new 1.74 cargo.toml tables
2023-12-29 22:46:39 +00:00
David Hewitt
8d637b0b5b
ci: updates for rust 1.74
2023-12-29 22:46:29 +00:00
David Hewitt
aa6f1466d2
ci: try to run without rust-toolchain.toml
2023-12-29 22:46:23 +00:00
Surya
c8ef081821
fix missing char conversion
2023-12-29 22:45:43 +00:00
David Hewitt
d649f6603f
add link to user guide to cross compile error message
2023-12-29 22:45:35 +00:00
Joseph Perez
b08c92b306
docs: add newsfragment
2023-12-29 22:45:27 +00:00
Joseph Perez
a4aba0a09a
refactor: remove useless `unsafe` in `get_mut`
2023-12-29 22:45:20 +00:00
Joseph Perez
04bb9f2110
feat: add `take` and `into_inner` methods to `GILOnceCell`
2023-12-29 22:45:12 +00:00
Samuel Pastva
10086d176a
Finish rename
2023-12-29 22:44:49 +00:00
Samuel Pastva
15c280015d
Update guide/src/class.md
...
Co-authored-by: Bruno Kolenbrander <59372212+mejrs@users.noreply.github.com>
2023-12-29 22:44:43 +00:00
Samuel Pastva
2aca7f53f0
Add example of dynamic return type in the "Python classes" section of the guide.
2023-12-29 22:44:33 +00:00