-
Notifications
You must be signed in to change notification settings - Fork 0
Updates to better support ormsgpack #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
* ci: run coverage as part of "build" job * merge free-threaded tests into main build jobs * make `test-introspection` jobs only run on PRs if requested * fix 3.7 & 3.8 build error * fix `check-feature-powerset`
bf0afd9 to
cb7a413
Compare
pyo3-ffi/src/cpython/tupleobject.rs
Outdated
| #[cfg(any(GraalPy, PyPy))] | ||
| { | ||
| let previous = PyTuple_GetItem(op, i); | ||
| Py_XDECREF(previous); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto for the two decrefs where there shouldn't be any.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confused myself, changed to Py_XINCREF to counter the decref in PyTuple_SetItem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The memory might be unitialized, the decref in PyTuple_SetItem could segfault. It's unfortunate that we didn't leave any good symbol to use for this. We only have PyTruffleTuple_GetItems, I'm not sure we want to expose that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't be uninitialized though. If it's managed, we used calloc to get it to native, and the native allocator does memset(obj, '\0', size);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's a native subclass it can use its own allocator that doesn't clear the memory. And even when not, the incref afterwards is just a terrible workaround and reliance on implementation details. Could you export a proper function for this on GraalPy side and make this graalpy 25+?
112cd54 to
32b4041
Compare
* First draft for implementing time crate into PyO3 * Refactor FromPyObject for PrimitiveDateTime. Disable proptest * Refactor FromPyObject for OffsetDateTime and UtcDateTime * Create extract_date_time function for reusable code * Fix all proptests * Fix doc test * Add changelog * Downgrade time crate version for msrv. Fix clippy error * Remove UtcDateTime * Fix fmt CI failure * Bring back UtcDateTime. Bump time crate to 0.3.38. Add features doc. * Add time feature to noxfile * use timezone_utc. add const SECONDS_PER_DAY. Revise doc example * Fix FromPyObject for UtcDateTime * `intern` only used on limited api --------- Co-authored-by: Icxolu <[email protected]>
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@v4...v5) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Introspection: add function signatures No annotations or explicit default values yet Fixes an issue related to object identifiers path * Better default value * Refine arguments struct * Introduce VariableLengthArgument * Adds pyfunctions tests * Adds some serialization tests
* release: 0.24.1 * release: 0.24.2
They are available in PyPy3.10 and PyPy3.11.
* remove private types from `pyo3-ffi` * newsfragments * make `PyCodeObject` opaque on all versions * fix msrv * fix msrv, try 2 * remove unused constant * sync `cpython/compile.rs` with header at 3.13 * fix size of INT_MAX * remove `PyCode_GetNumFree`
* Include example of calling with PyDict for kwargs Resolve PyO3#1462 * remove empty line --------- Co-authored-by: Icxolu <[email protected]>
* remove `AsPyPointer` trait * fix typo Co-authored-by: Bruno Kolenbrander <[email protected]> --------- Co-authored-by: Bruno Kolenbrander <[email protected]>
* ci: fix clippy jobs only running Python 3.7 checks * pass correct config file for 3.13t
* Disable positional only test in Python 3.7 * Update pytests/tests/test_pyfunctions.py Co-authored-by: Nathan Goldbaum <[email protected]> * fix ruff --------- Co-authored-by: Nathan Goldbaum <[email protected]>
* Add news item * Move news file * Fix version limit check in noxfile.py * Bump Python version for testing debug builds * 3.14 is available from GH's setup-python action * Bump maximum supported CPython version in pyo3-ffi * Rework PyASCIIObject and PyUnicodeObject to be compatible with 3.14 Due to python/cpython#128196, data types within `PyASCIIObject.state` have changed, resulting in test failures when building against 3.14. * Run `cargo fmt --all` * Actually add Py_3_14 as a legitimate macro When `rustc` is invoked, the macro is included with the `--check-cfg` flag, but not with the `--cfg` flag. This caused errors about duplicate definitions to spew out when building with stable Rust toolchains. * Revert "Actually add Py_3_14 as a legitimate macro" This reverts commit 5da57af. * Fix version macro placement for 3.14-specific getters and setters * Import 'c_ushort' only if compiling against CPython 3.14 or later * Add wrapper functions for the statically_allocated field * Remove unused libc::c_ushort * Add (hopefully) final version-specific macros * Port 3.14-specific 64-bit code of Py_INCREF * Don't expose PyDictObject.ma_version_tag when building against 3.14 or later * fix ffi-check on the GIL-enabled ABI * fix older pythons * fix ffi-check on older pythons * WIP: update for 3.14t * fix ffi-check on the free-threaded build * fix clippy * fix clippy on older python versions * fix cargo check on the MSRV * fix ffi-check on 3.13t * fix CI which is using 3.13.1 * fix copy/paste error in noxfile * update ffi bindings for the latest changes in 3.14 * update layout of refcnt field on gil-enabled build * delete unused HangThread struct * fix ffi-check on GIL-enabled build * Revert "delete unused HangThread struct" This reverts commit 3dd439d. * config-out HangThread * fix 3.13 ffi-check * fix debug python build error * fix graalpy build * Ignore DeprecationWarnings from the pytest_asyncio module in tests * Add abi3-py314 * fix free-threading issue in `test_coroutine` (PyO3#5069) * Introspection: add function signatures (PyO3#5025) * Introspection: add function signatures No annotations or explicit default values yet Fixes an issue related to object identifiers path * Better default value * Refine arguments struct * Introduce VariableLengthArgument * Adds pyfunctions tests * Adds some serialization tests * respond to david's code review * add comment and fix test failure * fix check-feature-powerset * fix clippy * fix wasip1 clippy * fix 32 bit python 3.14 bug * mark test-py step continue-on-error for dev python builds * use github issue URL * run ffi-check before running tests * fix ffi-check for 3.14.0a7 --------- Co-authored-by: Nathan Goldbaum <[email protected]> Co-authored-by: David Hewitt <[email protected]> Co-authored-by: Thomas Tanon <[email protected]>
* introduce `immutable_type` option for pyclasses * allow `immutable_type` from 3.10 on the unlimited api * fix `is_abi3_before` check --------- Co-authored-by: David Hewitt <[email protected]>
* remove FFI definitions of private static variables * newsfragment * revert removal of `_PyWeakRef_RefType` for now
* ci: accept 429 as valid response for external url * fixup syntax
* Add #[track_caller] to with_gil. * Add newsfragment.
* Remove cfg-if dependency. It was only used once. * Add newsfragment.
160af8f to
5f8690c
Compare
* Uncomment initconfig.rs for 3.14 beta1 * Uncomment pyerrors.rs for 3.14 beta 1 * Create 5123.fixed.md
…able (PyO3#5120) * fix `jiff::Zoned` `IntoPyObject` when `zoneinfo` is not available * Fallback on backports.zoneinfo for python <3.9 when converting timezones
…> Python float conversions (PyO3#5114) * Implement OrderedFloat & NotNan conversions for f32 & f64 * Reduce test boilerplate with macros for the wrapper types * Make roundtripped zero test stricter on both Rust & Python side * Simplify conversion implementations using macros * Add documentation for feature * Add newsfragment * Remove unneeded closure * Fix typo * Remove ffi call * Use exact version in Cargo.toml instead of lower bound * Use `py_run!`, `py.eval`, and `py.import` to simplify code * Add type annotations for WASM due to `py_run!` * Change newsfragment filename to use Pull Request ID instead of Issue ID * Add missing #[test] annotation for wasm test
* Fix clippy errors * Add news file * Delete newsfragments/5134.fixed.md
* First attempt at supporting pyclass(generic) * Include class_geitem in macro * Minor formatting * Pass py argument to new() * Add tests covering pyclass(generic) * Add changelog entry * Add test covering __getitem__ * Fix compilation error tests * Fix Alias -> TypingAlias * Make test case slightly stronger * Add compilation error test * Do not allow pyclass(generic) for enums * Remove unused import * Add import only to 3.9+ * Add documentation * Ignore Python typing hints newly added Rust code * Fix clippy warnings for the test * Add newline * Update TRYBUILD tests * Move `generic` in table * TypingAlias is only available in 3.10+ * Update trybuild test
* more format args inlining * cargo fmt * even more inlining * also fix time feature, more coverage
* fix FFI PyUnicode bindings for 3.14.0b1 * Remove PyASCIIObjectState from pyo3-ffi for Py_3_14 * Update pyo3-ffi/src/cpython/unicodeobject.rs Co-authored-by: David Hewitt <[email protected]> --------- Co-authored-by: David Hewitt <[email protected]>
…#5044) * Implement `OnceExt` & `MutexExt` for `parking_lot` & `lock_api` * Implement `MutexExt` for `Arc<lock_api::Mutex>` * Move `MutexExt` lock result into type parameter * Remove lifetime from associated type of `OnceExt` * Add docs * add changelog * Add new features to `full` * mention `parking_lot` in guide * Add tests * Update docs to mention all cargo features Co-authored-by: Nathan Goldbaum <[email protected]> * Also test `parking_lot::Mutex::lock_py_attached` on `lock_api` feature * Update newsfragments/5044.added.md Co-authored-by: Nathan Goldbaum <[email protected]> * Add additional case to `once_ext` test * enable `arc_lock` feature on `parking_lot` during testing --------- Co-authored-by: Nathan Goldbaum <[email protected]>
* ci: fixup verbosity & install zoneinfo backport on <3.9 * correct typo * try different syntax for `verbose`
* Implements basic method introspection * Code review feedback * Fixes CI
5f8690c to
2c9ff86
Compare
2c9ff86 to
75198eb
Compare
75198eb to
e12a0b8
Compare
e12a0b8 to
57349c3
Compare
@msimacek These changes make the diff for supporting ormspack significantly smaller, can you check if you see any issues proposing this upstream?
This will also reduce the orjson diff a good chunk