projg2 / pytest-import-check

pytest plugin to check whether Python modules can be imported
GNU General Public License v2.0
5 stars 0 forks source link

Fails with PyQt6 #3

Open ionenwks opened 1 month ago

ionenwks commented 1 month ago

Tried to add import-check to PyQt6, and while most tests passed fine the few in widgets-plugins/ all failed. Not familiar with what PyQt6 is doing here albeit gives me the impression of just being a odd edge case that I could (manually) deselect if need be.

Figured would report anyway in case have a better idea, either to make it work (Edit: which doesn't sound doable to me if it needs some special loader) or automatically skip them.

(click to see full test output) ``` * Package: dev-python/PyQt6-6.7.1-r1:0 * Repository: gentoo * Maintainer: qt@gentoo.org * Upstream: https://www.riverbankcomputing.com/mailman/listinfo/pyqt/ * USE: abi_x86_64 amd64 dbus elibc_glibc gui kernel_linux network opengl printsupport python_targets_python3_12 qml sql ssl test testlib webchannel widgets xml * FEATURES: network-sandbox preserve-libs sandbox splitdebug test userpriv usersandbox python3.12 -m pytest -vv -ra -l -Wdefault -Werror::pytest.PytestUnhandledCoroutineWarning --color=yes -o console_output_style=count -o tmp_path_retention_count=0 -o tmp_path_retention_policy=failed -p no:cov -p no:flake8 -p no:flakes -p no:pylint -p no:markdown -p no:sugar -p no:xvfb -p no:pytest-describe -p no:plus -p no:tavern -p no:salt-factories --import-check /tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages =============================================== test session starts ================================================ platform linux -- Python 3.12.4, pytest-8.3.1, pluggy-1.5.0 -- /tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/bin/python3.12 cachedir: .pytest_cache rootdir: /tmp/portage/dev-python/PyQt6-6.7.1-r1/work plugins: pkgcore-0.12.27, import-check-0.0.4 collecting ... collected 53 items ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/__init__.py::import-check PASSED [ 1/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/QtCore.abi3.so::import-check PASSED [ 2/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/QtDBus.abi3.so::import-check PASSED [ 3/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/QtGui.abi3.so::import-check PASSED [ 4/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/QtNetwork.abi3.so::import-check PASSED [ 5/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/QtOpenGL.abi3.so::import-check PASSED [ 6/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/QtOpenGLWidgets.abi3.so::import-check PASSED [ 7/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/QtPrintSupport.abi3.so::import-check PASSED [ 8/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/QtQml.abi3.so::import-check PASSED [ 9/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/QtSql.abi3.so::import-check PASSED [10/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/QtTest.abi3.so::import-check PASSED [11/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/QtWebChannel.abi3.so::import-check PASSED [12/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/QtWidgets.abi3.so::import-check PASSED [13/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/QtXml.abi3.so::import-check PASSED [14/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/lupdate/__init__.py::import-check PASSED [15/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/lupdate/designer_source.py::import-check PASSED [16/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/lupdate/lupdate.py::import-check PASSED [17/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/lupdate/pylupdate.py::import-check PASSED [18/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/lupdate/python_source.py::import-check PASSED [19/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/lupdate/source_file.py::import-check PASSED [20/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/lupdate/translation_file.py::import-check PASSED [21/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/lupdate/translations.py::import-check PASSED [22/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/lupdate/user.py::import-check PASSED [23/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/__init__.py::import-check PASSED [24/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/Compiler/__init__.py::import-check PASSED [25/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/Compiler/as_string.py::import-check PASSED [26/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/Compiler/compiler.py::import-check PASSED [27/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/Compiler/indenter.py::import-check PASSED [28/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/Compiler/misc.py::import-check PASSED [29/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/Compiler/proxy_metaclass.py::import-check PASSED [30/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/Compiler/qobjectcreator.py::import-check PASSED [31/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/Compiler/qtproxies.py::import-check PASSED [32/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/Loader/__init__.py::import-check PASSED [33/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/Loader/loader.py::import-check PASSED [34/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/Loader/qobjectcreator.py::import-check PASSED [35/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/compile_ui.py::import-check PASSED [36/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/enum_map.py::import-check PASSED [37/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/exceptions.py::import-check PASSED [38/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/icon_cache.py::import-check PASSED [39/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/load_ui.py::import-check PASSED [40/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/objcreator.py::import-check PASSED [41/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/properties.py::import-check PASSED [42/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/pyuic.py::import-check PASSED [43/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/ui_file.py::import-check PASSED [44/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/uiparser.py::import-check PASSED [45/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qaxcontainer.py::import-check FAILED [46/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qscintilla.py::import-check FAILED [47/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtcharts.py::import-check FAILED [48/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtopenglwidgets.py::import-check FAILED [49/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtprintsupport.py::import-check FAILED [50/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtquickwidgets.py::import-check FAILED [51/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtwebenginewidgets.py::import-check FAILED [52/53] ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/dbus/mainloop/pyqt6.abi3.so::import-check PASSED [53/53] ===================================================== FAILURES ===================================================== ___ ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qaxcontainer.py ____ ############################################################################# ## ## Copyright (c) 2024 Riverbank Computing Limited ## ## This file is part of PyQt6. ## ## This file may be used under the terms of the GNU General Public License ## version 3.0 as published by the Free Software Foundation and appearing in ## the file LICENSE included in the packaging of this file. Please review the ## following information to ensure the GNU General Public License version 3.0 ## requirements will be met: http://www.gnu.org/copyleft/gpl.html. ## ## If you do not wish to use this file under the terms of the GPL version 3.0 ## then you may purchase a commercial license. For more information contact ## info@riverbankcomputing.com. ## ## This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ## WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ## ############################################################################# # If pluginType is MODULE, the plugin loader will call moduleInformation. The # variable MODULE is inserted into the local namespace by the plugin loader. > pluginType = MODULE E NameError: name 'MODULE' is not defined __builtins__ = __cached__ = '/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/__pycache__/qaxcontainer.cpython-312.pyc' __doc__ = None __file__ = '/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qaxcontainer.py' __loader__ = <_frozen_importlib_external.SourceFileLoader object at 0x7ffff0016000> __name__ = 'qaxcontainer' __package__ = '' __spec__ = ModuleSpec(name='qaxcontainer', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7ffff0016000>, origin='/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qaxcontainer.py') ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qaxcontainer.py:25: NameError ____ ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qscintilla.py _____ ############################################################################# ## ## Copyright (c) 2024 Riverbank Computing Limited ## ## This file is part of PyQt6. ## ## This file may be used under the terms of the GNU General Public License ## version 3.0 as published by the Free Software Foundation and appearing in ## the file LICENSE included in the packaging of this file. Please review the ## following information to ensure the GNU General Public License version 3.0 ## requirements will be met: http://www.gnu.org/copyleft/gpl.html. ## ## If you do not wish to use this file under the terms of the GPL version 3.0 ## then you may purchase a commercial license. For more information contact ## info@riverbankcomputing.com. ## ## This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ## WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ## ############################################################################# # If pluginType is MODULE, the plugin loader will call moduleInformation. The # variable MODULE is inserted into the local namespace by the plugin loader. > pluginType = MODULE E NameError: name 'MODULE' is not defined __builtins__ = __cached__ = '/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/__pycache__/qscintilla.cpython-312.pyc' __doc__ = None __file__ = '/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qscintilla.py' __loader__ = <_frozen_importlib_external.SourceFileLoader object at 0x7ffff00169f0> __name__ = 'qscintilla' __package__ = '' __spec__ = ModuleSpec(name='qscintilla', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7ffff00169f0>, origin='/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qscintilla.py') ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qscintilla.py:25: NameError _____ ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtcharts.py ______ ############################################################################# ## ## Copyright (c) 2024 Riverbank Computing Limited ## ## This file is part of PyQt6. ## ## This file may be used under the terms of the GNU General Public License ## version 3.0 as published by the Free Software Foundation and appearing in ## the file LICENSE included in the packaging of this file. Please review the ## following information to ensure the GNU General Public License version 3.0 ## requirements will be met: http://www.gnu.org/copyleft/gpl.html. ## ## If you do not wish to use this file under the terms of the GPL version 3.0 ## then you may purchase a commercial license. For more information contact ## info@riverbankcomputing.com. ## ## This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ## WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ## ############################################################################# # If pluginType is MODULE, the plugin loader will call moduleInformation. The # variable MODULE is inserted into the local namespace by the plugin loader. > pluginType = MODULE E NameError: name 'MODULE' is not defined __builtins__ = __cached__ = '/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/__pycache__/qtcharts.cpython-312.pyc' __doc__ = None __file__ = '/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtcharts.py' __loader__ = <_frozen_importlib_external.SourceFileLoader object at 0x7ffff0017080> __name__ = 'qtcharts' __package__ = '' __spec__ = ModuleSpec(name='qtcharts', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7ffff0017080>, origin='/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtcharts.py') ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtcharts.py:25: NameError __ ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtopenglwidgets.py __ ############################################################################# ## ## Copyright (c) 2024 Riverbank Computing Limited ## ## This file is part of PyQt6. ## ## This file may be used under the terms of the GNU General Public License ## version 3.0 as published by the Free Software Foundation and appearing in ## the file LICENSE included in the packaging of this file. Please review the ## following information to ensure the GNU General Public License version 3.0 ## requirements will be met: http://www.gnu.org/copyleft/gpl.html. ## ## If you do not wish to use this file under the terms of the GPL version 3.0 ## then you may purchase a commercial license. For more information contact ## info@riverbankcomputing.com. ## ## This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ## WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ## ############################################################################# # If pluginType is MODULE, the plugin loader will call moduleInformation. The # variable MODULE is inserted into the local namespace by the plugin loader. > pluginType = MODULE E NameError: name 'MODULE' is not defined __builtins__ = __cached__ = '/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/__pycache__/qtopenglwidgets.cpython-312.pyc' __doc__ = None __file__ = '/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtopenglwidgets.py' __loader__ = <_frozen_importlib_external.SourceFileLoader object at 0x7ffff00177d0> __name__ = 'qtopenglwidgets' __package__ = '' __spec__ = ModuleSpec(name='qtopenglwidgets', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7ffff00177d0>, origin='/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtopenglwidgets.py') ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtopenglwidgets.py:25: NameError __ ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtprintsupport.py ___ ############################################################################# ## ## Copyright (c) 2024 Riverbank Computing Limited ## ## This file is part of PyQt6. ## ## This file may be used under the terms of the GNU General Public License ## version 3.0 as published by the Free Software Foundation and appearing in ## the file LICENSE included in the packaging of this file. Please review the ## following information to ensure the GNU General Public License version 3.0 ## requirements will be met: http://www.gnu.org/copyleft/gpl.html. ## ## If you do not wish to use this file under the terms of the GPL version 3.0 ## then you may purchase a commercial license. For more information contact ## info@riverbankcomputing.com. ## ## This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ## WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ## ############################################################################# # If pluginType is MODULE, the plugin loader will call moduleInformation. The # variable MODULE is inserted into the local namespace by the plugin loader. > pluginType = MODULE E NameError: name 'MODULE' is not defined __builtins__ = __cached__ = '/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/__pycache__/qtprintsupport.cpython-312.pyc' __doc__ = None __file__ = '/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtprintsupport.py' __loader__ = <_frozen_importlib_external.SourceFileLoader object at 0x7ffff00171d0> __name__ = 'qtprintsupport' __package__ = '' __spec__ = ModuleSpec(name='qtprintsupport', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7ffff00171d0>, origin='/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtprintsupport.py') ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtprintsupport.py:25: NameError __ ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtquickwidgets.py ___ ############################################################################# ## ## Copyright (c) 2024 Riverbank Computing Limited ## ## This file is part of PyQt6. ## ## This file may be used under the terms of the GNU General Public License ## version 3.0 as published by the Free Software Foundation and appearing in ## the file LICENSE included in the packaging of this file. Please review the ## following information to ensure the GNU General Public License version 3.0 ## requirements will be met: http://www.gnu.org/copyleft/gpl.html. ## ## If you do not wish to use this file under the terms of the GPL version 3.0 ## then you may purchase a commercial license. For more information contact ## info@riverbankcomputing.com. ## ## This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ## WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ## ############################################################################# # If pluginType is MODULE, the plugin loader will call moduleInformation. The # variable MODULE is inserted into the local namespace by the plugin loader. > pluginType = MODULE E NameError: name 'MODULE' is not defined __builtins__ = __cached__ = '/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/__pycache__/qtquickwidgets.cpython-312.pyc' __doc__ = None __file__ = '/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtquickwidgets.py' __loader__ = <_frozen_importlib_external.SourceFileLoader object at 0x7ffff0016900> __name__ = 'qtquickwidgets' __package__ = '' __spec__ = ModuleSpec(name='qtquickwidgets', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7ffff0016900>, origin='/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtquickwidgets.py') ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtquickwidgets.py:25: NameError _ ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtwebenginewidgets.py _ ############################################################################# ## ## Copyright (c) 2024 Riverbank Computing Limited ## ## This file is part of PyQt6. ## ## This file may be used under the terms of the GNU General Public License ## version 3.0 as published by the Free Software Foundation and appearing in ## the file LICENSE included in the packaging of this file. Please review the ## following information to ensure the GNU General Public License version 3.0 ## requirements will be met: http://www.gnu.org/copyleft/gpl.html. ## ## If you do not wish to use this file under the terms of the GPL version 3.0 ## then you may purchase a commercial license. For more information contact ## info@riverbankcomputing.com. ## ## This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ## WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ## ############################################################################# # If pluginType is MODULE, the plugin loader will call moduleInformation. The # variable MODULE is inserted into the local namespace by the plugin loader. > pluginType = MODULE E NameError: name 'MODULE' is not defined __builtins__ = __cached__ = '/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/__pycache__/qtwebenginewidgets.cpython-312.pyc' __doc__ = None __file__ = '/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtwebenginewidgets.py' __loader__ = <_frozen_importlib_external.SourceFileLoader object at 0x7ffff00686b0> __name__ = 'qtwebenginewidgets' __package__ = '' __spec__ = ModuleSpec(name='qtwebenginewidgets', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7ffff00686b0>, origin='/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtwebenginewidgets.py') ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtwebenginewidgets.py:25: NameError ============================================= short test summary info ============================================== FAILED ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qaxcontainer.py::import-check - NameError: name 'MODULE' is not defined FAILED ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qscintilla.py::import-check - NameError: name 'MODULE' is not defined FAILED ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtcharts.py::import-check - NameError: name 'MODULE' is not defined FAILED ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtopenglwidgets.py::import-check - NameError: name 'MODULE' is not defined FAILED ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtprintsupport.py::import-check - NameError: name 'MODULE' is not defined FAILED ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtquickwidgets.py::import-check - NameError: name 'MODULE' is not defined FAILED ../PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qtwebenginewidgets.py::import-check - NameError: name 'MODULE' is not defined =========================================== 7 failed, 46 passed in 0.32s =========================================== * ERROR: dev-python/PyQt6-6.7.1-r1::gentoo failed (test phase): * pytest failed with python3.12 * * Call stack: * ebuild.sh, line 136: Called src_test * environment, line 4212: Called distutils-r1_src_test * environment, line 2009: Called _distutils-r1_run_foreach_impl 'python_test' * environment, line 770: Called python_foreach_impl 'distutils-r1_run_phase' 'python_test' * environment, line 3674: Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_test' * environment, line 3153: Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_test' * environment, line 3151: Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'python_test' * environment, line 1252: Called distutils-r1_run_phase 'python_test' * environment, line 1932: Called python_test * environment, line 3961: Called distutils-r1_python_test * environment, line 1867: Called epytest '--import-check' '/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1-python3_12/install/usr/lib/python3.12/site-packages' * environment, line 2550: Called die * The specific snippet of code: * [[ ${ret} -ne 0 ]] && die -n "pytest failed with ${EPYTHON}"; * * If you need support, post the output of `emerge --info '=dev-python/PyQt6-6.7.1-r1::gentoo'`, * the complete build log and the output of `emerge -pqv '=dev-python/PyQt6-6.7.1-r1::gentoo'`. * The complete build log is located at '/var/log/portage/dev-python:PyQt6-6.7.1-r1:20240724-075846.log.gz'. * For convenience, a symlink to the build log is located at '/tmp/portage/dev-python/PyQt6-6.7.1-r1/temp/build.log.gz'. * The ebuild environment file is located at '/tmp/portage/dev-python/PyQt6-6.7.1-r1/temp/environment'. * Working directory: '/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1' * S: '/tmp/portage/dev-python/PyQt6-6.7.1-r1/work/PyQt6-6.7.1' ```

Fails with:

    # If pluginType is MODULE, the plugin loader will call moduleInformation.  The
    # variable MODULE is inserted into the local namespace by the plugin loader.
>   pluginType = MODULE
E   NameError: name 'MODULE' is not defined
mgorny commented 1 month ago
>>> __import__("PyQt6.uic.widget-plugins.qscintilla")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.12/site-packages/PyQt6/uic/widget-plugins/qscintilla.py", line 25, in <module>
    pluginType = MODULE
                 ^^^^^^
NameError: name 'MODULE' is not defined

So it's giving the correct result.

That said, since this is not a valid package name, I wonder if it should just skip it.

ionenwks commented 1 month ago

Yeah, didn't mean to say it was incorrect, more that it probably shouldn't be testing it if it's going to need some special plugin loader. If there's a way to do this automatically it'd be nice, otherwise I guess I'll try EPYTEST_DESELECT.

mgorny commented 1 month ago

Well, I have mixed feelings about this. On one hand, it clearly isn't importable out of the box and some packages deliberately name stuff like that to prevent them from being accidentally imported. But then, in some cases it probably still makes sense to test them.