| Server IP : 123.56.80.60 / Your IP : 216.73.216.78 Web Server : Apache/2.4.54 (Win32) OpenSSL/1.1.1s PHP/7.4.33 mod_fcgid/2.3.10-dev System : Windows NT iZhx3sob14hnz7Z 10.0 build 14393 (Windows Server 2016) i586 User : SYSTEM ( 0) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Program Files/python/Lib/site-packages/PyInstaller/hooks/ |
Upload File : |
#-----------------------------------------------------------------------------
# Copyright (c) 2017-2020, 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)
#-----------------------------------------------------------------------------
import os
from PyInstaller.utils.hooks import get_package_paths
from PyInstaller.utils.hooks import is_module_satisfies
from PyInstaller import compat
# Necessary when using the vectorized subpackage
hiddenimports = ['shapely.prepared']
pkg_base, pkg_dir = get_package_paths('shapely')
binaries = []
if compat.is_win:
if compat.is_conda:
lib_dir = os.path.join(compat.base_prefix, 'Library', 'bin')
else:
lib_dir = os.path.join(pkg_dir, 'DLLs')
dll_files = ['geos_c.dll', 'geos.dll']
binaries += [(os.path.join(lib_dir, f), '.') for f in dll_files]
elif compat.is_linux:
lib_dir = os.path.join(pkg_dir, '.libs')
dest_dir = os.path.join('shapely', '.libs')
# This duplicates the libgeos*.so* files in the build. PyInstaller will
# copy them into the root of the build by default, but shapely cannot load
# them from there in linux IF shapely was installed via a whl file. The
# whl bundles its' own libgeos with a different name, something like
# libgeos_c-*.so.* but shapely tries to load libgeos_c.so if there isn't a
# ./libs directory under its' package. There is a proposed fix for this in
# shapely but it has not been accepted it:
# https://github.com/Toblerity/Shapely/pull/485
if is_module_satisfies('shapely <= 1.6'):
binaries += [(os.path.join(lib_dir, f), dest_dir) for f in os.listdir(lib_dir)]