Skip to content

Add support for prebuilt wheels#3280

Draft
T-Dynamos wants to merge 4 commits intokivy:developfrom
T-Dynamos:prebuilt_wheels
Draft

Add support for prebuilt wheels#3280
T-Dynamos wants to merge 4 commits intokivy:developfrom
T-Dynamos:prebuilt_wheels

Conversation

@T-Dynamos
Copy link
Member

@T-Dynamos T-Dynamos commented Feb 14, 2026

New options

--extra-index-url

Additional package indexes to search for prebuilt wheels.
Can be used multiple times.

Example:

--extra-index-url https://chaquo.com/pypi-13.1/ \
--extra-index-url https://anshdadwal.is-a.dev/p4a-wheels/p4a/

--skip-prebuilt

Do not use prebuilt wheels; always build from source.

--use-prebuilt-version-for

For these packages, ignore recipe-pinned versions and use the latest prebuilt from the extra index if available.
Only applies to packages with a recipe.
Can be used multiple times.

Example:

--use-prebuilt-version-for numpy

--save-wheel-dir

Directory where wheels built by PyProjectRecipe are saved.

If set, any wheel produced during a recipe build is copied to this directory.

New behavior

When a recipe (any PyProjectRecipe) is built, it checks whether a prebuilt version is available. If so, it uses it; otherwise, it falls back to building from source.

test requirements: requirements = python3, kivy==master, numpy, openai

with --use-prebuilt-version-for kivy

[INFO]:    Building numpy for arm64-v8a
[INFO]:    numpy apparently isn't already in site-packages
[INFO]:    Writing cross file at: /tmp/android.meson.cross
[DEBUG]:   -> running pip3 install numpy==2.3.0 --ignore-installed --disable-pip-version-check --python-version 3.14.2 --only-binary=:all: --no-deps --platform=android_24_arm64_v8a --platform=android_24_aarch64 --extra-index-url https://anshdadwal.is-a.dev/p4a-wheels/p4a/ --extra-index-url https://chaquo.com/pypi-13.1/ --dry-run
[DEBUG]:   	Defaulting to user installation because normal site-packages is not writeable
[DEBUG]:   	Looking in indexes: https://pypi.org/simple, https://anshdadwal.is-a.dev/p4a-wheels/p4a/, https://chaquo.com/pypi-13.1/
[DEBUG]:   	Collecting numpy==2.3.0
[DEBUG]:   	 Downloading https://github.com/T-Dynamos/p4a-wheels/releases/download/1.2/numpy-2.3.0-cp314-cp314-android_24_aarch64.whl (6.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.9/6.9 MB 683.1 kB/s  0:00:09
[DEBUG]:   	Would install numpy-2.3.0
[INFO]:    Prebuilt pip wheel found, skipping build_arch
[INFO]:    Installing prebuilt built wheel
[DEBUG]:   -> running pip3 install numpy==2.3.0 --ignore-installed --disable-pip-version-check --python-version 3.14.2 --only-binary=:all: --no-deps --platform=android_24_arm64_v8a --platform=android_24_aarch64 --extra-index-url https://anshdadwal.is-a.dev/p4a-wheels/p4a/ --extra-index-url https://chaquo.com/pypi-13.1/ --target /home/tdynamos/EarthFM/.buildozer/android/platform/build-arm64-v8a_armeabi_v7a/build/python-installs/earthfm/arm64-v8a --upgrade
[DEBUG]:   	Looking in indexes: https://pypi.org/simple, https://anshdadwal.is-a.dev/p4a-wheels/p4a/, https://chaquo.com/pypi-13.1/
[DEBUG]:   	Collecting numpy==2.3.0
[DEBUG]:   	 Using cached https://github.com/T-Dynamos/p4a-wheels/releases/download/1.2/numpy-2.3.0-cp314-cp314-android_24_aarch64.whl (6.9 MB)
[DEBUG]:   	Installing collected packages: numpy
[DEBUG]:   	Successfully installed numpy-2.3.0


[INFO]:    Building kivy for arm64-v8a
[INFO]:    kivy apparently isn't already in site-packages
[DEBUG]:   -> running pip3 install kivy --ignore-installed --disable-pip-version-check --python-version 3.14.2 --only-binary=:all: --no-deps --platform=android_24_arm64_v8a --platform=android_24_aarch64 --extra-index-url https://anshdadwal.is-a.dev/p4a-wheels/p4a/ --extra-index-url https://chaquo.com/pypi-13.1/ --dry-run
[DEBUG]:   	Defaulting to user installation because normal site-packages is not writeable
[DEBUG]:   	Looking in indexes: https://pypi.org/simple, https://anshdadwal.is-a.dev/p4a-wheels/p4a/, https://chaquo.com/pypi-13.1/
[DEBUG]:   	Collecting kivy
[DEBUG]:   	 Downloading https://github.com/T-Dynamos/p4a-wheels/releases/download/1.2/kivy-2.3.1-cp314-cp314-android_24_aarch64.whl (5.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.5/5.5 MB 3.6 MB/s  0:00:01
[DEBUG]:   	Would install Kivy-2.3.1
[INFO]:    Prebuilt pip wheel found, skipping build_arch
[INFO]:    Installing prebuilt built wheel
[DEBUG]:   -> running pip3 install kivy --ignore-installed --disable-pip-version-check --python-version 3.14.2 --only-binary=:all: --no-deps --platform=android_24_arm64_v8a --platform=android_24_aarch64 --extra-index-url https://anshdadwal.is-a.dev/p4a-wheels/p4a/ --extra-index-url https://chaquo.com/pypi-13.1/ --target /home/tdynamos/EarthFM/.buildozer/android/platform/build-arm64-v8a_armeabi_v7a/build/python-installs/earthfm/arm64-v8a --upgrade
[DEBUG]:   	Looking in indexes: https://pypi.org/simple, https://anshdadwal.is-a.dev/p4a-wheels/p4a/, https://chaquo.com/pypi-13.1/
[DEBUG]:   	Collecting kivy
[DEBUG]:   	 Using cached https://github.com/T-Dynamos/p4a-wheels/releases/download/1.2/kivy-2.3.1-cp314-cp314-android_24_aarch64.whl (5.5 MB)
[DEBUG]:   	Installing collected packages: kivy
[DEBUG]:   	Successfully installed kivy-2.3.1

Also works if a package recipe does not exist; available packages are installed at a later stage.

TODO:

  1. Add options in buildozer, currently works like:
p4a.extra_args =  --extra-index-url https://anshdadwal.is-a.dev/p4a-wheels/p4a/ --extra-index-url https://chaquo.com/pypi-13.1/ 

@T-Dynamos T-Dynamos marked this pull request as ready for review February 14, 2026 16:43
@T-Dynamos
Copy link
Member Author

Not sure why ci is failing.

System.IO.IOException: No space left on device

wheel_tag = wheel_tags(
_wheel,
platform_tags=self.get_wheel_platform_tag(arch),
platform_tags=self.get_wheel_platform_tag(arch.arch)[0],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

platform_tags=self.get_wheel_platform_tag(arch.arch)[0], could be prettier with platform_tags=next(self.get_wheel_platform_tag(arch.arch)),

@T-Dynamos T-Dynamos marked this pull request as draft February 15, 2026 00:01
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