Change log¶
10.0.1 (2021-09-22)¶
Android Gradle plugin versions 4.2 and 7.0 are now supported.
[BACKWARD INCOMPATIBLE] Android Gradle plugin versions 3.4 and 3.5 are no longer supported.
[BACKWARD INCOMPATIBLE] The
version
setting is no longer supported. Simply remove it to use the current version of Python.Update to Python version 3.8.11 (see its changelog for details).
Update to pip version 19.2.3 (see its changelog for details).
Update CA bundle to certifi 2021.5.30.
Add a
buffer
attribute to stdout and stderr for bytes output (#464, #516).Java arrays now support the
index
andcount
methods in Python. In order to support code withhasattr
checks, they also now implement the methods__contains__
,__iter__
and__reversed__
, rather than relying on the fallback to__getitem__
(#306).Fix “truth value of an array with more than one element is ambiguous” error when passing a NumPy array to a method which takes a Java array (#526).
NumPy integer scalars, and anything else which implements the
__index__
method, can now be used as a Java array index (#495).Add workaround to help conda Python on Windows find its SSL libraries (#450).
Fix “invalid literal for int” error in pip_install when project path includes a symlink (#468).
Fix crash caused by empty files in the APK on Android 7 (Electron Cash #2136).
importlib.util.spec_from_file_location
now works for paths loaded from the APK.
9.1.0 (2021-01-02)¶
Fix error “‘HTMLParser’ object has no attribute ‘unescape’” on Python 3.9 (#416).
Fix error “must supply either home or prefix/exec-prefix – not both” on Homebrew for Mac (#405).
buildPython
path can now contain spaces.Java API is now annotated with
@NotNull
where appropriate.Java arrays now support the
copy
method in Python.Fix bug when using
cast
to call a functional interface which extends another functional interface.Update CA bundle to certifi 2020.12.5.
json
module performance improvements.Java API performance improvements.
9.0.0 (2020-11-06)¶
Android Gradle plugin version 4.1 is now supported.
[BACKWARD INCOMPATIBLE] Android Gradle plugin version 3.3 is no longer supported.
Update to Python version 3.8.6 (see its changelog for details).
Java/Kotlin objects implementing functional interfaces can now be called from Python using
()
syntax. This includes lambdas, method references, and any interface with a single abstract method, such asjava.lang.Runnable
.Java arrays can now be accessed from Python using negative indices and slice syntax.
Fix conversion of non-contiguous NumPy arrays to Java arrays.
Remove inaccessible directories from
os.get_exec_path
(#346).Make
zipimport
implement the new loader API. This affected the packagedateparser
.If
bdist_wheel
fails for an unknown reason, fall back onsetup.py install
. This affected the packagesacoustics
andkiteconnect
(#338).Fix
ClassNotFoundException
whenminifyEnabled
is in use (#261).
8.0.1 (2020-07-28)¶
Make missing
multiprocessing
primitives throw an exception on use rather than on import. This affected the packagesjoblib
andlibrosa
(#21).Make
ctypes.util.find_library
search libraries installed with pip. This affected the packagesoundfile
(#201).Fix “invalid constraint” error affecting the packages
openpyxl
andwebcolors
.
8.0.0 (2020-06-15)¶
Android Gradle plugin version 4.0 is now supported.
[BACKWARD INCOMPATIBLE] Android Gradle plugin version 3.2 is no longer supported.
Update to Python version 3.8.3 (see its changelog for details).
Using Chaquopy in an Android library module (AAR) is now supported (#94).
Java primitive arrays now support the Python buffer protocol, allowing high-performance data transfer between the two languages.
Data files in top-level non-package directories are now extracted from the APK the first time the app is started, so they can be accessed using a path relative to
__file__
.
7.0.3 (2020-05-11)¶
Fix “This platform lacks a functioning sem_open implementation” error when using
multiprocessing.dummy.Pool
(akamultiprocessing.pool.ThreadPool
). This affected many common uses of TensorFlow.Work around dynamic linker bug on 64-bit ABIs before API level 23 (#228).
Fix out of memory error when running Gradle with a small heap size.
Fix incompatibility with external package
importlib_metadata
(#276).Fix
NoClassDefFoundError
when using Python to access certainandroidx
classes, includingAppCompatTextView
.Fix conversion of Java
byte[]
array to Pythonbytearray
.Improve startup speed by deferring
pkg_resources
initialization until the module is first imported.Update CA bundle to certifi 2020.4.5.1.
7.0.2 (2020-03-05)¶
[BACKWARD INCOMPATIBLE] Update to Python version 3.8.1 (see the 3.7 and 3.8 release notes for details).
All Python standard library modules are now supported except those in this list. In particular, support has been added for
bz2
,importlib.metadata
,importlib.resources
andlzma
.Most native packages have been upgraded to a more recent version. If you’ve used specific version numbers in a
build.gradle
orrequirements.txt
file, you may need to update them. See the repository index for a complete list.
Android Gradle plugin version 3.6 is now supported.
[BACKWARD INCOMPATIBLE] Android Gradle plugin version 3.1 is no longer supported.
[BACKWARD INCOMPATIBLE] buildPython must now be at least Python 3.5.
Expose Java API using
api
configuration so it’s available to dynamic feature modules.Update CA bundle to certifi 2019.9.11.
Fix “cannot create a consistent method resolution order” error when using
androidx
.Fix a deadlock involving the Java API.
Improve local caching of packages which aren’t available as wheels.
Reduce some temporary filename lengths to avoid the Windows 260-character limit.
Improve startup speed.
6.3.0 (2019-08-25)¶
Android Gradle plugin version 3.5 is now supported.
Pre-compile Python code to
.pyc
format by default, so it doesn’t have to be compiled on the device. This significantly improves app startup speed and storage usage.Remove the
extractPackages
setting, as data files are now extracted automatically. See the documentation for details.Change data file location from cache to files directory, to prevent the user from clearing it while the app is running.
Hide importer frames in stack traces, unless the exception originated from the importer itself.
Fix another metadata parsing issue, this one affecting the package
astroid
.Fix “has no DT_SONAME” warning (#112).
6.2.1 (2019-04-19)¶
Android Gradle plugin version 3.4 is now supported.
Update to OpenSSL 1.1.1b. This enables the BLAKE2 and SHA-3 algorithms in
hashlib
.Update CA bundle to certifi 2019.3.9.
Implement
pkgutil.iter_modules
.Build
pkg_resources
into all apps. Many packages require this but don’t declare a dependency on setuptools.
6.0.0 (2019-03-08)¶
Android Gradle plugin version 3.3 is now supported.
[BACKWARD INCOMPATIBLE] Android Gradle plugin version 3.0 is no longer supported.
The ABI
x86_64
is now supported.
5.1.2 (2019-01-19)¶
Add
PyObject
primitive conversion methods (toBoolean
,toInt
, etc.).Add
PyObject
container view methods (asList
,asMap
andasSet
).If
pkg_resources
is installed in your app, its “basic resource access” functions will now work.Remove directory names when converting exception stack traces from Python to Java. This works around a bug in Google Play which was causing crash reports to be incomplete.
Change default character encoding from ASCII to UTF-8.
Make APK build more reproducible.
5.0.0 (2018-11-05)¶
The ABI
arm64-v8a
is now supported.[BACKWARD INCOMPATIBLE] Each Chaquopy version will now include only one Python version, so the
version
setting is no longer required. Simply remove it to use the current version, 3.6.5.Python 2 is no longer included. However, for existing Python 2 users, Chaquopy 4.x will continue to be maintained until the end of 2019 (#39).
[BACKWARD INCOMPATIBLE] buildPython must now be at least Python 3.4.
[BACKWARD INCOMPATIBLE]
minSdkVersion
must now be at least API level 16. This still covers 99% of active devices.Runtime components are now distributed as separate Maven artifacts. This fixes various intermittent build errors involving
chaquopy_java.jar
(#62).If
pkg_resources
is installed in your app, it will now detect all pip-installed packages.
4.0.0 (2018-08-22)¶
Android Gradle plugin version 3.2 is now supported.
[BACKWARD INCOMPATIBLE] Android Gradle plugin version 2.3 is no longer supported.
Add
resource
module.Remove broken
select.kevent
/select.kqueue
API. This affected PyZMQ, which should now work (Crystax issue #1433).Set
HOME
environment variable if the system hasn’t already done so, soos.path.expanduser
can return a usable location.Implement
importlib.abc.InspectLoader.get_code
: this allowsrunpy.run_module
to be used.
3.3.2 (2018-08-01)¶
Fix pip issues involving packages with optional native components (e.g. websockets).
Work around inability of Android dynamic linker on API 22 and older to load multiple modules with the same basename (details here).
Fix
ctypes.pythonapi
andsys.abiflags
, and provide partial implementation ofsysconfig.get_config_vars
.Fix native crash in
lrintf
/feholdexcept
/fegetenv
(Crystax issue #1369).Fix
pkgutil.get_data
when used withextractPackages
, and improveextractPackages
performance.
3.3.0 (2018-06-20)¶
Add fast conversions between Python
bytes
/bytearray
and Javabyte[]
(#41).Make pip evaluate environment markers (PEP 508) and
data-requires-python
attributes (PEP 503) against the target platform rather than the build platform.Make pip only prioritize native wheels (not pure-Python wheels) over sdists of a newer version.
Fix pip issues when multiple packages provide the same directory or filename.
Improve pip error messages when packages attempt to build native code.
3.2.0 (2018-06-06)¶
3.1.0 (2018-05-30)¶
Add 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.
Because of this change, 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
andimp.load_module
.Implement implicit namespace packages on Python 3 (PEP 420).
Add partial support for
.pth files
. Only the execution of lines starting withimport
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.
3.0.0 (2018-05-15)¶
Android Gradle plugin version 3.1 is now supported.
[BACKWARD INCOMPATIBLE] Android Gradle plugin version 2.2 is no longer supported. If you’re still using Android Studio 2.2, then we highly recommend that you upgrade to the current 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.
2.1.0 (2018-04-26)¶
Add ability to load native library dependencies. This is required by the newly-added packages for PyZMQ and SciPy.
Improve pip install performance.
2.0.1 (2018-03-22)¶
Fix a crash reported on various devices, especially Samsung Galaxy J series phones.
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.
Disable upgrade notification from bundled copy of pip.
2.0.0 (2018-03-15)¶
General performance improvements: the Python unit tests now run about 25% faster.
[BACKWARD INCOMPATIBLE] 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.
Fix a crash on API level 15 caused by the license notification.
1.4.0 (2018-03-05)¶
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%.)
sys.stdin
now returns EOF rather than blocking. If you want to run some code which takes interactive text input, you may find the console app template useful.The
write
method ofsys.stdout
andsys.stderr
now returns the character count.Very long lines written to
sys.stdout
andsys.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.
1.3.0 (2018-01-15)¶
The following things now return reasonable values:
sys.argv
,sys.executable
, andplatform.platform()
.The following modules now work correctly:
sqlite3
,ssl
(#23), andtempfile
. (Requires Python version to be 2.7.14 or 3.6.3.)sys.stdout
andsys.stderr
are now directed to the Android Logcat.Add
extractPackages
, and use it by default for certifi.
1.2.0 (2018-01-07)¶
Python source directory locations can now be configured in the
sourceSets
block, just like Java.getClass
, when called on a Java object, now returns the Java object class rather than the proxy object class.Generated
static_proxy
Java files no longer produce build warnings.Ensure pip is re-run if local requirements or wheel file changes.
Add Python 2.7.14.
Include
distutils
anddoctest
modules (#20). (Requires Python version to be 2.7.14 or 3.6.3.)
1.1.0 (2017-12-22)¶
0.6.1 (2017-12-11)¶
Apps can now use certain native packages, including NumPy (#14), as well as some pure-Python packages which aren’t available from PyPI in wheel format. To support this, the
build.gradle
syntax for callingpip install
has been changed: please see the documentation.Zero-initialized Java arrays can now be created in Python, by passing an integer to the array constructor rather than a sequence.
0.5.0 (2017-11-04)¶
Support Android Gradle plugin versions 2.2 (#9) and 3.0 (#3).
Increase minimum API level to 15. This still covers 99% of active devices.
Fix array store type-checking on old Android versions.
Add
java.detach
, and fix several multi-threading issues.
0.4.3 (2017-09-21)¶
Improve startup performance.
0.4.0 (2017-09-11)¶
Add dynamic_proxy and static_proxy.
0.3.0 (2017-07-28)¶
Reflect Java class hierarchy in Python.
Represent Java exceptions with their actual classes.
Support Python unbound method syntax when calling Java methods, i.e.
ClassName.method(instance, args)
.Release GIL when calling Java constructors.
0.2.0 (2017-07-04)¶
Add import hook.
Allow nested classes to be accessed as attributes.
Improve performance.
0.1.0 (2017-06-24)¶
First public release.