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

kivy / python-for-android / 25435676503

06 May 2026 12:37PM UTC coverage: 62.876% (-1.0%) from 63.887%
25435676503

Pull #3278

github

web-flow
Merge 3c07c5446 into 3ab2fd669
Pull Request #3278: Handling system bars and Edge-to-Edge enforcement (android 15+)

1832 of 3180 branches covered (57.61%)

Branch coverage included in aggregate %.

5329 of 8209 relevant lines covered (64.92%)

5.18 hits per line

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

34.62
/pythonforandroid/recipes/scipy/__init__.py
1
import os
8✔
2
from os.path import join, dirname, basename
8✔
3
from pythonforandroid.recipe import MesonRecipe, Recipe
8✔
4
from pythonforandroid.logger import warning
8✔
5
from pathlib import Path
8✔
6

7

8
class ScipyRecipe(MesonRecipe):
8✔
9

10
    version = "v1.16.2"
8✔
11
    url = "git+https://github.com/scipy/scipy.git"
8✔
12
    depends = ["numpy", "libopenblas", "fortran"]
8✔
13
    need_stl_shared = True
8✔
14
    meson_version = "1.5.0"
8✔
15
    hostpython_prerequisites = [
8✔
16
        "numpy",
17
        "Cython>=3.0.8",
18
        "pybind11>=2.13.2,<3.1.0",
19
    ]
20
    patches = ["meson.patch"]
8✔
21

22
    def get_recipe_meson_options(self, arch):
8✔
23
        options = super().get_recipe_meson_options(arch)
×
24
        options["binaries"]["fortran"] = self.place_wrapper(arch)
×
25
        options["properties"]["numpy-include-dir"] = join(
×
26
            self.ctx.get_python_install_dir(arch.arch), "numpy/_core/include"
27
        )
28
        self.ensure_args(
×
29
            "-Csetup-args=-Dblas=openblas",
30
            "-Csetup-args=-Dlapack=openblas",
31
            f"-Csetup-args=-Dopenblas_libdir={self.ctx.get_libs_dir(arch.arch)}",
32
            f'-Csetup-args=-Dopenblas_incldir={join(Recipe.get_recipe("libopenblas", self.ctx).get_build_dir(arch.arch), "build")}',
33
            "-Csetup-args=-Duse-pythran=false",
34
        )
35
        return options
×
36

37
    def place_wrapper(self, arch):
8✔
38
        compiler = Recipe.get_recipe("fortran", self.ctx).get_fortran_bin(arch.arch)
×
39
        file = join(self.get_recipe_dir(), "wrapper.py")
×
40
        with open(file, "r") as _file:
×
41
            data = _file.read()
×
42
            _file.close()
×
43
        data = data.replace("@COMPILER@", compiler)
×
44
        # custom compiler
45
        # taken from: https://github.com/termux/termux-packages/blob/master/packages/python-scipy/
46
        m_compiler = Path(join(dirname(compiler), basename(compiler) + "-scipy"))
×
47
        m_compiler.write_text(data)
×
48
        m_compiler.chmod(0o755)
×
49
        self.patch_shebang(str(m_compiler), self.real_hostpython_location)
×
50
        return str(m_compiler)
×
51

52
    def get_recipe_env(self, arch, **kwargs):
8✔
53
        env = super().get_recipe_env(arch, **kwargs)
×
54
        arch_env = arch.get_env()
×
55
        env["LDFLAGS"] = arch_env["LDFLAGS"]
×
56
        env["LDFLAGS"] += " -L{} -lpython{}".format(
×
57
            self.ctx.python_recipe.link_root(arch.arch),
58
            self.ctx.python_recipe.link_version,
59
        )
60
        return env
×
61

62
    def build_arch(self, arch):
8✔
63
        if arch.arch not in ["arm64-v8a", "x86_64"]:
×
64
            warning(
×
65
                "SciPy supports only 64-bit Android architectures: arm64-v8a and x86_64; skipping build."
66
            )
67
            return
×
68

69
        if os.name != "posix":
×
70
            warning("Building SciPy is only supported on Linux; skipping.")
×
71
            return
×
72

73
        super().build_arch(arch)
×
74

75

76
recipe = ScipyRecipe()
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