Skip to content

Commit

Permalink
hooks: pandas: update for compatibility with pandas 1.2.0 and later
Browse files Browse the repository at this point in the history
Pandas 1.2.0 and later require hidden import of cmath on linux
and macOS.
  • Loading branch information
rokm authored and bwoodsend committed Mar 12, 2021
1 parent 81b0c1b commit 27e5bc7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion PyInstaller/hooks/hook-pandas.py
Expand Up @@ -9,7 +9,13 @@
# SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)
#-----------------------------------------------------------------------------

from PyInstaller.utils.hooks import collect_submodules
from PyInstaller.utils.hooks import collect_submodules, is_module_satisfies

# Pandas keeps Python extensions loaded with dynamic imports here.
hiddenimports = collect_submodules('pandas._libs')

# Pandas 1.2.0 and later require cmath hidden import on linux and macOS.
# On Windows, this is not strictly required, but we add it anyway to keep
# things simple (and future-proof).
if is_module_satisfies('pandas >= 1.2.0'):
hiddenimports += ['cmath']
1 change: 1 addition & 0 deletions news/5630.hooks.rst
@@ -0,0 +1 @@
Update ``pandas`` hook for compatibility with version 1.2.0 and later.

0 comments on commit 27e5bc7

Please sign in to comment.