forked from pyinstaller/pyinstaller
-
Notifications
You must be signed in to change notification settings - Fork 2
/
hook-importlib_resources.py
22 lines (19 loc) · 1015 Bytes
/
hook-importlib_resources.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#-----------------------------------------------------------------------------
# Copyright (c) 2019-2023, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#
# SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)
#-----------------------------------------------------------------------------
"""
`importlib_resources` is a backport of the 3.9+ module `importlib.resources`
"""
from PyInstaller.utils.hooks import check_requirement, collect_data_files
# Prior to v1.2.0, a `version.txt` file is used to set __version__. Later versions use `importlib.metadata`.
if check_requirement("importlib_resources < 1.2.0"):
datas = collect_data_files("importlib_resources", includes=["version.txt"])
if check_requirement("importlib_resources >= 1.3.1"):
hiddenimports = ['importlib_resources.trees']