This version adds support for Android Gradle plugin version 3.1, and removes support for version 2.2. If you’re still using Android Studio 2.2, then we highly recommend that you upgrade to version 3.1. Our testing shows that it builds apps more than twice as fast, whether you’re using Chaquopy or not.
- Add Python versions 2.7.15 and 3.6.5, and fix a few lesser-used standard library modules.
- Update to pip version 10.0.1.
- Build reliability fixes, including one for over-strict metadata parsing.
- Further build speed improvements.
- Improve app startup speed where a requirement is reinstalled at the same version as before.
We’re happy to announce that, due to popular demand, the following packages are now available for Chaquopy 2.1 and later:
NumPy has also been updated to the newest version, and is now built to work with OpenBLAS. As a result, many calculations are significantly faster than in the previous build.
For a full list of native packages currently available for Chaquopy, see the repository. In addition, Chaquopy of course supports all pure-Python packages which are available as wheels on PyPI.
If your favorite package still isn’t available, please let us know!
This version is focused on improving support for Python requirements which are very large, or contain native code. Several new packages have been added to the repository as a result: see the next post for a list.
List of changes:
- External shared library dependencies can now be loaded.
- pip install performance has been improved.
This version fixes the following bugs:
- Fix a crash reported on various devices, especially Samsung Galaxy J series phones.
- Disable upgrade notification from bundled copy of pip.
It also makes available the following fixes in the package repository:
- Fix NumPy dependency on libc functions not present in API level 17 and earlier.
- Remove debugging information from native modules. All native packages benefit from this, but especially NumPy, which is now smaller by 4 MB per ABI.
The major version number is incremented due to the following incompatible change:
- The import hook now only looks up names in Java if they failed to import from Python. This significantly speeds up import of large Python packages. However, it means that importing a name which exists in both languages is no longer reported as an error: instead, the value from Python will be returned.
- General performance improvements: the Python unit tests now run about 25% faster.
- Fix a crash on API level 15 caused by the license notification.
- Remove READ_LOGS permission from the demo app: this was only needed on API level 15, and its Google Play description is too scary.
The Chaquopy SDK is now out of beta and is considered ready for production use. Thanks to all those who tested it during the beta period: your free license keys will remain valid for all future versions.
We’re looking forward to continuing to improve Chaquopy in the future, but we’d like to hear what features are most important to you. Do you want better performance, or are there any Python packages you’d like to be made available? Would you benefit from better Android Studio integration, or would you be more interested in a way to create apps in Python directly on an Android device?
Please let us know your thoughts by email or on our GitHub page.
This version adds the following feature:
- The Python standard library is now loaded from compiled .pyc files by default (see documentation). As a result, startup of a minimal app is now 20-30% faster with Python 2, and 50-60% faster with Python 3. (Python 3 startup is still slower than Python 2, but only by 15-20%.)
And fixes the following bugs:
sys.stdin now returns EOF rather than blocking. If you want to run some code which takes interactive text input, see below for the new console app template.
write method of
sys.stderr now returns the character count.
- Very long lines written to
sys.stderr are now split into slightly smaller fragments, to allow for the shorter Logcat message length limit in recent versions of Android.
- Fix a multi-threading deadlock.
- Apps built with an unlicensed copy of the SDK are now limited to a run-time of 5 minutes.
- A console app template is now available, providing a framework for running text-based Python programs in an Android app. The demo app has been rewritten to use this framework, giving the following improvements:
- Code input in the REPL is now executed on a background thread.
- The REPL can now be terminated by typing
exit(), then restarted by pressing back and re-entering the activity.
- Stderr is now shown in red.
- Scrolling, rotation and state restoration are all more reliable.
This is a minor update to fix issues with non-ASCII text in Python source code (#27).
This version focuses on improving Python standard library functionality:
- The following things now return reasonable values:
- The following modules now work correctly: sqlite3, ssl (#23), and tempfile. (Requires python.version to be 2.7.14 or 3.6.3.)
sys.stderr are now directed to the Android logcat.
It also adds the following feature:
extractPackages allows code which uses
__file__ to work unchanged. It is used by default for certifi.
This version adds the following features:
- Python source directory locations can now be configured in the
sourceSets block, just like Java.
- Python 2.7.14 is now available.
And fixes the following bugs:
getClass, when called on a Java object, now returns the Java object class rather than the
proxy object class.
static_proxy Java files no longer produce build warnings.
- Pip is now re-run if a local requirements or wheel file changes.
- Missing stdlib modules
doctest have been added (#20). For Python 2 apps, this also requires
upgrading to Python 2.7.14.
The following packages have been added to the repository: