Unchecking "enable docstring style linting" in settings doesn't seem to have any effect
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.
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)
It doesn't work immediately, but it does after a little while (2 or 3 secs). Could you confirm?
Nope, behaviour is completely consistent. Checking or unchecking the radio box in the docstring style tab of completion and linting settings does nothing. Behaviour doesn't change, and spyder.ini doesn't change.
Selecting "Show docstring style warnings" in the source menu toggles the behaviour and changes spyder.ini. As I said before, manually changing spyder.ini and restarting also works.
If I toggle the behaviour using the file or the menu, the state of the radio box in settings will change, but clicking the box in settings won't change anything.
Sorry I should be saying "preferences" window, not settings. but I think you know what I mean.
Do you have an external configuration file for pydocstyle?
nope. I've never used it till I turned it on in beta 2
Ok, thanks a lot for your patience. Final question: does this happen on Linux too or only on macOS?
I will test when I get back into the office next week.
Great, thanks!
Works fine on my Linux machine.
I'm testing using this command to check settings:
grep pydocstyle ~/.config/spyder-py3-dev/spyder.ini
On Linux, the initial output is
pydocstyle = False
pydocstyle/convention = numpy
pydocstyle/select =
pydocstyle/ignore =
pydocstyle/match = (?!test_).*\.py
pydocstyle/match_dir = [^\.].*
If I open the preferences window, click the radio box and hit apply, I now get
pydocstyle = True
pydocstyle/convention = numpy
pydocstyle/select =
pydocstyle/ignore =
pydocstyle/match = (?!test_).*\.py
pydocstyle/match_dir = [^\.].*
Uncheck and hit apply and it goes back to False.
On my mac, The pydocstyle = True/False value would change if I chose "show docstring style warnings" from the source menu, but not when clicking the box in preferences. So it's not a permissions error in the config file or anything like that.
I do note that on Linux, the spyder.ini is found at ~/.config/spyder-py3-dev/spyder.ini while on mac it's at ~/.spyder-py3-dev/spyder.ini so there is at least some difference in the handling of preferences between the versions.
Ok, thanks for the confirmation. I was asking about it because on Linux things are working fine for me.
@juanis2112, are you able to reproduce this problem on macOS?
I've managed to reproduce on two different macs now.
@ccordoba12 yes, I reproduced the problem in macOS.
Want to give it a go at fixing it @juanis2112 ?
I have no idea what could be causing this problem, but @steff456 has more experience with the PyLS and she also works in macOS.
@steff456, please notice that Docstring linting is working from the Source menu. It's only when it's activated in Preferences that it fails.
@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 ?
I found that some of the checkboxes on the preferences were working fine, but there were more than the one reported in the issue that wasn't working as expected. For example, the checkbox for Python Interpreter -> Enable UMR is working fine on OSX.
I already checked the error in PyQt5.12 and pip is present, and by removing the _foo as @goanpeca found the issue is fixed.
Those checks can be safely removed, I think. I added them several years ago for PyQt4, so I'm not surprised they are not working anymore for PyQt5.
Most helpful comment
@steff456 please see https://github.com/spyder-ide/spyder/blob/master/spyder/preferences/configdialog.py#L313
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
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 ?