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

Address a PySide6 incompatibility with QTextEdit #500

Closed
wants to merge 1 commit into from

Conversation

hmaarrfk
Copy link
Contributor

@hmaarrfk hmaarrfk commented Oct 28, 2024

  • Tested against Conda-forge
  • Tested against pypi -- actually pypi doesn't recreate this... 6.8.0.1 does, but the recently released 6.8.0.2 does not.

Closes jupyter/qtconsole#624

Output from conda-forge test when the patch isnt' applied.

============================================ test session starts =============================================
platform linux -- Python 3.10.14, pytest-8.3.3, pluggy-1.5.0 -- /home/mark/miniforge3/envs/dev/bin/python3.10
cachedir: .pytest_cache
PySide6 6.8.0 -- Qt runtime 6.8.0 -- Qt compiled 6.8.0

PyQt5: not installed
PySide2: not installed
PyQt6: not installed
PySide6: PySide: 6.8.0 - Qt: 6.8.0

rootdir: /home/mark/git/qtpy
configfile: pytest.ini
plugins: timeout-2.3.1, xdist-3.6.1, time-machine-2.16.0, forked-1.6.0, anyio-4.6.2.post1, qt-4.4.0, env-1.1.5, cov-5.0.0
collected 16 items

qtpy/tests/test_qtwidgets.py::test_qtextedit_functions FAILED                                          [  6%]

================================================== FAILURES ==================================================
__________________________________________ test_qtextedit_functions __________________________________________

qtbot = <pytestqt.qtbot.QtBot object at 0x714cd78a6020>
pdf_writer = (<PySide6.QtGui.QPdfWriter(0x57c8c8e05790) at 0x714cd78e9e00>, PosixPath('test.pdf'))

    def test_qtextedit_functions(qtbot, pdf_writer):
        """Test functions mapping for QtWidgets.QTextEdit."""
        assert QtWidgets.QTextEdit.setTabStopWidth
        assert QtWidgets.QTextEdit.tabStopWidth
        assert QtWidgets.QTextEdit.print_
        textedit_widget = QtWidgets.QTextEdit(None)
        textedit_widget.setTabStopWidth(90)
        assert textedit_widget.tabStopWidth() == 90
        print_device, output_path = pdf_writer
        textedit_widget.print_(print_device)
        assert output_path.exists()
        # https://github.com/jupyter/qtconsole/issues/624
        assert QtWidgets.QTextEdit.setExtraSelections
>       textedit_widget.setExtraSelections([])
E       AttributeError: type object 'PySide6.QtWidgets.QTextEdit' has no attribute 'ExtraSelection'. Did you mean: 'extraSelections'?

qtpy/tests/test_qtwidgets.py:35: AttributeError
-------------------------------------------- Captured Qt messages --------------------------------------------
QtWarningMsg: Could not find the Qt platform plugin "wayland" in ""
============================================ slowest 10 durations ============================================
0.15s setup    qtpy/tests/test_qtwidgets.py::test_qtextedit_functions
0.04s call     qtpy/tests/test_qtwidgets.py::test_qtextedit_functions
0.00s teardown qtpy/tests/test_qtwidgets.py::test_qtextedit_functions
========================================== short test summary info ===========================================
FAILED qtpy/tests/test_qtwidgets.py::test_qtextedit_functions - AttributeError: type object 'PySide6.QtWidgets.QTextEdit' has no attribute 'ExtraSelection'. Did you mean: 'extraSelections'?
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================= 1 failed in 0.56s ==============================================

- Tested against Conda-forge
- Tested against pypi

```
============================================ test session starts =============================================
platform linux -- Python 3.10.14, pytest-8.3.3, pluggy-1.5.0 -- /home/mark/miniforge3/envs/dev/bin/python3.10
cachedir: .pytest_cache
PySide6 6.8.0 -- Qt runtime 6.8.0 -- Qt compiled 6.8.0

PyQt5: not installed
PySide2: not installed
PyQt6: not installed
PySide6: PySide: 6.8.0 - Qt: 6.8.0

rootdir: /home/mark/git/qtpy
configfile: pytest.ini
plugins: timeout-2.3.1, xdist-3.6.1, time-machine-2.16.0, forked-1.6.0, anyio-4.6.2.post1, qt-4.4.0, env-1.1.5, cov-5.0.0
collected 16 items

qtpy/tests/test_qtwidgets.py::test_qtextedit_functions FAILED                                          [  6%]

================================================== FAILURES ==================================================
__________________________________________ test_qtextedit_functions __________________________________________

qtbot = <pytestqt.qtbot.QtBot object at 0x714cd78a6020>
pdf_writer = (<PySide6.QtGui.QPdfWriter(0x57c8c8e05790) at 0x714cd78e9e00>, PosixPath('test.pdf'))

    def test_qtextedit_functions(qtbot, pdf_writer):
        """Test functions mapping for QtWidgets.QTextEdit."""
        assert QtWidgets.QTextEdit.setTabStopWidth
        assert QtWidgets.QTextEdit.tabStopWidth
        assert QtWidgets.QTextEdit.print_
        textedit_widget = QtWidgets.QTextEdit(None)
        textedit_widget.setTabStopWidth(90)
        assert textedit_widget.tabStopWidth() == 90
        print_device, output_path = pdf_writer
        textedit_widget.print_(print_device)
        assert output_path.exists()
        # jupyter/qtconsole#624
        assert QtWidgets.QTextEdit.setExtraSelections
>       textedit_widget.setExtraSelections([])
E       AttributeError: type object 'PySide6.QtWidgets.QTextEdit' has no attribute 'ExtraSelection'. Did you mean: 'extraSelections'?

qtpy/tests/test_qtwidgets.py:35: AttributeError
-------------------------------------------- Captured Qt messages --------------------------------------------
QtWarningMsg: Could not find the Qt platform plugin "wayland" in ""
============================================ slowest 10 durations ============================================
0.15s setup    qtpy/tests/test_qtwidgets.py::test_qtextedit_functions
0.04s call     qtpy/tests/test_qtwidgets.py::test_qtextedit_functions
0.00s teardown qtpy/tests/test_qtwidgets.py::test_qtextedit_functions
========================================== short test summary info ===========================================
FAILED qtpy/tests/test_qtwidgets.py::test_qtextedit_functions - AttributeError: type object 'PySide6.QtWidgets.QTextEdit' has no attribute 'ExtraSelection'. Did you mean: 'extraSelections'?
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================= 1 failed in 0.56s ==============================================
```
@coveralls
Copy link

Coverage Status

coverage: 89.967% (-0.2%) from 90.18%
when pulling 0cc4165 on hmaarrfk:fix_pyside680
into 2cc5fc4 on spyder-ide:master.

@hmaarrfk
Copy link
Contributor Author

I see that they released the source files for 6.8.0.2. I'll see if i can rebuild for conda-forge and close this PR and the original issue.

@hmaarrfk
Copy link
Contributor Author

@hmaarrfk
Copy link
Contributor Author

Things seem to be resolved in PySide6 6.8.0.2

@hmaarrfk hmaarrfk closed this Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PySide 6.8 compatibility concerns?
2 participants