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

kivy / python-for-android / 24960090253

26 Apr 2026 03:22PM UTC coverage: 62.913% (-0.02%) from 62.932%
24960090253

Pull #3305

github

web-flow
Merge f5e9ee0c7 into 869c74bba
Pull Request #3305: numpy: enable openblas

1832 of 3175 branches covered (57.7%)

Branch coverage included in aggregate %.

2 of 6 new or added lines in 1 file covered. (33.33%)

1 existing line in 1 file now uncovered.

5330 of 8209 relevant lines covered (64.93%)

5.18 hits per line

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

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

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

9

10
class NumpyRecipe(MesonRecipe):
8✔
11
    version = "v2.3.0"
8✔
12
    url = "git+https://github.com/numpy/numpy"
8✔
13
    depends = ["libopenblas"]
8✔
14
    extra_build_args = [
8✔
15
        "-Csetup-args=-Dblas=auto",
16
        "-Csetup-args=-Dlapack=auto",
17
        "-Csetup-args=-Dallow-noblas=False",
18
    ]
19
    need_stl_shared = True
8✔
20
    min_ndk_api_support = 24
8✔
21

22
    def get_include(self, arch):
8✔
23
        return join(
×
24
            self.ctx.get_python_install_dir(arch.arch), "numpy/_core/include",
25
        )
26

27
    def get_recipe_meson_options(self, arch):
8✔
28
        options = super().get_recipe_meson_options(arch)
×
29
        options["properties"]["longdouble_format"] = (
×
30
            "IEEE_DOUBLE_LE" if arch.arch in ["armeabi-v7a", "x86"] else "IEEE_QUAD_LE"
31
        )
32
        return options
×
33

34
    def get_recipe_env(self, arch, **kwargs):
8✔
35
        env = super().get_recipe_env(arch, **kwargs)
×
36

37
        # _PYTHON_HOST_PLATFORM declares that we're cross-compiling
38
        # and avoids issues when building on macOS for Android targets.
39
        env["_PYTHON_HOST_PLATFORM"] = arch.command_prefix
×
40

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

56
    def get_hostrecipe_env(self, arch=None):
8✔
57
        env = super().get_hostrecipe_env(arch=arch)
×
58
        env["RANLIB"] = shutil.which("ranlib")
×
59
        return env
×
60

61

62
recipe = NumpyRecipe()
8✔
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