spyder: Toggling docstring style linting in preferences doesn't work in macOS

Problem Description

Unchecking “enable docstring style linting” in settings doesn’t seem to have any effect

What steps reproduce the problem?

  1. Open spyder with docstring style linting enabled
  2. Uncheck enable docstring style linting radio box
  3. Click Apply and/or OK

What is the expected output? What do you see instead?

I expect the warning icons for docstrings to disappear. Instead they remain and opening the preference again shows the radio box still clicked. Can disable by closing spyder and manually changing pydocstyle = True to False in spyder.ini file.

Versions

  • Spyder version: 4.0.0b2
  • Python version: 3.7.0 64-bit
  • Qt version: 5.9.6
  • PyQt version: 5.9.2
  • Operating System name/version: Darwin 18.6.0

Dependencies

pygments >=2.0     :  2.4.0 (OK)
qdarkstyle >=2.6.4 :  2.6.8 (OK)
sphinx >=0.6.6     :  2.0.1 (OK)
psutil >=0.3       :  5.6.2 (OK)
pyls >=0.19.0;<0.25:  0.24.0 (OK)
nbconvert >=4.0    :  5.5.0 (OK)
pandas >=0.13.1    :  0.24.2 (OK)
numpy >=1.7        :  1.16.4 (OK)
sympy >=0.7.3      :  1.4 (OK)
cython >=0.21      :  0.29.8 (OK)
qtconsole >=4.2.0  :  4.5.1 (OK)
IPython >=4.0      :  7.5.0 (OK)
matplotlib >=2.0.0 :  3.1.0 (OK)
pylint >=0.25      :  2.3.1 (OK)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (18 by maintainers)

Most upvoted comments

@steff456 please see https://github.com/spyder-ide/spyder/blob/master/spyder/preferences/configdialog.py#L313

            if not API == 'pyside':
                checkbox.clicked.connect(lambda _foo, opt=option:
                                         self.has_been_modified(opt))
            else:
                checkbox.clicked.connect(lambda opt=option:
                                         self.has_been_modified(opt))

It seems that on PyQt 5.9 for OSX (need to check with 5.12 and pip, could you do this @steff456 ?) this distiction is no longer needed

If I change to

            if not API == 'pyside':
                checkbox.clicked.connect(lambda opt=option:
                                         self.has_been_modified(opt))
            else:
                checkbox.clicked.connect(lambda opt=option:
                                         self.has_been_modified(opt))

It works as expected.

If this is the case then ALL the checkboxes on the preferences with PyQt5 and OSX are broken.

Maybe we now need to add another if to check if it is Darwin. I am not sure whye PyQt5 would work differently on this case.

Thoughts @ccordoba12 ?