-
Notifications
You must be signed in to change notification settings - Fork 967
Opaque PyObject ABI support #5807
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
Open
ngoldbaum
wants to merge
215
commits into
PyO3:main
Choose a base branch
from
ngoldbaum:opaque-pyobject
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
215 commits
Select commit
Hold shift + click to select a range
eb53c2d
Use PyModExport and PyABIInfo APIs in pymodule implementation
ngoldbaum e41b509
Add PyModExport function
ngoldbaum 91becaf
DNM: temporarily disable append_to_inittab doctest
ngoldbaum 1020688
fix issues seen on older pythons in CI
ngoldbaum 3afa9ae
fix incorrect ModuleDef setup on 3.15
ngoldbaum f8d6cae
Expose both the PyInit and PyModExport initialization hooks
ngoldbaum a590874
fix clippy
ngoldbaum a96219f
add changelog entry
ngoldbaum e7ac9c0
try use only slots for both init hooks on 3.15
ngoldbaum d981be7
Always pass m_name and m_doc, following cpython-gh-144340
ngoldbaum 55b6acd
WIP: opaque pyobject support (without Py_GIL_DISABLED)
ngoldbaum 733aa82
delete debug prints
ngoldbaum c43061e
WIP: fix segfault
ngoldbaum 3812a64
disable append_to_inittab tests
ngoldbaum 25a65a6
fix clippy
ngoldbaum 4a83024
fix ruff
ngoldbaum 9d0e2ed
implement David's suggestion for pyobject_subclassable_native_type
ngoldbaum a78b5df
replace skipped test with real test
ngoldbaum 42a73e1
fix check-feature-powerset
ngoldbaum 060c3ca
fix clippy-all
ngoldbaum c1bd2c7
skip test that depend on struct layout on opaque pyobject builds
ngoldbaum ba8b09a
Expose PyModuleDef as an opaque pointer on opaque PyObject builds
ngoldbaum f15a7fc
add comments about location of opaque pointers in CPython headers
ngoldbaum 3fa17d0
fix test_inherited_size
ngoldbaum 1970421
Fix doctest on _Py_OPAQUE_PYOBJECT builds
ngoldbaum 57c2045
Merge branch 'main' into opaque-pyobject
ngoldbaum f80849e
fix build error on non-opaque builds
ngoldbaum c0805a9
mark BaseWithoutData as subclassable
ngoldbaum 719cef5
relax assert for Windows
ngoldbaum 072ef0a
Make PyAny a PyVarObject only on the opaque PyObject build
ngoldbaum 0b743b6
Merge branch 'main' into opaque-pyobject
ngoldbaum 264307f
fix merge conflict resolution error
ngoldbaum ed48e75
fix buggy assertion
ngoldbaum b4138c4
Expose critical section in the limited API starting in Python 3.15
ngoldbaum f3ee6af
expose critical section API in limited API
ngoldbaum ba47f50
disable warning in pyo3-ffi build script on sufficiently new Pythons
ngoldbaum e52cb59
fixup features
ngoldbaum 3cf60b1
Add missing error handling for `PyModule_FromSlotsAndSpec`
ngoldbaum 607e4b0
Merge branch 'main' into expose-critical-section
ngoldbaum 449eb8a
passes cargo tests with the abi3t feature enabled
ngoldbaum 5371fd8
passes unit tests on GIL-enabled build with abi3t feature
ngoldbaum 19d78d2
fix merge mistake
ngoldbaum 14bf4d1
rustfmt
ngoldbaum 91a0419
fix FIXME
ngoldbaum 285e79c
Merge branch 'main' into opaque-pyobject
ngoldbaum 9f23720
replace extern "C" with extern_libpython!
ngoldbaum d38c274
fix test
ngoldbaum e2d8f8c
Merge branch 'opaque-pyobject' into expose-critical-section
ngoldbaum 15ff21c
fix merge error
ngoldbaum 930e1a9
Allow abi3t builds without critical section bindings
ngoldbaum a609f8c
add FIXME
ngoldbaum dd5b3a9
remove default feature
ngoldbaum 7419b86
fix syntax error in noxfile
ngoldbaum 603aaf9
fix issues spotted by clippy
ngoldbaum c9b9157
bring over refactoring from PyO3 PR
ngoldbaum 7560348
working!
ngoldbaum becc8af
Fix memory leak of iterator
ngoldbaum b734e77
fix size hints
ngoldbaum a6c8710
delete debug statement
ngoldbaum a827be9
Use Py_TARGET_ABI3T
ngoldbaum 0ceda48
run formatter
ngoldbaum d1ef669
fix check-feature-powerset
ngoldbaum 26c7dc0
increment SUPPORTED_VERSIONS_CPYTHON.max
ngoldbaum 95ca7d2
fix conditional compilation for critical section API
ngoldbaum b596885
fix ruff
ngoldbaum 22a5332
fix incorrect conditional compilation guargs
ngoldbaum ec1269a
fix noxfile and ban abi3t builds on 3.14 and older
ngoldbaum 04eb8bb
ruff format
ngoldbaum 101949c
attempt to fix semver-checks
ngoldbaum 828afdd
fix test-version-limits
ngoldbaum cd78153
fix issues spotted by claude
ngoldbaum 5e5671e
strip 't' for version parsing
ngoldbaum 266527f
Adjust comments and error messages
ngoldbaum 294a4f0
fix compiler warning
ngoldbaum b37445d
more noxfile fixes
ngoldbaum a2584f5
fix ruff
ngoldbaum 1b5ec7a
use a 3.15 interpreter to run the feature-powerset tests
ngoldbaum 553ef54
fix a few more issues caught by claude
ngoldbaum 2f755ae
add comment
ngoldbaum f326c74
Merge branch 'main' into opaque-pyobject
ngoldbaum 710e835
use correct windows library name for abi3t
ngoldbaum 861edd8
try to fix linking
ngoldbaum c8e40b9
add CPythonABI enum for pyo3-build-config InterpreterConfig
ngoldbaum 45d5cc1
add release note
ngoldbaum e3dc133
store ABI details in a new PythonAbi struct
ngoldbaum 966a82f
fix nox config file
ngoldbaum 9d9a0e2
fix ffi-check
ngoldbaum f52f1d8
Refactor to use the builder pattern for InterpreterConfig
ngoldbaum 77039d2
revert noxfile change
ngoldbaum 0765953
fix clippy-all
ngoldbaum cde688c
fix build-config test
ngoldbaum b11b262
Fix issues linking against onld stable ABI versions
ngoldbaum 9cb420a
remove load-bearing debug impls
ngoldbaum 7fe98ab
fix issue with InterpreterConfig::from_interpreter never returning an…
ngoldbaum 41be837
fix clippy lint
ngoldbaum 58162a4
fix PythonAbiBuilder::from_build_env
ngoldbaum 48a7d20
Only target abi3 for non-free-threaded builds
ngoldbaum c899390
fix logic error in InterpreterConfig::from_reader
ngoldbaum e0c8826
Merge branch 'abi-tag-refactor' into opaque-pyobject
ngoldbaum 942ecc9
smooth over merge
ngoldbaum 90bef3c
tests pass
ngoldbaum ea2eab7
Add stub abi3t implementation
ngoldbaum 8354ef7
Improve test coverage
ngoldbaum 6854756
fix clippy
ngoldbaum 3a21665
fix 3.14t abi3 builds being a no-op
ngoldbaum 97087aa
fix ffi-check to account for private _tp_iteritem PyTypeObject slot
ngoldbaum 80a591c
expose the critical section API
ngoldbaum be1b77f
Add initial support for Python 3.15.0b1
ngoldbaum 090d11d
fix ffi docstring example
ngoldbaum 81daf34
typo fix
ngoldbaum 3ce9275
fix ffi-check macro
ngoldbaum 4763179
fix ffi examples
ngoldbaum b6d6f99
make PySlot_FUNC a Rust macro
ngoldbaum 4828759
fix clippy
ngoldbaum 1e2a2c3
keep macros version-independent
ngoldbaum ecc365a
format extern_libpython blocks
ngoldbaum 14c80db
use an explicit type in the PySlot_FUNC macro
ngoldbaum af92c51
fix issues seen in CI builds on older Pythons
ngoldbaum 17583a8
fix one more spot in the ffi tests
ngoldbaum 1caf685
fix type error in string-sum implementation
ngoldbaum 85bc302
add changelog entries
ngoldbaum 75b8962
remove unnecessary PartialEq implementation
ngoldbaum cbedefc
use std::slice::from_raw_parts instead of libc::memcmp
ngoldbaum ec46a20
re-add incorrectly deleted end slot
ngoldbaum 63486a3
Use PartialEq on Python 3.14 and older
ngoldbaum f4e86f7
fix compiler error due to missing Debug impl
ngoldbaum ee68ff0
Finish updating slots_generated and adjust types for slot IDs
ngoldbaum 816fd56
add missing cfg gate
ngoldbaum 8e04584
remove unused import
ngoldbaum 1e073e7
Merge branch 'main' into abi-tag-refactor
ngoldbaum 8fd0acb
make InterpreterConfigBuilder.extra_build_script_lines a Vec
ngoldbaum 7d5881c
Add an abi3 version sanitization function, adjust error handling
ngoldbaum 5c73549
Adjust comment fragment, add TODO
ngoldbaum 1e71ed4
apply focused comments from self-review
ngoldbaum b3ef667
simplify modeling of free-threaded builds and Py_GIL_DISABLED build flag
ngoldbaum df3bf04
fix clippy
ngoldbaum fbacc26
relax accepting Py_GIL_DISABLED in build_flags if no target ABI is set
ngoldbaum 0efa792
more fixes and suggestions from claude
ngoldbaum 766ecbf
fix fallback to version-specific builds for free-threaded abi3 builds
ngoldbaum deb83a7
More minor fixes
ngoldbaum 9174ca7
expand test coverage
ngoldbaum 01a6b0a
more fixes
ngoldbaum b8b5bff
update changelog entries
ngoldbaum 285eb19
Add missing exports to public pyo3-build-config API
ngoldbaum 95be8d0
fix linux test
ngoldbaum 9a33592
minor touch-ups
ngoldbaum 0c7b53a
minor touch-ups
ngoldbaum 505d9e1
skip redundant test
ngoldbaum 20c8f57
whitespace
ngoldbaum afd0eec
more tweaks
ngoldbaum b40805a
grammar in comment
ngoldbaum 4dba451
Merge branch 'pep-820' into opaque-pyobject
ngoldbaum 107ab27
fix cfg gating
ngoldbaum 5334eaa
activate abi3t builds
ngoldbaum 92ad56c
Merge branch 'abi-tag-refactor' into opaque-pyobject
ngoldbaum 12fa458
fix PyMutex gating
ngoldbaum 9337202
simplify windows stable ABI lib name text manipulation
ngoldbaum f76a5c8
Merge branch 'main' into opaque-pyobject
ngoldbaum ab1333b
Merge branch 'main' into opaque-pyobject
ngoldbaum 52124f8
fix ruff
ngoldbaum d9133fe
fix cfg gating for critical section API
ngoldbaum 87d6ae4
Merge branch 'main' into opaque-pyobject
ngoldbaum 1aea9b0
adjust PyMutex cfg gating
ngoldbaum 4bb2202
attempt to fix abi3 feature for free-threaded targets from a config file
ngoldbaum 3e1ec34
introduce a builder for InterpreterConfig
ngoldbaum 781648b
newsfragments
davidhewitt f091c9a
fixup ubuntu test
davidhewitt ef4fb92
fixup
davidhewitt 7ee1ed0
fix missing `mut`
davidhewitt 0709d59
Merge remote-tracking branch 'origin/main' into opaque-pyobject
davidhewitt f509e72
fix merge error
ngoldbaum f8aa9a5
fix incorrect merge conflict resolution
ngoldbaum 037563a
refactor is_abi3(t) in get_abit3(t)_version.is_some()
ngoldbaum 23bf337
apply suggestions from icxolu
ngoldbaum 14c2d9f
Make PythonAbi fields private, replace with accessor methods
ngoldbaum 9af08e1
fix test-version-limits
ngoldbaum 13448e3
Apply suggestions from code review
davidhewitt 7ba3daf
review feedback
davidhewitt a59f8dc
Merge branch 'interpreter-builder' into opaque-pyobject
ngoldbaum 4bcd9fa
fix merge conflicts
ngoldbaum 5a47645
Merge branch 'interpreter-builder' into opaque-pyobject
ngoldbaum 9a32727
fix clippy
ngoldbaum c536ebe
re-enable functionality that depends on critical sections
ngoldbaum 53014c0
revert more unnecessary changes
ngoldbaum 208fe8f
reduce diff further
ngoldbaum 3b32ea1
Merge branch 'main' into opaque-pyobject
ngoldbaum d9ade28
fix cfg gating for critical section guards
ngoldbaum dab0337
Merge branch 'main' into opaque-pyobject
ngoldbaum 0e4d6d8
Merging with David's default_lib_name_for_config_file branch
ngoldbaum c85c89c
Merge branch 'main' into opaque-pyobject
ngoldbaum 6c514fb
remove unnecessary get_abi3_version().is_some()
ngoldbaum 5518b84
bring back Option
ngoldbaum 0123231
fix comparison for ABI3T_FORWARD_COMPATIBILITY
ngoldbaum ed9807c
Apply minor suggestions from code review
ngoldbaum 2b8d7a2
delete docs for non-pub field
ngoldbaum b772cf3
Don't define a Py_TARGET_ABI3T cfg check
ngoldbaum c345a0d
fix merge errors
ngoldbaum caf1af8
implement Icxolu's suggestion to get rid of is_abi3 and is_abi3t
ngoldbaum 2531c96
fix clippy-all
ngoldbaum 1908b69
delete unnecessary get_abit3_version() check
ngoldbaum d232ac7
Allow simultaneously enabling abi3 and abi3t features
ngoldbaum 941aca4
add release notes
ngoldbaum 4d38642
fix ruff
ngoldbaum dd200da
really fix ruff
ngoldbaum fd0f14f
don't run abi3-py38 tests on pypy
ngoldbaum 13e04c7
add docs
ngoldbaum ebc99b9
disable windows gil-enabled abi3t builds to work around upstream bug
ngoldbaum 6214c3d
fix guide formatting
ngoldbaum 7725030
fix internal links in guide
ngoldbaum 303877a
fix typo in noxfile
ngoldbaum cb5a464
Merge branch 'main' into opaque-pyobject
ngoldbaum 607f8bc
fix release notes
ngoldbaum 335fa8a
revert now-unnecessary CI configuration change
ngoldbaum be8b1a1
fix abi3t-py315 feature not re-exporting pyo3-ffi feature
ngoldbaum 68ffca0
fix typos in comments
ngoldbaum File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Ping @messense, it probably makes sense to coordinate the release of PyO3 0.29 and a maturin release that supports abi3t.