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

kivy / python-for-android / 15970879696

30 Jun 2025 10:49AM UTC coverage: 59.171%. Remained the same
15970879696

Pull #3167

github

web-flow
Merge d06eae9ee into be3de2e28
Pull Request #3167: Update broadcast.py

1054 of 2377 branches covered (44.34%)

Branch coverage included in aggregate %.

4956 of 7780 relevant lines covered (63.7%)

2.54 hits per line

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

28.57
/pythonforandroid/recipes/libpthread/__init__.py
1
from os import makedirs, remove
4✔
2
from os.path import exists, join
4✔
3
import sh
4✔
4

5
from pythonforandroid.recipe import Recipe
4✔
6
from pythonforandroid.logger import shprint
4✔
7

8

9
class LibPthread(Recipe):
4✔
10
    '''
11
    This is a dumb recipe. We may need this because some recipes inserted some
12
    flags `-lpthread` without our control, case of:
13

14
        - :class:`~pythonforandroid.recipes.uvloop.UvloopRecipe`
15

16
    .. note:: the libpthread doesn't exist in android but it is integrated into
17
        libc, so we create a symbolic link which we will remove when our build
18
        finishes'''
19

20
    def build_arch(self, arch):
4✔
21
        libc_path = join(arch.ndk_lib_dir_versioned, 'libc')
×
22
        # Create a temporary folder to add to link path with a fake libpthread.so:
23
        fake_libpthread_temp_folder = join(
×
24
            self.get_build_dir(arch.arch),
25
            "p4a-libpthread-recipe-tempdir"
26
        )
27
        if not exists(fake_libpthread_temp_folder):
×
28
            makedirs(fake_libpthread_temp_folder)
×
29

30
        # Set symlinks, and make sure to update them on every build run:
31
        if exists(join(fake_libpthread_temp_folder, "libpthread.so")):
×
32
            remove(join(fake_libpthread_temp_folder, "libpthread.so"))
×
33
        shprint(sh.ln, '-sf',
×
34
                libc_path + '.so',
35
                join(fake_libpthread_temp_folder, "libpthread.so"),
36
                )
37
        if exists(join(fake_libpthread_temp_folder, "libpthread.a")):
×
38
            remove(join(fake_libpthread_temp_folder, "libpthread.a"))
×
39
        shprint(sh.ln, '-sf',
×
40
                libc_path + '.a',
41
                join(fake_libpthread_temp_folder, "libpthread.a"),
42
               )
43

44
        # Add folder as -L link option for all recipes if not done yet:
45
        if fake_libpthread_temp_folder not in arch.extra_global_link_paths:
×
46
            arch.extra_global_link_paths.append(
×
47
                fake_libpthread_temp_folder
48
            )
49

50

51
recipe = LibPthread()
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