Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update hiddenimports for pymssql 2.2.0+ #315

Merged
merged 5 commits into from
Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/315.update.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update hiddenimports for ``pymssql > 2.1.5``.
1 change: 1 addition & 0 deletions requirements-test-libraries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pyexcelerate==0.10.0
pylint==2.10.2
pyusb==1.2.1
pynput==1.7.3
pymssql==2.2.2
pystray==0.17.3
pyzmq==22.2.1
PyQt5==5.15.4
Expand Down
11 changes: 9 additions & 2 deletions src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-pymssql.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
# Copyright (c) 2020-2021 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
Expand All @@ -10,4 +10,11 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------

hiddenimports = ['_mssql']
from PyInstaller.utils.hooks import is_module_satisfies

hiddenimports = ["decimal"]
# In newer versions of pymssql, the _mssql was under pymssql
if is_module_satisfies("pymssql > 2.1.5"):
hiddenimports += ["pymssql._mssql", "uuid"]
else:
hiddenimports += ["_mssql"]
7 changes: 7 additions & 0 deletions src/_pyinstaller_hooks_contrib/tests/test_libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,3 +787,10 @@ def test_tableauhyperapi(pyi_builder):
pyi_builder.test_source("""
import tableauhyperapi
""")


@importorskip("pymssql")
def test_pymssql(pyi_builder):
pyi_builder.test_source("""
import pymssql
""")