Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pyinstaller-hooks-contrib for openSUSE:Factory checked in at 2022-11-12 17:40:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pyinstaller-hooks-contrib (Old) and /work/SRC/openSUSE:Factory/.python-pyinstaller-hooks-contrib.new.1597 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pyinstaller-hooks-contrib" Sat Nov 12 17:40:54 2022 rev:2 rq:1035241 version:2022.12 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pyinstaller-hooks-contrib/python-pyinstaller-hooks-contrib.changes 2022-09-30 17:58:57.861398663 +0200 +++ /work/SRC/openSUSE:Factory/.python-pyinstaller-hooks-contrib.new.1597/python-pyinstaller-hooks-contrib.changes 2022-11-12 17:41:10.430169664 +0100 @@ -1,0 +2,24 @@ +Wed Nov 9 18:30:17 UTC 2022 - Yogalakshmi Arunachalam <yarunacha...@suse.com> + +- Update to version 2022.12 + New hooks + * Add hook for discid. (#506) + * Add hook for exchangelib. (#508) + +- Update to versino 2022.11 + * New hooks + Add a hook for spiceypy, which has binary files. (#482) + Added a hook for ldfparser. (#483) + * Updated hooks + Extend the sounddevice and soundfile hooks to collect system-installed shared libraries in cases when the libraries are + not bundled with the package (i.e., linux PyPI wheels, Anaconda on all OSes). (#487) + Fix a TypeError raised by the clr hook when pythonnet dist lacks the file list metadata. (#486) + Have clr hook check for availability of the pythonnet before trying to query its metadata. Fixes an importlib.metadata.PackageNotFoundError + raised by the clr hook when the hook is triggered by a module or a package named clr other than the clr extension module from pythonnet. (#486) + Have the pyqtgraph hook collect the colormap files and their license files from the package. (#501) + Implement preliminary support for handling subprocesses used by pyqtgraph.multiprocess, for example in pyqtgraph RemoteGraphicsView widget. + The user is still required to ensure that stdlib's multiprocessing.freeze_support is called in the entry-point script before using pyqtgraph. + In addition, with onefile builds, the user must set the _MEIPASS2 environment variable to the value of sys._MEIPASS before using pyqtgraph. (#501) + In clr hook for pythonnet collect the Python.Runtime.dll as a data file on non-Windows OSes to prevent errors during binary dependency analysis. (#500) + +------------------------------------------------------------------- Old: ---- pyinstaller-hooks-contrib-2022.10.tar.gz New: ---- pyinstaller-hooks-contrib-2022.12.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pyinstaller-hooks-contrib.spec ++++++ --- /var/tmp/diff_new_pack.9bu8JQ/_old 2022-11-12 17:41:11.946178689 +0100 +++ /var/tmp/diff_new_pack.9bu8JQ/_new 2022-11-12 17:41:11.950178712 +0100 @@ -1,5 +1,5 @@ # -# spec file for package python-pyinstaller-hooks-contrib +# spec file # # Copyright (c) 2022 SUSE LLC # @@ -26,7 +26,7 @@ %bcond_with test %endif Name: python-pyinstaller-hooks-contrib%{psuffix} -Version: 2022.10 +Version: 2022.12 Release: 0 Summary: Community maintained hooks for PyInstaller License: Apache-2.0 OR GPL-2.0-only ++++++ pyinstaller-hooks-contrib-2022.10.tar.gz -> pyinstaller-hooks-contrib-2022.12.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyinstaller-hooks-contrib-2022.10/PKG-INFO new/pyinstaller-hooks-contrib-2022.12/PKG-INFO --- old/pyinstaller-hooks-contrib-2022.10/PKG-INFO 2022-08-31 23:20:44.628484500 +0200 +++ new/pyinstaller-hooks-contrib-2022.12/PKG-INFO 2022-11-05 12:25:21.953024400 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pyinstaller-hooks-contrib -Version: 2022.10 +Version: 2022.12 Summary: Community maintained hooks for PyInstaller Home-page: https://github.com/pyinstaller/pyinstaller-hooks-contrib Maintainer: Legorooj diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/__init__.py new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/__init__.py --- old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/__init__.py 2022-08-31 23:20:31.000000000 +0200 +++ new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/__init__.py 2022-11-05 12:25:11.000000000 +0100 @@ -10,6 +10,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # ------------------------------------------------------------------ -__version__ = '2022.10' +__version__ = '2022.12' __maintainer__ = 'Legorooj, bwoodsend' __uri__ = 'https://github.com/pyinstaller/pyinstaller-hooks-contrib' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_pyqtgraph_multiprocess.py new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_pyqtgraph_multiprocess.py --- old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_pyqtgraph_multiprocess.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_pyqtgraph_multiprocess.py 2022-11-05 12:25:11.000000000 +0100 @@ -0,0 +1,51 @@ +#----------------------------------------------------------------------------- +# Copyright (c) 2022, PyInstaller Development Team. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# +# The full license is in the file COPYING.txt, distributed with this software. +# +# SPDX-License-Identifier: Apache-2.0 +#----------------------------------------------------------------------------- + +import sys +import os + + +def _setup_pyqtgraph_multiprocess_hook(): + # NOTE: pyqtgraph.multiprocess spawns the sub-process using subprocess.Popen (or equivalent). This means that in + # onefile builds, the executable in subprocess will unpack itself again, into different sys._MEIPASS, because + # the _MEIPASS2 environment variable is not set (bootloader / bootstrap script cleans it up). This will make the + # argv[1] check below fail, due to different sys._MEIPASS value in the subprocess. + # + # To work around this, at the time of writing (PyInstaller 5.5), the user needs to set _MEIPASS2 environment + # variable to sys._MEIPASS before using `pyqtgraph.multiprocess` in onefile builds. And stlib's + # `multiprocessing.freeze_support` needs to be called in the entry-point program, due to `pyqtgraph.multiprocess` + # internally using stdlib's `multiprocessing` primitives. + if len(sys.argv) == 2 and sys.argv[1] == os.path.join(sys._MEIPASS, 'pyqtgraph', 'multiprocess', 'bootstrap.py'): + # Load as module; this requires --hiddenimport pyqtgraph.multiprocess.bootstrap + try: + mod_name = 'pyqtgraph.multiprocess.bootstrap' + mod = __import__(mod_name) + bootstrap_co = mod.__loader__.get_code(mod_name) + except Exception: + bootstrap_co = None + + if bootstrap_co: + exec(bootstrap_co) + sys.exit(0) + + # Load from file; requires pyqtgraph/multiprocess/bootstrap.py collected as data file + bootstrap_file = os.path.join(sys._MEIPASS, 'pyqtgraph', 'multiprocess', 'bootstrap.py') + if os.path.isfile(bootstrap_file): + with open(bootstrap_file, 'r') as fp: + bootstrap_code = fp.read() + exec(bootstrap_code) + sys.exit(0) + + raise RuntimeError("Could not find pyqtgraph.multiprocess bootstrap code or script!") + + +_setup_pyqtgraph_multiprocess_hook() +del _setup_pyqtgraph_multiprocess_hook diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/hooks/rthooks.dat new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/hooks/rthooks.dat --- old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/hooks/rthooks.dat 2022-08-31 23:20:31.000000000 +0200 +++ new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/hooks/rthooks.dat 2022-11-05 12:25:11.000000000 +0100 @@ -7,5 +7,6 @@ 'pyproj': ['pyi_rth_pyproj.py'], 'pygraphviz': ['pyi_rth_pygraphviz.py'], 'pythoncom': ['pyi_rth_pythoncom.py'], + 'pyqtgraph': ['pyi_rth_pyqtgraph_multiprocess.py'], 'pywintypes': ['pyi_rth_pywintypes.py'], } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-clr.py new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-clr.py --- old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-clr.py 2022-08-31 23:20:31.000000000 +0200 +++ new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-clr.py 2022-11-05 12:25:11.000000000 +0100 @@ -11,39 +11,52 @@ # ------------------------------------------------------------------ -""" -pythonnet requires both clr.pyd and Python.Runtime.dll, -but the latter isn't found by PyInstaller. -""" - - -import ctypes.util -from PyInstaller.log import logger - -try: - from importlib.metadata import files -except ImportError: - from importlib_metadata import files - -datas = [] - -filepaths = [f for f in files('pythonnet') if 'Python.Runtime.dll' in str(f)] -if len(filepaths) == 1: - pyruntime_path = filepaths[0] - datas = [(pyruntime_path.locate(), pyruntime_path.parent.as_posix())] -elif len(filepaths) > 1: - logger.warning('More than one Python.Runtime.dll found in site packages! Cannot resolve.') - -if len(datas) == 0: - # Fallback to legacy way of finding Python.Runtime dependency - library = ctypes.util.find_library('Python.Runtime') - if library: - datas = [(library, '.')] - logger.warning('Legacy method of finding Python.Runtime.dll was used!') +# There is a name clash between pythonnet's clr module/extension (which this hooks is for) and clr package that provides +# the terminal styling library (https://pypi.org/project/clr/). Therefore, we must first check if pythonnet is actually +# available... +from PyInstaller.utils.hooks import is_module_satisfies +from PyInstaller.compat import is_win + + +if is_module_satisfies("pythonnet"): + # pythonnet requires both clr.pyd and Python.Runtime.dll, but the latter isn't found by PyInstaller. + import ctypes.util + from PyInstaller.log import logger + + try: + import importlib.metadata as importlib_metadata + except ImportError: + import importlib_metadata + + collected_runtime_files = [] + + # Try finding Python.Runtime.dll via distribution's file list + dist_files = importlib_metadata.files('pythonnet') + if dist_files is not None: + runtime_dll_files = [f for f in dist_files if f.match('Python.Runtime.dll')] + if len(runtime_dll_files) == 1: + runtime_dll_file = runtime_dll_files[0] + collected_runtime_files = [(runtime_dll_file.locate(), runtime_dll_file.parent.as_posix())] + logger.debug("hook-clr: Python.Runtime.dll discovered via metadata.") + elif len(runtime_dll_files) > 1: + logger.warning("hook-clr: multiple instances of Python.Runtime.dll listed in metadata - cannot resolve.") + + # Fall back to the legacy way + if not collected_runtime_files: + runtime_dll_file = ctypes.util.find_library('Python.Runtime') + if runtime_dll_file: + collected_runtime_files = [(runtime_dll_file, '.')] + logger.debug('hook-clr: Python.Runtime.dll discovered via legacy method.') + + if not collected_runtime_files: + raise Exception('Python.Runtime.dll not found') + + # On Windows, collect runtime DLL file(s) as binaries; on other OSes, collect them as data files, to prevent fatal + # errors in binary dependency analysis. + if is_win: + binaries = collected_runtime_files + else: + datas = collected_runtime_files -if not datas: - raise Exception('Python.Runtime.dll not found') - - -# These modules are imported inside Python.Runtime.dll -hiddenimports = ["platform", "warnings"] + # These modules are imported inside Python.Runtime.dll + hiddenimports = ["platform", "warnings"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-discid.py new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-discid.py --- old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-discid.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-discid.py 2022-11-05 12:25:11.000000000 +0100 @@ -0,0 +1,41 @@ +# ------------------------------------------------------------------ +# Copyright (c) 2022 PyInstaller Development Team. +# +# This file is distributed under the terms of the GNU General Public +# License (version 2.0 or later). +# +# The full license is available in LICENSE.GPL.txt, distributed with +# this software. +# +# SPDX-License-Identifier: GPL-2.0-or-later +# ------------------------------------------------------------------ + +import os + +from PyInstaller.utils.hooks import get_module_attribute, logger +from PyInstaller.depend.utils import _resolveCtypesImports + + +binaries = [] + +# Use the _LIB_NAME attribute of discid.libdiscid to resolve the shared library name. This saves us from having to +# duplicate the name guessing logic from discid.libdiscid. +# On error, PyInstaller >= 5.0 raises exception, earlier versions return an empty string. +try: + lib_name = get_module_attribute("discid.libdiscid", "_LIB_NAME") +except Exception: + lib_name = None + +if lib_name: + lib_name = os.path.basename(lib_name) + try: + resolved_binary = _resolveCtypesImports([lib_name]) + lib_file = resolved_binary[0][1] + except Exception as e: + lib_file = None + logger.warning("Error while trying to resolve %s: %s", lib_name, e) + + if lib_file: + binaries += [(lib_file, '.')] +else: + logger.warning("Failed to determine name of libdiscid shared library from _LIB_NAME attribute of discid.libdiscid!") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-exchangelib.py new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-exchangelib.py --- old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-exchangelib.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-exchangelib.py 2022-11-05 12:25:11.000000000 +0100 @@ -0,0 +1,12 @@ +# ------------------------------------------------------------------ +# Copyright (c) 2022 PyInstaller Development Team. +# +# This file is distributed under the terms of the GNU General Public +# License (version 2.0 or later). +# +# The full license is available in LICENSE.GPL.txt, distributed with +# this software. +# +# SPDX-License-Identifier: GPL-2.0-or-later +# ------------------------------------------------------------------ +hiddenimports = ['tzdata'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-ldfparser.py new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-ldfparser.py --- old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-ldfparser.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-ldfparser.py 2022-11-05 12:25:11.000000000 +0100 @@ -0,0 +1,15 @@ +# ------------------------------------------------------------------ +# Copyright (c) 2022 PyInstaller Development Team. +# +# This file is distributed under the terms of the GNU General Public +# License (version 2.0 or later). +# +# The full license is available in LICENSE.GPL.txt, distributed with +# this software. +# +# SPDX-License-Identifier: GPL-2.0-or-later +#----------------------------------------------------------------------------- + +from PyInstaller.utils.hooks import collect_data_files + +datas = collect_data_files('ldfparser') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-pyqtgraph.py new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-pyqtgraph.py --- old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-pyqtgraph.py 2022-08-31 23:20:31.000000000 +0200 +++ new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-pyqtgraph.py 2022-11-05 12:25:11.000000000 +0100 @@ -12,9 +12,8 @@ from PyInstaller.utils.hooks import collect_data_files, collect_submodules -# include all .ui and image files -datas = collect_data_files("pyqtgraph", - includes=["**/*.ui", "**/*.png", "**/*.svg"]) +# Collect all data files, excluding the examples' data +datas = collect_data_files('pyqtgraph', excludes=['**/examples/*']) # pyqtgraph uses Qt-version-specific templates for the UI elements. # There are templates for different versions of PySide and PyQt, e.g. @@ -34,3 +33,8 @@ # Tested with pyqtgraph master branch (commit c1900aa). all_imports = collect_submodules("pyqtgraph") hiddenimports = [name for name in all_imports if "Template" in name] + +# Collect the pyqtgraph/multiprocess/bootstrap.py as a module; this is required by our pyqtgraph.multiprocess runtime +# hook to handle the pyqtgraph's multiprocessing implementation. The pyqtgraph.multiprocess seems to be imported +# automatically on the import of pyqtgraph itself, so there is no point in creating a separate hook for this. +hiddenimports += ['pyqtgraph.multiprocess.bootstrap'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-sounddevice.py new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-sounddevice.py --- old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-sounddevice.py 2022-08-31 23:20:31.000000000 +0200 +++ new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-sounddevice.py 2022-11-05 12:25:11.000000000 +0100 @@ -9,25 +9,55 @@ # # SPDX-License-Identifier: GPL-2.0-or-later # ------------------------------------------------------------------ -# ----------------------------------------------------------------------------- """ sounddevice: https://github.com/spatialaudio/python-sounddevice/ """ -import os +import pathlib -from PyInstaller.compat import is_darwin, is_win -from PyInstaller.utils.hooks import get_module_file_attribute +from PyInstaller.utils.hooks import get_module_file_attribute, logger -module_dir = os.path.dirname(get_module_file_attribute("sounddevice")) +binaries = [] +datas = [] -path = None -if is_win: - path = os.path.join(module_dir, "_sounddevice_data", "portaudio-binaries") -elif is_darwin: - path = os.path.join(module_dir, "_sounddevice_data", "portaudio-binaries", "libportaudio.dylib") +# PyPI wheels for Windows and macOS ship the sndfile shared library in _sounddevice_data directory, +# located next to the sounddevice.py module file (i.e., in the site-packages directory). +module_dir = pathlib.Path(get_module_file_attribute('sounddevice')).parent +data_dir = module_dir / '_sounddevice_data' / 'portaudio-binaries' +if data_dir.is_dir(): + destdir = str(data_dir.relative_to(module_dir)) + + # Collect the shared library (known variants: libportaudio64bit.dll, libportaudio32bit.dll, libportaudio.dylib) + for lib_file in data_dir.glob("libportaudio*.*"): + binaries += [(str(lib_file), destdir)] + + # Collect the README.md file + readme_file = data_dir / "README.md" + if readme_file.is_file(): + datas += [(str(readme_file), destdir)] +else: + # On linux and in Anaconda in all OSes, the system-installed portaudio library needs to be collected. + def _find_system_portaudio_library(): + import os + import ctypes.util + from PyInstaller.depend.utils import _resolveCtypesImports + + libname = ctypes.util.find_library("portaudio") + if libname is not None: + resolved_binary = _resolveCtypesImports([os.path.basename(libname)]) + if resolved_binary: + return resolved_binary[0][1] + + try: + lib_file = _find_system_portaudio_library() + except Exception as e: + logger.warning("Error while trying to find system-installed portaudio library: %s", e) + lib_file = None -if path is not None and os.path.exists(path): - binaries = [(path, os.path.join("_sounddevice_data", "portaudio-binaries"))] + if lib_file: + binaries += [(lib_file, '.')] + +if not binaries: + logger.warning("portaudio shared library not found - sounddevice will likely fail to work!") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-soundfile.py new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-soundfile.py --- old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-soundfile.py 2022-08-31 23:20:31.000000000 +0200 +++ new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-soundfile.py 2022-11-05 12:25:11.000000000 +0100 @@ -15,21 +15,49 @@ https://github.com/bastibe/SoundFile """ -import os +import pathlib -from PyInstaller.compat import is_win, is_darwin -from PyInstaller.utils.hooks import get_module_file_attribute +from PyInstaller.utils.hooks import get_module_file_attribute, logger -# get path of soundfile -module_dir = os.path.dirname(get_module_file_attribute('soundfile')) +binaries = [] +datas = [] -# add binaries packaged by soundfile on OSX and Windows -# an external dependency (libsndfile) is used on GNU/Linux -path = None -if is_win: - path = os.path.join(module_dir, '_soundfile_data') -elif is_darwin: - path = os.path.join(module_dir, '_soundfile_data', 'libsndfile.dylib') +# PyPI wheels for Windows and macOS ship the sndfile shared library in _soundfile_data directory, +# located next to the soundfile.py module file (i.e., in the site-packages directory). +module_dir = pathlib.Path(get_module_file_attribute('soundfile')).parent +data_dir = module_dir / '_soundfile_data' +if data_dir.is_dir(): + destdir = str(data_dir.relative_to(module_dir)) -if path is not None and os.path.exists(path): - binaries = [(path, "_soundfile_data")] + # Collect the shared library (known variants: libsndfile64bit.dll, libsndfile32bit.dll, libsndfile.dylib) + for lib_file in data_dir.glob("libsndfile*.*"): + binaries += [(str(lib_file), destdir)] + + # Collect the COPYING file + copying_file = data_dir / "COPYING" + if copying_file.is_file(): + datas += [(str(copying_file), destdir)] +else: + # On linux and in Anaconda in all OSes, the system-installed sndfile library needs to be collected. + def _find_system_sndfile_library(): + import os + import ctypes.util + from PyInstaller.depend.utils import _resolveCtypesImports + + libname = ctypes.util.find_library("sndfile") + if libname is not None: + resolved_binary = _resolveCtypesImports([os.path.basename(libname)]) + if resolved_binary: + return resolved_binary[0][1] + + try: + lib_file = _find_system_sndfile_library() + except Exception as e: + logger.warning("Error while trying to find system-installed sndfile library: %s", e) + lib_file = None + + if lib_file: + binaries += [(lib_file, '.')] + +if not binaries: + logger.warning("sndfile shared library not found - soundfile will likely fail to work!") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-spiceypy.py new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-spiceypy.py --- old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-spiceypy.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-spiceypy.py 2022-11-05 12:25:11.000000000 +0100 @@ -0,0 +1,18 @@ +# ------------------------------------------------------------------ +# Copyright (c) 2020 PyInstaller Development Team. +# +# This file is distributed under the terms of the GNU General Public +# License (version 2.0 or later). +# +# The full license is available in LICENSE.GPL.txt, distributed with +# this software. +# +# SPDX-License-Identifier: GPL-2.0-or-later +# ------------------------------------------------------------------ + +# Hook for spiceypy: https://pypi.org/project/spiceypy/ +# Tested on Ubuntu 20.04 with spiceypy 5.1.1 + +from PyInstaller.utils.hooks import collect_dynamic_libs + +binaries = collect_dynamic_libs("spiceypy") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/tests/data/netcore5_runtime_config.json new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/tests/data/netcore5_runtime_config.json --- old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/tests/data/netcore5_runtime_config.json 2022-08-31 23:20:31.000000000 +0200 +++ new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/tests/data/netcore5_runtime_config.json 1970-01-01 01:00:00.000000000 +0100 @@ -1,9 +0,0 @@ -{ - "runtimeOptions": { - "tfm": "net5.0", - "framework": { - "name": "Microsoft.NETCore.App", - "version": "5.0.2" - } - } -} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/tests/test_libraries.py new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/tests/test_libraries.py --- old/pyinstaller-hooks-contrib-2022.10/src/_pyinstaller_hooks_contrib/tests/test_libraries.py 2022-08-31 23:20:31.000000000 +0200 +++ new/pyinstaller-hooks-contrib-2022.12/src/_pyinstaller_hooks_contrib/tests/test_libraries.py 2022-11-05 12:25:11.000000000 +0100 @@ -799,12 +799,10 @@ @requires('pythonnet >= 3.dev') def test_pythonnet3(pyi_builder): - runtime_cfg_path = str((Path(__file__) / '../data/netcore5_runtime_config.json').resolve(strict=True).as_posix()) pyi_builder.test_source(f""" - from pathlib import Path from clr_loader import get_coreclr from pythonnet import set_runtime - set_runtime(get_coreclr('{runtime_cfg_path}')) + set_runtime(get_coreclr()) # Pick up and use any installed .NET runtime. import clr """) @@ -1287,10 +1285,62 @@ import pyqtgraph.graphicsItems.PlotItem import pyqtgraph.graphicsItems.ViewBox.ViewBoxMenu import pyqtgraph.imageview.ImageView + """, + pyi_args=['--exclude', 'PySide2', '--exclude', 'PySide6', '--exclude', 'PyQt6'] + ) + + +@importorskip('pyqtgraph') +def test_pyqtgraph_colormap(pyi_builder): + pyi_builder.test_source( + """ + import pyqtgraph.colormap + assert pyqtgraph.colormap.listMaps() """ ) +@importorskip('pyqtgraph') +@importorskip('PyQt5') +def test_pyqtgraph_remote_graphics_view(pyi_builder): + pyi_builder.test_source( + """ + import sys + import os + import signal + + from PyQt5 import QtCore, QtWidgets + import pyqtgraph + + # Multiprocessing is used internally by pyqtgraph.multiprocess + import multiprocessing + multiprocessing.freeze_support() + + # pyqtgraph.multiprocess also uses a subprocess.Popen() to spawn its + # sub-process, so we need to restore _MEIPASS2 to prevent the executable + # to unpacking itself again in the subprocess. + os.environ['_MEIPASS2'] = sys._MEIPASS + + # Create a window with remote graphics view + app = QtWidgets.QApplication(sys.argv) + signal.signal(signal.SIGINT, signal.SIG_DFL) + + window = QtWidgets.QWidget() + layout = QtWidgets.QVBoxLayout(window) + remote_view = pyqtgraph.widgets.RemoteGraphicsView.RemoteGraphicsView() + layout.addWidget(remote_view) + + window.show() + + # Quit after a second + QtCore.QTimer.singleShot(1000, app.exit) + + sys.exit(app.exec_()) + """, + pyi_args=['--exclude', 'PySide2', '--exclude', 'PySide6', '--exclude', 'PyQt6'] + ) + + @importorskip('hydra') def test_hydra(pyi_builder, tmpdir): config_file = str((Path(__file__) / '../data/test_hydra/config.yaml').resolve(strict=True).as_posix()) @@ -1328,3 +1378,35 @@ pyi_builder.test_source(""" import pythoncom """) + + +@importorskip('spiceypy') +def test_spiceypy(pyi_builder): + pyi_builder.test_source(""" + import spiceypy + """) + + +@importorskip('discid') +def test_discid(pyi_builder): + pyi_builder.test_source( + """ + # Basic import check + import discid + + # Check that shared library is in fact collected into application bundle. + # We expect the hook to collect it to top-level directory (sys._MEIPASS). + import discid.libdiscid + lib_name = discid.libdiscid._LIB_NAME + + lib_file = os.path.join(sys._MEIPASS, lib_name) + assert os.path.isfile(lib_file), f"Shared library {lib_name} not collected to _MEIPASS!" + """ + ) + + +@importorskip('exchangelib') +def test_exchangelib(pyi_builder): + pyi_builder.test_source(""" + import exchangelib + """) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyinstaller-hooks-contrib-2022.10/src/pyinstaller_hooks_contrib.egg-info/PKG-INFO new/pyinstaller-hooks-contrib-2022.12/src/pyinstaller_hooks_contrib.egg-info/PKG-INFO --- old/pyinstaller-hooks-contrib-2022.10/src/pyinstaller_hooks_contrib.egg-info/PKG-INFO 2022-08-31 23:20:44.000000000 +0200 +++ new/pyinstaller-hooks-contrib-2022.12/src/pyinstaller_hooks_contrib.egg-info/PKG-INFO 2022-11-05 12:25:21.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pyinstaller-hooks-contrib -Version: 2022.10 +Version: 2022.12 Summary: Community maintained hooks for PyInstaller Home-page: https://github.com/pyinstaller/pyinstaller-hooks-contrib Maintainer: Legorooj diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyinstaller-hooks-contrib-2022.10/src/pyinstaller_hooks_contrib.egg-info/SOURCES.txt new/pyinstaller-hooks-contrib-2022.12/src/pyinstaller_hooks_contrib.egg-info/SOURCES.txt --- old/pyinstaller-hooks-contrib-2022.10/src/pyinstaller_hooks_contrib.egg-info/SOURCES.txt 2022-08-31 23:20:44.000000000 +0200 +++ new/pyinstaller-hooks-contrib-2022.12/src/pyinstaller_hooks_contrib.egg-info/SOURCES.txt 2022-11-05 12:25:21.000000000 +0100 @@ -19,6 +19,7 @@ src/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_osgeo.py src/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_pygraphviz.py src/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_pyproj.py +src/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_pyqtgraph_multiprocess.py src/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_pythoncom.py src/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_pywintypes.py src/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_traitlets.py @@ -85,6 +86,7 @@ src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-dask.py src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-dateparser.utils.strptime.py src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-dclab.py +src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-discid.py src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-distorm3.py src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-dns.rdata.py src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-docutils.py @@ -99,6 +101,7 @@ src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-eth_hash.py src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-eth_keyfile.py src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-eth_utils.py +src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-exchangelib.py src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-fabric.py src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-faker.py src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-ffpyplayer.py @@ -152,6 +155,7 @@ src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-langcodes.py src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-langdetect.py src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-lark.py +src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-ldfparser.py src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-lensfunpy.py src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-libaudioverse.py src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-lightgbm.py @@ -294,6 +298,7 @@ src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-soundfile.py src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-spacy.py src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-speech_recognition.py +src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-spiceypy.py src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-spnego.py src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-srsly.msgpack._packer.py src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-statsmodels.tsa.statespace.py @@ -348,7 +353,6 @@ src/_pyinstaller_hooks_contrib/tests/__init__.py src/_pyinstaller_hooks_contrib/tests/conftest.py src/_pyinstaller_hooks_contrib/tests/test_libraries.py -src/_pyinstaller_hooks_contrib/tests/data/netcore5_runtime_config.json src/_pyinstaller_hooks_contrib/tests/data/test_hydra/config.yaml src/_pyinstaller_hooks_contrib/tests/scripts/pyi_lib_boto.py src/_pyinstaller_hooks_contrib/tests/scripts/pyi_lib_enchant.py