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

kivy / python-for-android / 22589052960

02 Mar 2026 06:04PM UTC coverage: 63.881% (-0.006%) from 63.887%
22589052960

Pull #3198

github

web-flow
Merge f659c0c2b into 0635bc1e5
Pull Request #3198: Bump SDL3 (`3.4.2`) and SDL3_image (`3.4.0`) to the latest stable releases.

1823 of 3111 branches covered (58.6%)

Branch coverage included in aggregate %.

3 of 4 new or added lines in 3 files covered. (75.0%)

11 existing lines in 1 file now uncovered.

5287 of 8019 relevant lines covered (65.93%)

5.26 hits per line

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

38.6
/pythonforandroid/recipes/kivy/__init__.py
1
from os.path import join
8✔
2
import sys
8✔
3
import packaging.version
8✔
4

5
import sh
8✔
6
from pythonforandroid.recipe import PyProjectRecipe
8✔
7
from pythonforandroid.toolchain import current_directory, shprint
8✔
8

9

10
def is_kivy_affected_by_deadlock_issue(recipe=None, arch=None):
8✔
11
    with current_directory(join(recipe.get_build_dir(arch.arch), "kivy")):
×
12
        kivy_version = shprint(
×
13
            sh.Command(sys.executable),
14
            "-c",
15
            "import _version; print(_version.__version__)",
16
        )
17

18
        return packaging.version.parse(
×
19
            str(kivy_version)
20
        ) < packaging.version.Version("2.2.0.dev0")
21

22

23
class KivyRecipe(PyProjectRecipe):
8✔
24
    version = '2.3.1'
8✔
25
    url = 'https://github.com/kivy/kivy/archive/{version}.zip'
8✔
26
    name = 'kivy'
8✔
27

28
    depends = [('sdl2', 'sdl3'), 'pyjnius', 'setuptools', 'android']
8✔
29
    python_depends = ['certifi', 'chardet', 'idna', 'requests', 'urllib3', 'filetype']
8✔
30
    hostpython_prerequisites = ["cython>=0.29.1,<=3.0.12"]
8✔
31

32
    # sdl-gl-swapwindow-nogil.patch is needed to avoid a deadlock.
33
    # See: https://github.com/kivy/kivy/pull/8025
34
    # WARNING: Remove this patch when a new Kivy version is released.
35
    patches = [
8✔
36
        ("sdl-gl-swapwindow-nogil.patch", is_kivy_affected_by_deadlock_issue),
37
        "no-ast-str.patch"
38
    ]
39

40
    @property
8✔
41
    def need_stl_shared(self):
8✔
UNCOV
42
        if "sdl3" in self.ctx.recipe_build_order:
×
UNCOV
43
            return True
×
44
        else:
45
            return False
×
46

47
    def get_recipe_env(self, arch, **kwargs):
8✔
UNCOV
48
        env = super().get_recipe_env(arch, **kwargs)
×
49

50
        # Taken from CythonRecipe
51
        env['LDFLAGS'] = env['LDFLAGS'] + ' -L{} '.format(
×
52
            self.ctx.get_libs_dir(arch.arch) +
53
            ' -L{} '.format(self.ctx.libs_dir) +
54
            ' -L{}'.format(join(self.ctx.bootstrap.build_dir, 'obj', 'local',
55
                                arch.arch)))
UNCOV
56
        env['LDSHARED'] = env['CC'] + ' -shared'
×
57
        env['LIBLINK'] = 'NOTNONE'
×
58

59
        # NDKPLATFORM is our switch for detecting Android platform, so can't be None
60
        env['NDKPLATFORM'] = "NOTNONE"
×
NEW
UNCOV
61
        env['KIVY_CROSS_PLATFORM'] = 'android'
×
UNCOV
62
        if 'sdl2' in self.ctx.recipe_build_order:
×
UNCOV
63
            env['USE_SDL2'] = '1'
×
UNCOV
64
            env['KIVY_SPLIT_EXAMPLES'] = '1'
×
65
            sdl2_mixer_recipe = self.get_recipe('sdl2_mixer', self.ctx)
×
66
            sdl2_image_recipe = self.get_recipe('sdl2_image', self.ctx)
×
UNCOV
67
            env['KIVY_SDL2_PATH'] = ':'.join([
×
68
                join(self.ctx.bootstrap.build_dir, 'jni', 'SDL', 'include'),
69
                *sdl2_image_recipe.get_include_dirs(arch),
70
                *sdl2_mixer_recipe.get_include_dirs(arch),
71
                join(self.ctx.bootstrap.build_dir, 'jni', 'SDL2_ttf'),
72
            ])
73
        if "sdl3" in self.ctx.recipe_build_order:
×
74
            sdl3_mixer_recipe = self.get_recipe("sdl3_mixer", self.ctx)
×
75
            sdl3_image_recipe = self.get_recipe("sdl3_image", self.ctx)
×
76
            sdl3_ttf_recipe = self.get_recipe("sdl3_ttf", self.ctx)
×
77
            sdl3_recipe = self.get_recipe("sdl3", self.ctx)
×
78
            env["USE_SDL3"] = "1"
×
UNCOV
79
            env["KIVY_SPLIT_EXAMPLES"] = "1"
×
UNCOV
80
            env["KIVY_SDL3_PATH"] = ":".join(
×
81
                [
82
                    *sdl3_mixer_recipe.get_include_dirs(arch),
83
                    *sdl3_image_recipe.get_include_dirs(arch),
84
                    *sdl3_ttf_recipe.get_include_dirs(arch),
85
                    *sdl3_recipe.get_include_dirs(arch),
86
                ]
87
            )
88

89
        return env
×
90

91

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