Repository navigation
Feat: Regenerate the stubs from the binder's #53 output, typing object members properly - #49
Merged
Merged
Conversation
…t members properly python-multiplatform's newer kotlin-stubs (run 37098191598, fa2558e3: its #53, #44/#49 and #38 property stubs) stubs object functions, gives object constants their nested types, types *ItemColors parameters, and emits properties with setters. Converting it as-is broke mypy two ways, both in gen_stubs.py: - A property was renamed to snake_case but its `@layoutDirection.setter` decorator was not. The property and its decorators are now renamed together, at module level and in classes. - An object's nested types (Alignment.Horizontal) live in the object's own stub upstream; folded into the parent stub as a class, bare `Horizontal` no longer resolved and collided with this package's grouping namespace. The nested types now move in as nested classes, and each one IS the group as well: Alignment.End and Alignment.Horizontal.End both type as Alignment.Horizontal, Alignment.Horizontal.Top still fails, and references from other modules become pythonx.compose.ui.Alignment.Horizontal. Object functions are snake_case staticmethods (Arrangement.spaced_by), an explicit overload set also gets its base name. Upstream gives Arrangement.HorizontalOrVertical one base where Kotlin has two, which made mypy reject the notebook's Column(vertical_arrangement=Arrangement.SpaceBetween); annotations naming such a type are Any until upstream lists both bases. colors: bool goes from 9 to 0 in material3. Drafted by a subagent in a worktree; reviewed and re-run here. feature added: property, nested-type and object-function conversion. test added: TheObjectAndPropertyFormat (7) over a new-format fixture, two mypy cases (object function and nested types; property and setter). Red: 6 of 7 failed. Disabling the decorator rename fails 1; the nested-name qualification 5. documentation corrected: SPEC 0/S1.2/S7.1 (stale per-step counts replaced), PROJECT.md, guide status and getting-started. Suite with python-multiplatform 31c092f0 (worktree, new zip): 193 passed, 1 skipped -> 202 passed, 1 skipped; without a checkout, 107 passed, 87 skipped -> 116 passed, 87 skipped. Generating twice gives no diff. check_guide.py: 0. Refs #12
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.
Refs #12
Regenerates the stubs from python-multiplatform run 37098191598 (fa2558e3). Fixes the two converter problems the newer input exposed:
.setterdecorator are now renamed together.Alignment.Horizontalmove into the folded object as nested classes. Each one is both the Kotlin type and the notebook's group, soAlignment.EndandAlignment.Horizontal.Endtype asAlignment.Horizontal, andAlignment.Horizontal.Topstill fails mypy.Object functions such as
Arrangement.spaced_byare snake_case staticmethods.colors: boolis gone.Still Any:
Arrangement.HorizontalOrVerticaland anything typed with it, because upstream lists one base where Kotlin has two (reported); object self-types such asAlignment.Center;Icons.Default.Add(python-multiplatform #68).Test added: 7 generator tests on a new-format fixture, plus 2 mypy cases. Red: 6 of 7 failed. Disable checks fail 1 / 5.
Drafted by a subagent; reviewed and re-run here.