September has been a big month for the BeeWare team. There have been lots of small updates - but there's one very large, eagerly anticipated update that has taken several months to complete.
What we've done
- We added support for binary packages on mobile platforms! There's more detail related to this than can fit in a bullet point; more details below.
- We added the ability to remove files from a templated app. This can be used to trim down a project, removing parts of the Python interpreter that you don't need (such as standard library modules that you don't need)
- We've changed the way we use templates, switching to using branches based on the Briefcase release, rather than the Python release. This enables us to make development changes to templates without affecting the published stable release.
- We reworked the way Briefcase manages integrations with the tools needed to build apps. This was a mammoth project, but as a result the process of verifying tools is faster, and a number of bugs related to having stale builds have been resolved.
- We've made a number of improvements to console handling of log messages, especially on Windows
- We improved error handling in Toga when TLS1.2 or TLS1.3 isn't supported by Windows.
- We started conversations with the teams at Anaconda responsible for conda about using Conda as a base for Briefcase apps, and on using Conde-forge style infrastructure to support binary packaging. Nothing concrete has come from these conversations yet; these conversations are ongoing.
Binary package support you say?
All the new binary packaging support is contained in Briefcase 0.3.10.
On Android, binary module support was achieved by moving to Chaquopy as a base for Android projects. Along with support for binary modules, this change has the added benefit of faster startup times, and less bugs at runtime. This means you'll need to re-generate any Android project - the Python source code should work as-is, but there's no simple way to convert the Android Gradle project from the older Rubicon base to the newer Chaquopy base.
On iOS, we've reworked how the support packages are constructed, and added support for installing binary modules from a Beeware-specific package repository that includes builds of iOS binary wheels. We've also added asset signing to the iOS Xcode project - and applied the same changes to the macOS backends. Of course, this also means you'll need to re-generate any iOS project to take advantage of these changes.
While we are now able to support binary packages on mobile platforms, this doesn't mean that every binary package is automatically supported. Binary wheels need to be compiled for mobile platforms, and compiling for mobile platforms can be complicated. However, we've compiled ~40 of them most popular packages with binary components (including numpy, pandas, cryptography, pillow and matplotlib), and made them available as dependencies. In order to get working builds, some of these packages are slightly older versions (e.g., cryptography is a version from before the introduction of the rust dependency); however, we've endeavoured to provide the most recent versions possible.
A full list of supported packages can be found on the Chaquopy package repository for Android, and the BeeWare repository for iOS. If your project uses one of these packages, you only need to add them to the requires definition in your pyproject.toml, then update and re-build your project, and you're done.
If there’s a package you want that isn't on this list, you'll need to request a binary wheel. For Android, open a ticket on the Chaquopy repository. For iOS, open a ticket on this repository. If you're adventurous, you can also try building wheels yourself. The issue trackers are on a project that has as "forge-like" tool for building wheels, in the server/pypi folder; there are tools and documentation describing how to build a package. The use of these projects is a short-term measure; in the longer term, we want to move to an actual “forge”-style community-managed model for managing binary packages.
For the last few months, the focus of the BeeWare team has been on Briefcase and the support packages. In October (and the rest of Q4), we'll be shifting our focus to Toga. The initial focus will be on improving the foundation of the project - testing and build infrastructure; but once those pieces are in place, we'll start adding new features.
We'll also be at DjangoCon US in San Diego - and there will be some web-related updates related to the presentation that will be given at that conference. We hope we'll see you there!
Want to get involved?
Want to get involved? Here's 10 open issues that would be a great place to get started with contributing to a BeeWare project. They're all relatively minor changes, but would provide a big improvement to the lives of BeeWare users:
- Write Briefcase logs into a subdirectory, instead of the project folder
- Improve protection against corrupted or incomplete downloads
- Modify the handling of app signing options
- Modify the Briefcase new project wizard to show which repository and branch it's using
- Filter out a message generated after Xcode updates
- Add the ability to refresh the support package in a project
- Provide protection against creating projects with "semi-reserved" names
- Add the ability to configure the ABIs built by an Android project
- Add support for the ANDROID_HOME environment variable
- Silence an warning that is displayed when an Android emulator has no skin defined
Pick one of these tickets, drop a comment on the ticket to let others know you're looking at it, and try your hand at a PR! We have a guide on setting up a Briefcase development environment; but if you need any additional assistance or guidance, you can ask on the ticket, or join us on the BeeWare Discord server.
- Próximo artigo
- 2022Q4 Roadmap
- Artigo anterior
- August 2022 Status Update