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

kivy / python-for-android / 14421698601

12 Apr 2025 05:10PM UTC coverage: 59.196% (+0.06%) from 59.141%
14421698601

Pull #3139

github

web-flow
Merge bf75b230a into 58d148bf8
Pull Request #3139: `kivy` and `pyjnius`: switch to `PyProjectRecipe`

1054 of 2373 branches covered (44.42%)

Branch coverage included in aggregate %.

8 of 19 new or added lines in 2 files covered. (42.11%)

3 existing lines in 2 files now uncovered.

4952 of 7773 relevant lines covered (63.71%)

2.54 hits per line

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

31.58
/pythonforandroid/recipes/kivy/__init__.py
1
from os.path import join
4✔
2
from pythonforandroid.recipe import PyProjectRecipe
4✔
3

4

5
class KivyRecipe(PyProjectRecipe):
4✔
6
    version = '2.3.1'
4✔
7
    url = 'https://github.com/kivy/kivy/archive/{version}.zip'
4✔
8
    name = 'kivy'
4✔
9

10
    depends = [('sdl2', 'sdl3'), 'pyjnius', 'setuptools']
4✔
11
    python_depends = ['certifi', 'chardet', 'idna', 'requests', 'urllib3', 'filetype']
4✔
12
    hostpython_prerequisites = []
4✔
13
    patches = ["use_cython.patch"]
4✔
14

15
    def get_recipe_env(self, arch, **kwargs):
4✔
NEW
16
        env = super().get_recipe_env(arch, **kwargs)
×
17
        # NDKPLATFORM is our switch for detecting Android platform, so can't be None
18
        env['NDKPLATFORM'] = "NOTNONE"
×
NEW
19
        env['LIBLINK'] = "NOTNONE"
×
20

21
        if 'sdl2' in self.ctx.recipe_build_order:
×
22
            env['USE_SDL2'] = '1'
×
23
            env['KIVY_SPLIT_EXAMPLES'] = '1'
×
24
            sdl2_mixer_recipe = self.get_recipe('sdl2_mixer', self.ctx)
×
25
            sdl2_image_recipe = self.get_recipe('sdl2_image', self.ctx)
×
NEW
26
            sdl2_recipe = self.get_recipe("sdl2", self.ctx)
×
NEW
27
            libdir = join(sdl2_recipe.get_build_dir(arch.arch), "../..", "libs", arch.arch)
×
UNCOV
28
            env['KIVY_SDL2_PATH'] = ':'.join([
×
29
                join(self.ctx.bootstrap.build_dir, 'jni', 'SDL', 'include'),
30
                *sdl2_image_recipe.get_include_dirs(arch),
31
                *sdl2_mixer_recipe.get_include_dirs(arch),
32
                join(self.ctx.bootstrap.build_dir, 'jni', 'SDL2_ttf'),
33
            ])
34

35
        if "sdl3" in self.ctx.recipe_build_order:
×
36
            sdl3_mixer_recipe = self.get_recipe("sdl3_mixer", self.ctx)
×
37
            sdl3_image_recipe = self.get_recipe("sdl3_image", self.ctx)
×
38
            sdl3_ttf_recipe = self.get_recipe("sdl3_ttf", self.ctx)
×
39
            sdl3_recipe = self.get_recipe("sdl3", self.ctx)
×
NEW
40
            libdir = join(sdl3_recipe.get_build_dir(arch.arch), "../..", "libs", arch.arch)
×
41
            env["USE_SDL3"] = "1"
×
42
            env["KIVY_SPLIT_EXAMPLES"] = "1"
×
43
            env["KIVY_SDL3_PATH"] = ":".join(
×
44
                [
45
                    *sdl3_mixer_recipe.get_include_dirs(arch),
46
                    *sdl3_image_recipe.get_include_dirs(arch),
47
                    *sdl3_ttf_recipe.get_include_dirs(arch),
48
                    *sdl3_recipe.get_include_dirs(arch),
49
                ]
50
            )
51

NEW
52
        env["LDFLAGS"] += f" -L{libdir}"
×
UNCOV
53
        return env
×
54

55

56
recipe = KivyRecipe()
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