Coder Social home page Coder Social logo

Sphinx Viewcode.py IndexError list index out of range if child class file (.py) is smaller than parent class file. about sphinx HOT 5 CLOSED

hansonmcoombs avatar hansonmcoombs commented on June 2, 2024
Sphinx Viewcode.py IndexError list index out of range if child class file (.py) is smaller than parent class file.

from sphinx.

Comments (5)

hansonmcoombs avatar hansonmcoombs commented on June 2, 2024 1

@jayaddison Agreed and thanks for the advice. I have found parsing the difference between "sphinx" and sphinx extensions a bit confusing, so a bit of clarity is much appreciated.

Re slimming down the repo; fair comment and have done. I was at wits end when I posted the issue and that was as much as my brain could handle at the time.

It appears to be a conflict
between autoapi and viewcode extensions, with the following settings:

  • autoapi_options = ['inherited-members']
  • autoapi_python_use_implicit_namespaces = True
  • autoapi_python_class_content = 'both'

I have pushed a commit with the slimmed down example.

For anyone else watching the new issue at autoapi is: readthedocs/sphinx-autoapi#422

from sphinx.

picnixz avatar picnixz commented on June 2, 2024 1

Since it's a 3rd-party extension, I'm closing this one. But feel free to reopen (or create a new one if the issue is locked) in the future if the issue is from our side.

from sphinx.

jayaddison avatar jayaddison commented on June 2, 2024

Hi @hansonmcoombs - thanks for taking the time to report this. Can you check whether the problem occurs without the autoapi extension enabled? It didn't for me, but it's possible I have a slightly different configuration somehow.

from sphinx.

hansonmcoombs avatar hansonmcoombs commented on June 2, 2024

@jayaddison If I run it completely without the autoapi package then yes I get no error. If I run with the auto api extension enabled I do get the error, but the rst files in the docs_build/autoapi directory are created. If I then re-run with the auto api extension disabled (but with the auto api created rst files). Everything compiles as expected. Note, unsurprisingly there are some differences between the html output.

Does this mean I should raise this as an error on https://github.com/readthedocs/sphinx-autoapi/issues?

Should I cross link it?

from sphinx.

jayaddison avatar jayaddison commented on June 2, 2024

Thanks @hansonmcoombs. Yep, if the issue is only reproducible with that extension enabled, then I think it's best to start there, and with a mention / hyperlink here so that the maintainer can catch up on the context so far.

I'd encourage trying to remove as much configuration and RST from your example as you can before doing that - your example is fairly minimal but it may be possible to trim some more and narrow it down (that might help you figure out what introduces the failure, and will certainly help the maintainer there track it down).

It may come back here if the bug turns out to be something about the internals of Sphinx or the API we provide -- but I think we should start at the extension that seems to be the cause.

from sphinx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.