-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
gh-140550: Initial implementation of PEP 793 – PyModExport #140556
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
Merged
Merged
Changes from 78 commits
Commits
Show all changes
87 commits
Select commit
Hold shift + click to select a range
4ad95be
Define PyMODEXPORT_FUNC
encukou c53650d
Add new state to module object
encukou 9564e20
Make sure the module def matches the state
encukou 05a87c3
Add simple test case
encukou 57c4f1e
Add new slot definitions
encukou 956c59a
Modules are bigger sue me
encukou 14a66d2
Add a test for PyModule_FromSlotsAndSpec
encukou 72a27f5
Add PyModule_FromSlotsAndSpec (empty for now)
encukou b54293b
Add module test
encukou fcc68f8
Fill in enough of a PyModuleDef to pass to common machinery
encukou 3ab607e
Pass in a spec
encukou 35d7d51
Rename field which can now be NULL
encukou 6fbbc18
Common implementation for PyModule_From{Def,Slots}AndSpec
encukou 7207e07
Add test for Py_mod_name slot
encukou 8d4d264
Handle Py_mod_name
encukou bd61e5b
Test repeated slot
encukou d638abf
Test Py_mod_name with a def
encukou b24e6a6
Py_mod_doc
encukou 756cbff
Disallow NULL slot value
encukou 320de14
Test repeats and NULL for all new slots
encukou 4d88cf3
Add PyModule_GetSize
encukou a1d3c15
Test size
encukou 7fcee67
Handle size
encukou 9fd1e7e
Test new slots with PyModuleDef
encukou fd95984
Py_mod_methods
encukou 748e18f
GC hooks
encukou 1101f55
Py_mod_token
encukou 488eae7
Py_mod_exec
encukou f9d0dde
Clean up slot-handling a bit
encukou 020dcc6
Py_mod_create
encukou cf7409e
Use PyModule_Exec in exec_builtin_or_dynamic
encukou d1673de
PyModExport
encukou c3dd935
_PyModule_IsExtension: Check md_exec
encukou 1de2c50
Small style/doc fixups
encukou e486cdc
Handle NULL slots & bad spec; some light refactoring
encukou 31a5cc5
Allow non-Module instances
encukou 3dcadbb
Tests for the export hook
encukou bd1c352
`state_` in slot names
encukou 56525fa
Test PyModule_Exec with PyModuleDef-defined module
encukou 4b93132
Test PyModule_GetToken, token setting, and default tokens
encukou bb2dd7d
Add PyType_GetModuleByToken
encukou 36cc311
Fix refcounting
encukou 37905ae
Rename and test PyModule_GetStateSize
encukou 1df228a
Rename new internal module members
encukou 71e043f
Share storage between def and token
encukou dd3c25f
Lose the spec argument
encukou 391281d
Put `const` in signatures
encukou 058e0db
test_cext: Remove the 'create_moduledef.c' workaround
encukou e6ff4b9
Make helpers static
encukou b651cef
Add comment to assertion
encukou 4d4c6b7
Mark test PyModuleDefs as GIL-friendly
encukou 54c496e
Add vcxproj entries for test files
encukou fdc49ed
Add to Limited API
encukou dab2207
gh-140633: AppleFrameworkLoader: Ignore AttributeError when setting _…
encukou 4f7bccb
test_cext: Define PyInit_* function which asserts that it wasn't called
encukou 628942c
Add a blurb
encukou 08ee616
Make tokens `const` to pass check for C globals
encukou ffe3322
One more cast
encukou 0855bdd
test_import: Move modexport tests to their own class
encukou 0af8cae
Merge in the main branch
encukou 895a046
Remove redundant comment
encukou 25fe913
Rename _PyImport_GetModInitFunc2 to _PyImport_GetModuleExportHooks
encukou 1939ad2
Merge in the main branch
encukou 821a2b2
Merge in the main branch
encukou ab04b28
Update outdated comment
encukou d9013b1
Add a _PyModule_CAST macro
encukou 788835e
Better argument naming in headers
encukou fde9850
Move comment to top
encukou 0465b0d
'noop', not 'trivial
encukou 268840a
PyLong_AsInt
encukou 3e13677
Add spaces inside curly braces
encukou fdff39b
PyErr_FormatUnraisable, not PyErr_WriteUnraisable
encukou 7c29575
Use NDEBUG
encukou b163b28
Wrap in do-while
encukou 6ddcb01
PyErr_SetString instead of PyErr_Format
encukou 2013284
Repr in error messages
encukou 52af397
PEP 7 whitespace
encukou 01d52ba
Make sure Victor's edits are credited
encukou ba6e602
Correct logic
encukou d26e9b7
Merge in the main branch
encukou 26b57f2
Get the spaces just right
encukou 66e8309
Merge branch 'main' into modexport-rebased
encukou 928f23b
_PyModule_GetDefOrNull never raises
encukou 4f3712f
Merge in the main branch
encukou 55ae793
Remove _PyModule_GetGCHooks; get the hooks directly via internal API
encukou 1e6b18c
Style fixes
vstinner 4d58846
Remove unused variables
encukou 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.