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

kivy / python-for-android / 17711405930

14 Sep 2025 12:50PM UTC coverage: 59.214%. Remained the same
17711405930

Pull #3211

github

web-flow
Merge cd9cda204 into 5330267b5
Pull Request #3211: `pillow`: update to `11.3.0`

1060 of 2385 branches covered (44.44%)

Branch coverage included in aggregate %.

3 of 3 new or added lines in 1 file covered. (100.0%)

7 existing lines in 1 file now uncovered.

4965 of 7790 relevant lines covered (63.74%)

2.54 hits per line

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

35.48
/pythonforandroid/recipes/Pillow/__init__.py
1
from os.path import join
4✔
2

3
from pythonforandroid.recipe import PyProjectRecipe
4✔
4

5

6
class PillowRecipe(PyProjectRecipe):
4✔
7
    """
8
    A recipe for Pillow (previously known as Pil).
9

10
    This recipe allow us to build the Pillow recipe with support for different
11
    types of images and fonts. But you should be aware, that in order to  use
12
    some of the features of  Pillow, we must build some libraries. By default
13
    we automatically trigger the build of below libraries::
14

15
        - freetype: rendering fonts support.
16
        - harfbuzz: a text shaping library.
17
        - jpeg: reading and writing JPEG image files.
18
        - png: support for PNG images.
19

20
    But you also could enable the build of some extra image types by requesting
21
    the build of some libraries via argument `requirements`::
22

23
        - libwebp: library to encode and decode images in WebP format.
24
    """
25

26
    version = '11.3.0'
4✔
27
    url = 'https://github.com/python-pillow/Pillow/archive/{version}.tar.gz'
4✔
28
    site_packages_name = 'PIL'
4✔
29
    patches = ["setup.py.patch"]
4✔
30
    depends = ['png', 'jpeg', 'freetype', 'setuptools']
4✔
31
    opt_depends = ['libwebp']
4✔
32

33
    def get_recipe_env(self, arch, **kwargs):
4✔
UNCOV
34
        env = super().get_recipe_env(arch, **kwargs)
×
35

UNCOV
36
        jpeg = self.get_recipe('jpeg', self.ctx)
×
37
        jpeg_inc_dir = jpeg_lib_dir = jpeg.get_build_dir(arch.arch)
×
38
        env["JPEG_ROOT"] = "{}:{}".format(jpeg_lib_dir, jpeg_inc_dir)
×
39

UNCOV
40
        freetype = self.get_recipe('freetype', self.ctx)
×
41
        free_lib_dir = join(freetype.get_build_dir(arch.arch), 'objs', '.libs')
×
42
        free_inc_dir = join(freetype.get_build_dir(arch.arch), 'include')
×
43
        env["FREETYPE_ROOT"] = "{}:{}".format(free_lib_dir, free_inc_dir)
×
44

45
        # harfbuzz is a direct dependency of freetype and we need the proper
46
        # flags to successfully build the Pillow recipe, so we add them here.
UNCOV
47
        harfbuzz = self.get_recipe('harfbuzz', self.ctx)
×
48
        harf_lib_dir = join(harfbuzz.get_build_dir(arch.arch), 'src', '.libs')
×
49
        harf_inc_dir = harfbuzz.get_build_dir(arch.arch)
×
50
        env["HARFBUZZ_ROOT"] = "{}:{}".format(harf_lib_dir, harf_inc_dir)
×
51

UNCOV
52
        env["ZLIB_ROOT"] = f"{arch.ndk_lib_dir_versioned}:{self.ctx.ndk.sysroot_include_dir}"
×
53

54
        # libwebp is an optional dependency, so we add the
55
        # flags if we have it in our `ctx.recipe_build_order`
UNCOV
56
        if 'libwebp' in self.ctx.recipe_build_order:
×
57
            webp = self.get_recipe('libwebp', self.ctx)
×
58
            webp_install = join(
×
59
                webp.get_build_dir(arch.arch), 'installation'
60
            )
UNCOV
61
            env["WEBP_ROOT"] = f"{join(webp_install, 'lib')}:{join(webp_install, 'include')}"
×
62
        return env
×
63

64

65
recipe = PillowRecipe()
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