Repository navigation
Feat: Re-export every manifest module by one naming rule over the binder's Kotlin names - #21
Merged
Merged
Conversation
…der's Kotlin names The binder serves androidx.compose.* under Kotlin names only and publishes inspect.signature and python_multiplatform.describe for a Pythonic layer to read. This is that layer, as one rule in pythonx/compose/_reexport.py: each module in pythonx-map.toml is a file on disk whose __init__ hands its name to reexport(), and a name read from it resolves on first use. - Upper-case names (types, objects, composables) keep their Kotlin spelling; every other name is reached by its snake_case spelling only, and an explicit overload keeps its suffix. The rule is applied forward to the Kotlin module's real names and looked up, never inverted, so toURLString is to_url_string and a collision is refused by name. - Keywords are matched to the declaration's own parameter names from describe(), every overload's; an unmatched keyword reaches the binder's own refusal unchanged. inspect.signature reports snake_case names and keeps KOTLIN_DEFAULT. - The manifest's raw-primitive allowlist reaches the binder once per installed binding layer. - Names a package defines itself (runtime.Composable) win; resolution is lazy, so importing a pythonx.compose module needs no binder. foundation/, foundation/layout/, ui/text/ and ui/graphics/ get the one-line __init__ their manifest rows already promised. ui/modifier.py drops the synthetic-pythonx lookup and reaches Modifier through pythonx.compose.ui. Methods on a proxy the binder returned (m.fill_max_width()) are the binder's class's attributes and wait for its member resolver (python-multiplatform #17, issue #20); the 4 tests that need it skip. feature added: the re-export rule, the four missing package files. test added/rewritten: test_chain.py against pythonx (Names 8, Laziness 5, OverloadDispatch 7, ValueClasses 6, TheChain 6, Handles 1, sources 3), test_modifier_module.py and test_runtime_module.py import normally. Red: the new tests against develop, 31 failed, 18 passed, 4 skipped. Disabling the name rule fails 15, the keyword mapping 1, the allowlist 12. documentation corrected: SPEC 0/3/S4.1/S5.1/S5.2/S6.x, PROJECT.md, AGENTS.md section 14, guide status and baseline, three package docstrings. Suite with ../PythonMultiplatform (develop d00f413f): 44 passed, 33 failed -> 81 passed, 4 skipped. Without a checkout: 40 passed, 37 skipped -> 40 passed, 45 skipped. Each test module run separately passes. check_guide.py: 0. Refs #8
This was referenced Oct 2, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #8
One rule,
pythonx/compose/_reexport.py, makes everypythonx-map.tomlmodule a Pythonic view of itsandroidx.compose.*module, reading the binder's published contract (inspect.signature,python_multiplatform.describe). There are no per-widget wrappers (AGENTS.md §13).Public surface
Modifier,Text) keep their Kotlin spelling; everything else is snake_case only (padding_values_of,to_url_string); explicit overloads keep their suffix (padding__Dp_Dp). The rule is applied forward and never inverted, and collisions are refused by name.padding_values=→paddingValues, matched against every overload's own parameter names. An unknown keyword reaches the binder's refusal, which lists the candidates.inspect.signaturereports snake_case names and keepsKOTLIN_DEFAULT.pythonx.composemodule first resolves a name.RuntimeErrorthat namesPythonxAdapter.install().Feature added: the rule; package files for
foundation,foundation.layout,ui.text,ui.graphics(manifest rows that had no file).Test added/rewritten:
test_chain.pyagainstpythonx(36 tests, 4 skip pending python-multiplatform #17 → #20);test_modifier_module.pyandtest_runtime_module.pyimport normally.Red: the new tests against
develop: 31 failed, 18 passed, 4 skipped. Disabling the name rule fails 15 tests, the keyword mapping 1, the allowlist 12.Documentation corrected: SPEC §0, §3, S4.1, S5.1, S5.2, S6.x; PROJECT.md; AGENTS.md §14; guide status and baseline; package docstrings.
Not here: snake_case methods on a proxy the binder returned (#20, needs python-multiplatform #17).
../PythonMultiplatform(developd00f413f)Each test module also passes when run on its own.
tools/check_guide.py: 0 findings.