-
-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hooks: improve hook for pillow [macos] (#1952)
- Loading branch information
1 parent
bd25e07
commit 5ba5144
Showing
2 changed files
with
20 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
"""A collection of functions which are triggered automatically by finder when | ||
Pillow (PIL) package is included. | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
from .._compat import IS_MACOS | ||
from ..finder import ModuleFinder | ||
from ..module import Module | ||
|
||
|
||
def load_pil(finder: ModuleFinder, module: Module) -> None: | ||
"""The Pillow must be loaded as a package.""" | ||
finder.include_package("PIL") | ||
|
||
# [macos] copy dependent files when using zip_include_packages | ||
if IS_MACOS: | ||
source_dir = module.file.parent / ".dylibs" | ||
if source_dir.exists() and module.in_file_system == 0: | ||
finder.include_files(source_dir, "lib/.dylibs") |