• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kivy / python-for-android / 26583357349

28 May 2026 03:08PM UTC coverage: 62.692% (-0.04%) from 62.732%
26583357349

Pull #3305

github

web-flow
Merge 426c786af into 4174efe23
Pull Request #3305: numpy: enable openblas

1832 of 3192 branches covered (57.39%)

Branch coverage included in aggregate %.

1 of 7 new or added lines in 1 file covered. (14.29%)

1 existing line in 1 file now uncovered.

5407 of 8355 relevant lines covered (64.72%)

3.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

44.44
/pythonforandroid/recipes/numpy/__init__.py
1
from pythonforandroid.recipe import Recipe, MesonRecipe
6✔
2
from os.path import join
6✔
3
import shutil
6✔
4

5
NUMPY_NDK_MESSAGE = (
6✔
6
    "In order to build numpy, you must set minimum ndk api (minapi) to `24`.\n"
7
)
8

9

10
class NumpyRecipe(MesonRecipe):
6✔
11
    version = "v2.3.0"
6✔
12
    url = "git+https://github.com/numpy/numpy"
6✔
13
    extra_build_args = ["-Csetup-args=-Dblas=none", "-Csetup-args=-Dlapack=none"]
6✔
14
    opt_depends = ["libopenblas"]
6✔
15
    need_stl_shared = True
6✔
16
    min_ndk_api_support = 24
6✔
17

18
    def get_include(self, arch):
6✔
19
        return join(
×
20
            self.ctx.get_python_install_dir(arch.arch), "numpy/_core/include",
21
        )
22

23
    def get_recipe_meson_options(self, arch):
6✔
24
        options = super().get_recipe_meson_options(arch)
×
25
        options["properties"]["longdouble_format"] = (
×
26
            "IEEE_DOUBLE_LE" if arch.arch in ["armeabi-v7a", "x86"] else "IEEE_QUAD_LE"
27
        )
28
        return options
×
29

30
    def get_recipe_env(self, arch, **kwargs):
6✔
31
        env = super().get_recipe_env(arch, **kwargs)
×
32

33
        # _PYTHON_HOST_PLATFORM declares that we're cross-compiling
34
        # and avoids issues when building on macOS for Android targets.
35
        env["_PYTHON_HOST_PLATFORM"] = arch.command_prefix
×
36

37
        # NPY_DISABLE_SVML=1 allows numpy to build for non-AVX512 CPUs
38
        # See: https://github.com/numpy/numpy/issues/21196
39
        env["NPY_DISABLE_SVML"] = "1"
×
40
        env["TARGET_PYTHON_EXE"] = join(
×
41
            Recipe.get_recipe("python3", self.ctx).get_build_dir(arch.arch),
42
            "android-build",
43
            "python",
44
        )
NEW
45
        blas_dir = join(Recipe.get_recipe("libopenblas", self.ctx
×
46
        ).get_build_dir(arch.arch), "build")
NEW
47
        blas_incdir = blas_dir
×
NEW
48
        blas_libdir = join(blas_dir, "lib")
×
NEW
49
        env["CXXFLAGS"] += f" -I{blas_incdir} -L{blas_libdir}"
×
50

NEW
51
        if 'libopenblas' in self.ctx.recipe_build_order:
×
NEW
52
            self.extra_build_args = [
×
53
                "-Csetup-args=-Dblas=auto",
54
                "-Csetup-args=-Dlapack=auto",
55
                "-Csetup-args=-Dallow-noblas=False",
56
            ]
57

UNCOV
58
        return env
×
59

60
    def get_hostrecipe_env(self, arch=None):
6✔
61
        env = super().get_hostrecipe_env(arch=arch)
×
62
        env["RANLIB"] = shutil.which("ranlib")
×
63
        return env
×
64

65

66
recipe = NumpyRecipe()
6✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc