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

kivy / python-for-android / 6215290912

17 Sep 2023 06:49PM UTC coverage: 59.095% (+1.4%) from 57.68%
6215290912

push

github

web-flow
Merge pull request #2891 from misl6/release-2023.09.16

* Update `cffi` recipe for Python 3.10 (#2800)

* Update __init__.py

version bump to 1.15.1

* Update disable-pkg-config.patch

adjust patch for 1.15.1

* Use build rather than pep517 for building (#2784)

pep517 has been renamed to pyproject-hooks, and as a consequence all of
the deprecated functionality has been removed. build now provides the
functionality required, and since we are only interested in the
metadata, we can leverage a helper function for that. I've also removed
all of the subprocess machinery for calling the wrapping function, since
it appears to not be as noisy as pep517.

* Bump actions/setup-python and actions/checkout versions, as old ones are deprecated (#2827)

* Removes `mysqldb` recipe as does not support Python 3 (#2828)

* Removes `Babel` recipe as it's not needed anymore. (#2826)

* Remove dateutil recipe, as it's not needed anymore (#2829)

* Optimize CI runs, by avoiding unnecessary rebuilds (#2833)

* Remove `pytz` recipe, as it's not needed anymore (#2830)

* `freetype` recipe: Changed the url to use https as http doesn't work (#2846)

* Fix `vlc` recipe build (#2841)

* Correct sys_platform (#2852)

On Window, sys.platform = "win32".

I think "nt" is a reference to os.name.

* Fix code string - quickstart.rst

* Bump `kivy` version to `2.2.1` (#2855)

* Use a pinned version of `Cython` for now, as most of the recipes are incompatible with `Cython==3.x.x` (#2862)

* Automatically generate required pre-requisites (#2858)

`get_required_prerequisites()` maintains a list of Prerequisites required by each platform.

But that same information is already stored in each Prerequisite class.

Rather than rather than maintaining two lists which might become inconsistent, auto-generate one.

* Use `platform.uname` instead of `os.uname` (#2857)

Advantages:

- Works cross platform, not just Unix.
- Is a namedtuple, ... (continued)

944 of 2241 branches covered (0.0%)

Branch coverage included in aggregate %.

174 of 272 new or added lines in 32 files covered. (63.97%)

9 existing lines in 5 files now uncovered.

4725 of 7352 relevant lines covered (64.27%)

2.56 hits per line

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

32.79
/pythonforandroid/recipes/lapack/__init__.py
1
'''
2
known to build with cmake version 3.23.2 and NDK r21e.
3
See https://gitlab.kitware.com/cmake/cmake/-/issues/18739
4
'''
5

6
from pythonforandroid.recipe import Recipe
4✔
7
from pythonforandroid.logger import shprint
4✔
8
from pythonforandroid.util import current_directory, ensure_dir, BuildInterruptingException
4✔
9
from multiprocessing import cpu_count
4✔
10
from os.path import join
4✔
11
import sh
4✔
12
import shutil
4✔
13
from os import environ
4✔
14
from pythonforandroid.util import build_platform, rmdir
4✔
15

16
arch_to_sysroot = {'armeabi': 'arm', 'armeabi-v7a': 'arm', 'arm64-v8a': 'arm64'}
4✔
17

18

19
def arch_to_toolchain(arch):
4✔
20
    if 'arm' in arch.arch:
×
21
        return arch.command_prefix
×
22
    return arch.arch
×
23

24

25
class LapackRecipe(Recipe):
4✔
26

27
    name = 'lapack'
4✔
28
    version = 'v3.10.1'
4✔
29
    url = 'https://github.com/Reference-LAPACK/lapack/archive/{version}.tar.gz'
4✔
30
    libdir = 'build/install/lib'
4✔
31
    built_libraries = {'libblas.so': libdir, 'liblapack.so': libdir, 'libcblas.so': libdir}
4✔
32

33
    def get_recipe_env(self, arch):
4✔
34
        env = super().get_recipe_env(arch)
×
35

36
        ndk_dir = environ.get("LEGACY_NDK")
×
37
        if ndk_dir is None:
×
38
            raise BuildInterruptingException("Please set the environment variable 'LEGACY_NDK' to point to a NDK location with gcc/gfortran support (supported NDK version: 'r21e')")
×
39

40
        GCC_VER = '4.9'
×
41
        HOST = build_platform
×
42

43
        sysroot_suffix = arch_to_sysroot.get(arch.arch, arch.arch)
×
44
        sysroot = f"{ndk_dir}/platforms/{env['NDK_API']}/arch-{sysroot_suffix}"
×
45
        FC = f"{ndk_dir}/toolchains/{arch_to_toolchain(arch)}-{GCC_VER}/prebuilt/{HOST}/bin/{arch.command_prefix}-gfortran"
×
46
        env['FC'] = f'{FC} --sysroot={sysroot}'
×
47
        if shutil.which(FC) is None:
×
48
            raise BuildInterruptingException(f"{FC} not found. See https://github.com/mzakharo/android-gfortran")
×
49
        return env
×
50

51
    def build_arch(self, arch):
4✔
52
        source_dir = self.get_build_dir(arch.arch)
×
53
        build_target = join(source_dir, 'build')
×
54
        install_target = join(build_target, 'install')
×
55

56
        ensure_dir(build_target)
×
57
        with current_directory(build_target):
×
58
            env = self.get_recipe_env(arch)
×
59
            ndk_dir = environ["LEGACY_NDK"]
×
NEW
60
            rmdir('CMakeFiles')
×
NEW
61
            shprint(sh.rm, '-f', 'CMakeCache.txt', _env=env)
×
UNCOV
62
            opts = [
×
63
                    '-DCMAKE_SYSTEM_NAME=Android',
64
                    '-DCMAKE_POSITION_INDEPENDENT_CODE=1',
65
                    '-DCMAKE_ANDROID_ARCH_ABI={arch}'.format(arch=arch.arch),
66
                    '-DCMAKE_ANDROID_NDK=' + ndk_dir,
67
                    '-DCMAKE_ANDROID_API={api}'.format(api=self.ctx.ndk_api),
68
                    '-DCMAKE_BUILD_TYPE=Release',
69
                    '-DCMAKE_INSTALL_PREFIX={}'.format(install_target),
70
                    '-DCBLAS=ON',
71
                    '-DBUILD_SHARED_LIBS=ON',
72
                    ]
73
            if arch.arch == 'armeabi-v7a':
×
74
                opts.append('-DCMAKE_ANDROID_ARM_NEON=ON')
×
75
            shprint(sh.cmake, source_dir, *opts, _env=env)
×
76
            shprint(sh.make, '-j' + str(cpu_count()), _env=env)
×
77
            shprint(sh.make, 'install', _env=env)
×
78

79

80
recipe = LapackRecipe()
4✔
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