Skip to content

Test: Import pythonx from disk, and install the binder under its own name - #16

Merged
b-re-w merged 1 commit into
developfrom
work/real-pythonx
Oct 2, 2026
Merged

b-re-w merged 1 commit into
developfrom
work/real-pythonx

Conversation

@b-re-w

@b-re-w b-re-w commented Oct 2, 2026

Copy link
Copy Markdown
Member

Closes #7

The binder no longer owns sys.modules['pythonx'] (PythonMultiplatform d00f413f). This flips the four tests that asserted the opposite, rewrites the harness to install the binder the way an embedder does now, and corrects the docstrings.

Test added: TheModuleIsTheFileOnDisk (2), TheUiInitModuleIsTheFileOnDisk (2), replacing the four unreachability tests. Red before the harness change: 4 failed (ModuleNotFoundError: python_multiplatform). With the sys.path step disabled, the same 4 fail.
Test harness: tests/adapter.py reads KotlinSurface.SOURCE → python_multiplatform and PythonxAdapter.SOURCE → python_multiplatform.binding, and no longer calls register_package.
Documentation corrected: runtime/__init__.py, ui/__init__.py, layout/__init__.py; SPEC §0, §3 and Outside intent 1–2; PROJECT.md; AGENTS.md §14 count; guide baseline.
Not here: ui/modifier.py still loads by path. It and the 33 tests in test_chain.py / test_modifier_module.py move with the re-export (#8).

Environment Before After
No PythonMultiplatform checkout 40 passed, 37 skipped 40 passed, 37 skipped
../PythonMultiplatform (develop d00f413f) 40 passed, 37 failed 44 passed, 33 failed

tools/check_guide.py: 0 findings.

…name

Four tests asserted that import pythonx.compose.runtime / .ui could not load
the files on disk, because the binder used to own sys.modules['pythonx'] with
__path__ = []. PythonMultiplatform d00f413f moved its layer to
python_multiplatform.binding and pins that import pythonx loads the real
package. The tests now assert that: the file on disk is what loads, and the
binder serves androidx.compose.ui as a separate module.

tests/adapter.py no longer asks the binder to rename anything. It reads both
binder sources (KotlinSurface.SOURCE as python_multiplatform,
PythonxAdapter.SOURCE as python_multiplatform.binding), resolves the one
Kotlin constant the latter interpolates, installs them the way the embedder
does, and puts the repository root on sys.path so pythonx is imported the
ordinary way. register_package is gone from it.

Docstrings in runtime/__init__.py, ui/__init__.py and layout/__init__.py stop
describing a synthesised pythonx. ui/modifier.py still loads by path; it is
rewritten with the re-export (#8).

test added: TheModuleIsTheFileOnDisk (2), TheUiInitModuleIsTheFileOnDisk (2),
replacing the four unreachability tests. Red before the harness change: 4
failed (ModuleNotFoundError: python_multiplatform). Disabling the sys.path
step fails the same 4.
documentation corrected: the three docstrings, SPEC 0/3/Outside intent 1-2,
PROJECT.md, AGENTS.md section 14, guide baseline.
Suite with ../PythonMultiplatform (develop d00f413f): 40 passed, 37 failed ->
44 passed, 33 failed. The 33 (test_chain, test_modifier_module) now fail on
the old install(source) call and move with #8. Without a checkout: 40 passed,
37 skipped, unchanged. check_guide.py: 0 findings.

Refs #7
@b-re-w
b-re-w merged commit c0bb33f into develop Oct 2, 2026
@b-re-w
b-re-w deleted the work/real-pythonx branch October 3, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant