Repository navigation
Test: Import pythonx from disk, and install the binder under its own name - #16
Merged
Merged
Conversation
…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
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 #7
The binder no longer owns
sys.modules['pythonx'](PythonMultiplatformd00f413f). 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 thesys.pathstep disabled, the same 4 fail.Test harness:
tests/adapter.pyreadsKotlinSurface.SOURCE→python_multiplatformandPythonxAdapter.SOURCE→python_multiplatform.binding, and no longer callsregister_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.pystill loads by path. It and the 33 tests intest_chain.py/test_modifier_module.pymove with the re-export (#8).../PythonMultiplatform(developd00f413f)tools/check_guide.py: 0 findings.