spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.31k stars 1.61k forks source link

Ctrl+I produces warning with Sphinx 4 #15195

Closed shcrela closed 3 years ago

shcrela commented 3 years ago

Description

What steps will reproduce the problem?

I just clicked on Ctrl+i while cursor on the numpy flipud function.

Traceback

/home/dejan/anaconda3/lib/python3.9/site-packages/sphinx/ext/jsmath.py:24: RemovedInSphinx40Warning: sphinx.ext.jsmath has been moved to sphinxcontrib-jsmath.
  warnings.warn('sphinx.ext.jsmath has been moved to sphinxcontrib-jsmath.',

Versions

Dependencies


# Mandatory:
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  1.6.0 (OK)
cookiecutter >=1.6.0          :  1.7.2 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.1.0 (OK)
IPython >=7.6.0               :  7.22.0 (OK)
jedi =0.17.2                  :  0.17.2 (OK)
jsonschema >=3.2.0            :  3.2.0 (OK)
keyring >=17.0.0              :  23.0.1 (OK)
nbconvert >=4.0               :  6.0.7 (OK)
numpydoc >=0.6.0              :  1.1.0 (OK)
parso =0.7.0                  :  0.7.0 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.8.0 (OK)
pygments >=2.0                :  2.8.1 (OK)
pylint >=1.0                  :  2.7.4 (OK)
pyls >=0.36.2;<1.0.0          :  0.36.2 (OK)
pyls_black >=0.4.6            :  0.4.6 (OK)
pyls_spyder >=0.3.2           :  0.3.2 (OK)
qdarkstyle =3.0.2             :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.1.10 (OK)
qtawesome >=0.5.7             :  1.0.2 (OK)
qtconsole >=5.0.3             :  5.0.3 (OK)
qtpy >=1.5.0                  :  1.9.0 (OK)
rtree >=0.8.3                 :  0.9.7 (OK)
setuptools >=39.0.0           :  52.0.0.post20210125 (OK)
sphinx >=0.6.6                :  3.5.3 (OK)
spyder_kernels >=2.0.1,<2.1.0 :  2.0.1 (NOK)
textdistance >=4.2.0          :  4.2.1 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3;<2.0.0      :  1.0.2 (OK)
xdg >=0.26                    :  0.27 (OK)
zmq >=17                      :  22.0.3 (OK)

# Optional:
cython >=0.21                 :  None (NOK)
matplotlib >=2.0.0            :  3.4.1 (OK)
numpy >=1.7                   :  1.20.2 (OK)
pandas >=1.1.1                :  1.2.3 (OK)
scipy >=0.17.0                :  1.6.2 (OK)
sympy >=0.7.3                 :  None (NOK)
ccordoba12 commented 3 years ago

Hey @shcrela, thanks for reporting. We'll try to fix that in a future release.

In the meantime, please downgrade to Sphinx 3.4 or 3.2 to avoid seeing that error.

ccordoba12 commented 3 years ago

@mrclary, could you verify if sphinxcontrib-jsmath is part of the Mac installer for 5.0.2? See issue #15609 for the rationale.

Also, what's the docutils version included in the installer?

mrclary commented 3 years ago

5.0.2 was built with sphinx=4.0.0, sphinxcontrib-jsmath=?, and docutils=0.17.1.

The latest artifact (e78c2bb49f2e7b97adb53a1813db6d0d60982f3c) was built with the following Python environment (sphinx=4.0.1, sphinxcontrib-jsmath=1.0.1, and docutils=0.17.1).

Build Environment ``` Python 3.9.4 (default, Apr 5 2021, 01:49:30) [Clang 12.0.0 (clang-1200.0.32.29)] Package Version Location ------------------------------------------------- ------------------ --------------------------------------------------------------------- alabaster 0.7.12 altgraph 0.17 appdirs 1.4.4 applaunchservices 0.2.1 appnope 0.1.2 arrow 1.1.0 astroid 2.5.6 async-generator 1.10 atomicwrites 1.4.0 attrs 21.2.0 autopep8 1.5.5 Babel 2.9.1 backcall 0.2.0 bcrypt 3.2.0 binaryornot 0.4.4 black 21.5b1 bleach 3.3.0 certifi 2020.12.5 cffi 1.14.5 chardet 4.0.0 click 8.0.0 cloudpickle 1.6.0 cookiecutter 1.7.2 cryptography 3.4.7 cycler 0.10.0 Cython 0.29.23 decorator 4.4.2 defusedxml 0.7.1 diff-match-patch 20200713 dmgbuild 1.4.2 docutils 0.17.1 ds-store 1.3.0 entrypoints 0.3 flake8 3.8.4 idna 2.10 imagesize 1.2.0 importlib-metadata 4.0.1 inflection 0.5.1 intervaltree 3.1.0 ipykernel 5.5.4 ipython 7.23.1 ipython-genutils 0.2.0 isort 5.8.0 jedi 0.17.2 Jinja2 2.11.3 jinja2-time 0.2.0 jsonschema 3.2.0 jupyter-client 6.1.12 jupyter-core 4.7.1 jupyterlab-pygments 0.1.2 keyring 23.0.1 kiwisolver 1.3.1 lazy-object-proxy 1.6.0 mac-alias 2.2.0 macholib 1.14 MarkupSafe 1.1.1 matplotlib 3.4.2 matplotlib-inline 0.1.2 mccabe 0.6.1 mistune 0.8.4 modulegraph 0.18 mpmath 1.2.1 mypy-extensions 0.4.3 nbclient 0.5.3 nbconvert 6.0.7 nbformat 5.1.3 nest-asyncio 1.5.1 numpy 1.20.3 numpydoc 1.1.0 packaging 20.9 pandas 1.2.4 pandocfilters 1.4.3 paramiko 2.7.2 parso 0.7.0 pathspec 0.8.1 pexpect 4.8.0 pickleshare 0.7.5 Pillow 8.2.0 pip 21.1.1 pluggy 0.13.1 poyo 0.5.0 prompt-toolkit 3.0.18 psutil 5.8.0 ptyprocess 0.7.0 py2app 0.22 pycodestyle 2.6.0 pycparser 2.20 pydocstyle 6.0.0 pyflakes 2.2.0 Pygments 2.9.0 pylint 2.8.2 pyls-black 0.4.6 pyls-spyder 0.3.2 PyNaCl 1.4.0 pyobjc 7.2 pyobjc-core 7.2 pyobjc-framework-Accounts 7.2 pyobjc-framework-AddressBook 7.2 pyobjc-framework-AdSupport 7.2 pyobjc-framework-AppleScriptKit 7.2 pyobjc-framework-AppleScriptObjC 7.2 pyobjc-framework-ApplicationServices 7.2 pyobjc-framework-AuthenticationServices 7.2 pyobjc-framework-AutomaticAssessmentConfiguration 7.2 pyobjc-framework-Automator 7.2 pyobjc-framework-AVFoundation 7.2 pyobjc-framework-AVKit 7.2 pyobjc-framework-BusinessChat 7.2 pyobjc-framework-CalendarStore 7.2 pyobjc-framework-CFNetwork 7.2 pyobjc-framework-CloudKit 7.2 pyobjc-framework-Cocoa 7.2 pyobjc-framework-Collaboration 7.2 pyobjc-framework-ColorSync 7.2 pyobjc-framework-Contacts 7.2 pyobjc-framework-ContactsUI 7.2 pyobjc-framework-CoreAudio 7.2 pyobjc-framework-CoreAudioKit 7.2 pyobjc-framework-CoreBluetooth 7.2 pyobjc-framework-CoreData 7.2 pyobjc-framework-CoreHaptics 7.2 pyobjc-framework-CoreLocation 7.2 pyobjc-framework-CoreMedia 7.2 pyobjc-framework-CoreMediaIO 7.2 pyobjc-framework-CoreMIDI 7.2 pyobjc-framework-CoreML 7.2 pyobjc-framework-CoreMotion 7.2 pyobjc-framework-CoreServices 7.2 pyobjc-framework-CoreSpotlight 7.2 pyobjc-framework-CoreText 7.2 pyobjc-framework-CoreWLAN 7.2 pyobjc-framework-CryptoTokenKit 7.2 pyobjc-framework-DeviceCheck 7.2 pyobjc-framework-DictionaryServices 7.2 pyobjc-framework-DiscRecording 7.2 pyobjc-framework-DiscRecordingUI 7.2 pyobjc-framework-DiskArbitration 7.2 pyobjc-framework-DVDPlayback 7.2 pyobjc-framework-EventKit 7.2 pyobjc-framework-ExceptionHandling 7.2 pyobjc-framework-ExecutionPolicy 7.2 pyobjc-framework-ExternalAccessory 7.2 pyobjc-framework-FileProvider 7.2 pyobjc-framework-FileProviderUI 7.2 pyobjc-framework-FinderSync 7.2 pyobjc-framework-FSEvents 7.2 pyobjc-framework-GameCenter 7.2 pyobjc-framework-GameController 7.2 pyobjc-framework-GameKit 7.2 pyobjc-framework-GameplayKit 7.2 pyobjc-framework-ImageCaptureCore 7.2 pyobjc-framework-IMServicePlugIn 7.2 pyobjc-framework-InputMethodKit 7.2 pyobjc-framework-InstallerPlugins 7.2 pyobjc-framework-InstantMessage 7.2 pyobjc-framework-Intents 7.2 pyobjc-framework-IOSurface 7.2 pyobjc-framework-iTunesLibrary 7.2 pyobjc-framework-LatentSemanticMapping 7.2 pyobjc-framework-LaunchServices 7.2 pyobjc-framework-libdispatch 7.2 pyobjc-framework-LinkPresentation 7.2 pyobjc-framework-LocalAuthentication 7.2 pyobjc-framework-MapKit 7.2 pyobjc-framework-MediaAccessibility 7.2 pyobjc-framework-MediaLibrary 7.2 pyobjc-framework-MediaPlayer 7.2 pyobjc-framework-MediaToolbox 7.2 pyobjc-framework-Metal 7.2 pyobjc-framework-MetalKit 7.2 pyobjc-framework-MetalPerformanceShaders 7.2 pyobjc-framework-ModelIO 7.2 pyobjc-framework-MultipeerConnectivity 7.2 pyobjc-framework-NaturalLanguage 7.2 pyobjc-framework-NetFS 7.2 pyobjc-framework-Network 7.2 pyobjc-framework-NetworkExtension 7.2 pyobjc-framework-NotificationCenter 7.2 pyobjc-framework-OpenDirectory 7.2 pyobjc-framework-OSAKit 7.2 pyobjc-framework-OSLog 7.2 pyobjc-framework-PencilKit 7.2 pyobjc-framework-Photos 7.2 pyobjc-framework-PhotosUI 7.2 pyobjc-framework-PreferencePanes 7.2 pyobjc-framework-PushKit 7.2 pyobjc-framework-Quartz 7.2 pyobjc-framework-QuickLookThumbnailing 7.2 pyobjc-framework-SafariServices 7.2 pyobjc-framework-SceneKit 7.2 pyobjc-framework-ScreenSaver 7.2 pyobjc-framework-ScriptingBridge 7.2 pyobjc-framework-SearchKit 7.2 pyobjc-framework-Security 7.2 pyobjc-framework-SecurityFoundation 7.2 pyobjc-framework-SecurityInterface 7.2 pyobjc-framework-ServiceManagement 7.2 pyobjc-framework-Social 7.2 pyobjc-framework-SoundAnalysis 7.2 pyobjc-framework-Speech 7.2 pyobjc-framework-SpriteKit 7.2 pyobjc-framework-StoreKit 7.2 pyobjc-framework-SyncServices 7.2 pyobjc-framework-SystemConfiguration 7.2 pyobjc-framework-SystemExtensions 7.2 pyobjc-framework-UserNotifications 7.2 pyobjc-framework-VideoSubscriberAccount 7.2 pyobjc-framework-VideoToolbox 7.2 pyobjc-framework-Vision 7.2 pyobjc-framework-WebKit 7.2 pyparsing 2.4.7 PyQt5 5.12.3 PyQt5-sip 12.9.0 PyQtWebEngine 5.12.1 pyrsistent 0.17.3 python-dateutil 2.8.1 python-jsonrpc-server 0.4.0 python-language-server 5.0.2+9.gc02891bbc /Users/runner/work/spyder/spyder/external-deps/python-language-server python-slugify 5.0.2 pytz 2021.1 pyxdg 0.27 pyzmq 22.0.3 QDarkStyle 3.0.dev0 /Users/runner/work/spyder/spyder/external-deps/qdarkstyle qstylizer 0.2.0 QtAwesome 1.0.2 qtconsole 5.1.0 QtPy 1.9.0 regex 2021.4.4 requests 2.25.1 rope 0.19.0 Rtree 0.9.7 scipy 1.6.3 setuptools 56.2.0 six 1.16.0 snowballstemmer 2.1.0 sortedcontainers 2.3.0 Sphinx 4.0.1 sphinxcontrib-applehelp 1.0.2 sphinxcontrib-devhelp 1.0.2 sphinxcontrib-htmlhelp 1.0.3 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.3 sphinxcontrib-serializinghtml 1.1.4 spyder-kernels 2.1.0.dev0 /Users/runner/work/spyder/spyder/external-deps/spyder-kernels sympy 1.8 testpath 0.4.4 text-unidecode 1.3 textdistance 4.2.1 three-merge 0.1.1 tinycss2 1.1.0 toml 0.10.2 tornado 6.1 traitlets 5.0.5 ujson 4.0.2 urllib3 1.26.4 watchdog 1.0.2 wcwidth 0.2.5 webencodings 0.5.1 wheel 0.36.2 wrapt 1.12.1 wurlitzer 2.1.0 yapf 0.31.0 zipp 3.4.1 ```

Both sphinx 4.0 and docutils 0.17 were recently released. Sphinx 3.5.4 showed a requirement docutils>=0.12,<0.17 while sphinx 4.0 introduced docutils>=0.14,<0.18.

The error message suggests that docutils needs to be installed outside the zip directory in the application. The only reason I can think that this was not an issue before is that docutils/writers/latex2e/docutils.sty was not accessed before; perhaps it is new to 0.17.

I can reproduce #15609, but cmd-i on numpy.flipud produces the same docutils.sty message for me and no mention of sphinxcontrib-jsmath.

I'll move docutils outside the zip location and test.

ccordoba12 commented 3 years ago

Thanks for your help @mrclary!

mrclary commented 3 years ago

Okay, it looks like this issue and #15609 are technically separate issues but both produce nearly identical error symptoms and are related to the recent updates to the sphinx and docutils packages.

After moving the docutils outside the zip directory, I was then able to reproduce similar errors to the OP. The issue here is that the sphinx extensions are not being included in the build.

15622 should resolve both issues.

ccordoba12 commented 3 years ago

15622 should resolve both issues.

Did you test the Mac installer generated on PR #15622 to be sure?

ccordoba12 commented 3 years ago

@dalthviz, could you test if interactive help is working on the Windows installer? Perhaps we have a similar problem with it too.

ccordoba12 commented 3 years ago

@mrclary and @dalthviz, please also test with docstrings that have math, e.g. np.sin to see if we're rendering them correctly.

mrclary commented 3 years ago

@ccordoba12, my local build and the artifact from #15622 look good: no errors and math is rendered correctly in np.sin using cmd-i in the Console.

dalthviz commented 3 years ago

Testing with the installer generated at https://github.com/spyder-ide/spyder/pull/15627 Ctrl + I works for me on Windows @ccordoba12

ccordoba12 commented 3 years ago

Thanks @mrclary and @dalthviz for your help.