• 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

47.06
/pythonforandroid/recipes/pyjnius/__init__.py
1
from pythonforandroid.recipe import PyProjectRecipe
8✔
2
from pythonforandroid.toolchain import shprint, current_directory, info
8✔
3
from pythonforandroid.patching import will_build
8✔
4
import sh
8✔
5
from os.path import exists, join
8✔
6

7

8
class PyjniusRecipe(PyProjectRecipe):
8✔
9
    version = '1.7.0'
8✔
10
    url = 'https://github.com/kivy/pyjnius/archive/{version}.zip'
8✔
11
    name = 'pyjnius'
8✔
12
    depends = [('genericndkbuild', 'sdl2', 'sdl3'), 'six']
8✔
13
    site_packages_name = 'jnius'
8✔
14
    hostpython_prerequisites = ["Cython<3.2"]
8✔
15
    patches = [
8✔
16
        "use_cython.patch",
17
        ('genericndkbuild_jnienv_getter.patch', will_build('genericndkbuild')),
18
        ('sdl3_jnienv_getter.patch', will_build('sdl3')),
19
    ]
20

21
    def get_recipe_env(self, arch, **kwargs):
8✔
22
        env = super().get_recipe_env(arch, **kwargs)
×
23

24
        generic_main_libs = (
×
25
            join(self.ctx.bootstrap.build_dir, 'libs', arch.arch,
26
                 'libmain_{}.so'.format(arch.arch)),
27
            join(self.ctx.bootstrap.build_dir, 'obj', 'local', arch.arch,
28
                 'libmain_{}.so'.format(arch.arch)),
29
        )
30
        if any(exists(lib) for lib in generic_main_libs):
×
31
            env['PYJNIUS_ANDROID_LIBMAIN'] = 'main_{}'.format(arch.arch)
×
32

33
        # Taken from CythonRecipe
34
        env['LDFLAGS'] = env['LDFLAGS'] + ' ' + ' '.join([
×
35
            '-L{}'.format(self.ctx.get_libs_dir(arch.arch)),
36
            '-L{}'.format(self.ctx.libs_dir),
37
            '-L{}'.format(join(self.ctx.bootstrap.build_dir, 'libs',
38
                               arch.arch)),
39
            '-L{}'.format(join(self.ctx.bootstrap.build_dir, 'obj', 'local',
40
                               arch.arch)),
41
        ])
42
        env['LDSHARED'] = env['CC'] + ' -shared'
×
43
        env['LIBLINK'] = 'NOTNONE'
×
44

45
        # NDKPLATFORM is our switch for detecting Android platform, so can't be None
46
        env['NDKPLATFORM'] = "NOTNONE"
×
47
        return env
×
48

49
    def postbuild_arch(self, arch):
8✔
50
        super().postbuild_arch(arch)
×
51
        info('Copying pyjnius java class to classes build dir')
×
52
        with current_directory(self.get_build_dir(arch.arch)):
×
53
            shprint(sh.cp, '-a', join('jnius', 'src', 'org'), self.ctx.javaclass_dir)
×
54

55

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