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

Split canvas.py into subpackage #3053

Merged
merged 7 commits into from
Dec 22, 2024
Merged

Conversation

HalfWhitt
Copy link
Contributor

canvas.py is currently 1,747 lines long, and the actual Canvas widget doesn't start until 1,209. This PR splits it up into more manageably-sized files. The __init__.py exports all of the names, so nothing should change as far as use from outside of Canvas.

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

@HalfWhitt HalfWhitt closed this Dec 21, 2024
@HalfWhitt HalfWhitt reopened this Dec 21, 2024
@HalfWhitt HalfWhitt marked this pull request as draft December 21, 2024 04:35
@HalfWhitt HalfWhitt marked this pull request as ready for review December 21, 2024 05:26
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.

We can remove the 2 "organisational" comments that you've flagged, but otherwise this looks like a good organizational cleanup to me.

On the subject of cleanups - if we're doing a big cleanup like this, then it might be worth finalizing the deprecations. The deprecation paths have been in place for over 18 months, before the 0.4.0 release; since we're about to bump to 0.5.0, we might as well finish that cleanup. I'll leave in your hands wWhether we clean up the canvas deprecations in this PR, or do a separate "Remove pre 0.4.0 deprecations" PR.

core/src/toga/widgets/canvas/canvas.py Outdated Show resolved Hide resolved
@HalfWhitt
Copy link
Contributor Author

HalfWhitt commented Dec 21, 2024

I'll leave in your hands whether we clean up the canvas deprecations in this PR, or do a separate "Remove pre 0.4.0 deprecations" PR.

Since it would be a good idea to clean up other deprecations too, yeah, I think I'll do that in a separate PR.

@HalfWhitt
Copy link
Contributor Author

Question: should I also remove things that were marked as deprecated in the 0.4.0 release, or only those already marked before it?

@freakboy3742
Copy link
Member

Question: should I also remove things that were marked as deprecated in the 0.4.0 release, or only those already marked before it?

If the source tarball for 0.4.0 contains the code for the deprecation, the deprecation can be removed for the 0.5.0 release (which will likely be cut once I'm back in the office in the new year).

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.

👍 Thanks for the cleanup!

@freakboy3742 freakboy3742 merged commit 66ff429 into beeware:main Dec 22, 2024
41 checks passed
@HalfWhitt HalfWhitt deleted the canvas_subpackage branch December 22, 2024 18:11
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