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

kivy / python-for-android / 18508674330

14 Oct 2025 08:05PM UTC coverage: 58.795% (-0.4%) from 59.205%
18508674330

push

github

web-flow
Merge pull request #3136 from T-Dynamos/scipy_update

scipy: update to v1.16.2

1075 of 2440 branches covered (44.06%)

Branch coverage included in aggregate %.

63 of 197 new or added lines in 4 files covered. (31.98%)

1 existing line in 1 file now uncovered.

5042 of 7964 relevant lines covered (63.31%)

5.05 hits per line

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

33.96
/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 = ["numpy", "Cython>=3.0.8"]
8✔
16
    patches = ["meson.patch"]
8✔
17

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

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

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

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

NEW
66
        if os.name != "posix":
×
NEW
67
            warning("Building SciPy is only supported on Linux; skipping.")
×
NEW
68
            return
×
69

NEW
70
        super().build_arch(arch)
×
71

72

73
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