Sphinx writes always all files

21 views
Skip to first unread message

danwos

unread,
Sep 8, 2021, 10:46:38 AM9/8/21
to sphinx-dev
Hello,

how does Sphinx internally decide, if all files needs to be rewritten?

I'm maintaining the extension Sphinx-Needs and if a specific option of my extension is set in conf.py, Sphinx writes all files at each build.

The option is set like this in conf.py:
-----
from docutils.parsers.rst import directives

needs_extra_options = {
    "introduced": directives.unchanged,
    "updated": directives.unchanged,
    "impacts": directives.unchanged }
----

If needs_extra_options is not used, the value is set to {}.
Then during "env-before-read-docs" I set some default values to needs_extra_options.
So I change it internally.
However, this internal change on a not set needs_extra_options does not trigger Sphinx to write all files.

I have no idea, how a confog option is able to introduce such a behavior.
Any hints on which parts of Sphinx I should take look?

Thanks,
  Daniel

danwos

unread,
Sep 9, 2021, 5:45:20 AM9/9/21
to sphinx-dev
Hi all,

I figured it out and it looks like a bug in Sphinx.
If you assign a function to  config-var in conf.py, all the files get written again.
Other types like string, int, class, module work as expected.

Details and Example-Code can be find here: https://github.com/useblocks/sphinxcontrib-needs/issues/343#issuecomment-915927604

I will also open a Bug-Report in Sphinx.

Greetings,
 Daniel
Reply all
Reply to author
Forward
0 new messages