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

kivy / python-for-android / 14978138719

12 May 2025 05:01PM UTC coverage: 59.171% (-0.03%) from 59.204%
14978138719

Pull #3135

github

web-flow
Merge d2911a7b2 into 40993e323
Pull Request #3135: `sdl2_image`: fix downloading

1054 of 2377 branches covered (44.34%)

Branch coverage included in aggregate %.

1 of 8 new or added lines in 1 file covered. (12.5%)

1 existing line in 1 file now uncovered.

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

44.44
/pythonforandroid/recipes/sdl2_image/__init__.py
1
import os
4✔
2
import sh
4✔
3
from pythonforandroid.logger import shprint
4✔
4
from pythonforandroid.recipe import BootstrapNDKRecipe
4✔
5

6

7
class LibSDL2Image(BootstrapNDKRecipe):
4✔
8
    version = '2.8.2'
4✔
9
    url = 'https://github.com/libsdl-org/SDL_image/releases/download/release-{version}/SDL2_image-{version}.tar.gz'
4✔
10
    dir_name = 'SDL2_image'
4✔
11

12
    patches = ['enable-webp.patch']
4✔
13

14
    def get_include_dirs(self, arch):
4✔
15
        return [
×
16
            os.path.join(self.ctx.bootstrap.build_dir, "jni", "SDL2_image", "include")
17
        ]
18

19
    def prebuild_arch(self, arch):
4✔
20
        # We do not have a folder for each arch on BootstrapNDKRecipe, so we
21
        # need to skip the external deps download if we already have done it.
22

NEW
23
        build_dir = self.get_build_dir(arch.arch)
×
24

NEW
25
        with open(os.path.join(build_dir, ".gitmodules"), "r") as file:
×
NEW
26
            for section in file.read().split('[submodule "')[1:]:
×
NEW
27
                line_split = section.split(" = ")
×
28
                # Parse .gitmodule section
NEW
29
                clone_path, url, branch = (
×
30
                    os.path.join(build_dir, line_split[1].split("\n")[0].strip()),
31
                    line_split[2].split("\n")[0].strip(),
32
                    line_split[-1].strip()
33
                )
34
                # Clone if needed
NEW
35
                if not os.path.exists(clone_path) or not os.listdir(clone_path):
×
NEW
36
                    shprint(
×
37
                        sh.git, "clone", url,
38
                        "--depth", "1", "-b",
39
                        branch, clone_path, "--recursive"
40
                    )
41

UNCOV
42
        super().prebuild_arch(arch)
×
43

44

45
recipe = LibSDL2Image()
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