Chaquopy version 3.1.0

Posted on

This release adds support for installing pure-Python sdists. This means that all pure-Python packages on PyPI should now work with Chaquopy, whether they have wheels available or not. If you have any difficulty installing a package, please report it at our issue tracker.

Other changes:

  • The Python major version of buildPython is now required to be the same as that of the app itself when using pip, and the default value of buildPython has been changed accordingly.
  • Fix imp.find_module and imp.load_module.
  • Implement implicit namespace packages on Python 3 (PEP 420).
  • Add partial support for .pth files. Only the execution of lines starting with import is currently implemented: all other lines are ignored.
  • Add message explaining how to show full pip output in Android Studio 3.1’s new Build window.
  • Fix “registering invalid inputs” warning in Android Studio 3.1.

Chaquopy version 3.0.0

Posted on

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.

Other changes:

  • 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.

More data science packages now available

Posted on

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!

Chaquopy version 2.1.0

Posted on

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.

Chaquopy version 2.0.1

Posted on

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.

Chaquopy version 2.0.0

Posted on

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.

Other changes:

  • 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.

Chaquopy is now out of beta

Posted on

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.

Chaquopy version 1.4.0

Posted on

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.
  • The write method of sys.stdout and sys.stderr now returns the character count.
  • Very long lines written to sys.stdout and 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.

Other notes:

  • Apps built with an unlicensed copy of the SDK are now limited to a run-time of 5 minutes.
  • 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.