Skip to content
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

Future-proof Chart against changing Toga Widget initialization #194

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

HalfWhitt
Copy link

Updates Chart to play nice with the restructured Widget initialization in beeware/toga#2942, while staying backwards compatibile with Toga 0.4.8.

I realize that PR may or may not change significantly before merging; this is for its current form as of beeware/toga@c4db37f, and I can amend as needed.

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed this makes sense in the light of beeware/toga#2942 changes; one possible way to avoid the backwards incompatibility at all, plus any additional changes that are needed as a result of the final review state of beeware/toga#2942.

if not self._impl:
# Backwards compatibility for Toga 0.4.8, which does not call the _create()
# method in Widget.__init__()
self._create()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also fix this by a toga dependency to toga-core>=0.4.8. It's an interesting omission that we don't currently have that dependency, only enforcing the toga-dummy requirement on developers.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. Yeah. That is a good point! I'll just change it to that once we know for sure what the next version number is.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed the backwards compatibility shim and added the version requirement (which fails for now, of course, since Toga 0.5.0 doesn't exist).

@HalfWhitt HalfWhitt marked this pull request as draft November 29, 2024 04:46
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.

2 participants