Commit 2d99648e99 changed the apidoc
extension to ignore packages if the __init__.py file was empty. That
breaks the toctree structure if those packages do contain submodules
and subpackages. This patch adds a check to ensure that empty
__init__.py modules are only skipped if there are no other python
modules in the same directory.
Addresses bug #654
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
As reported here: https://github.com/rtfd/readthedocs.org/issues/3411 sphinx sometimes fails with the error:
```python
File "/home/docs/checkouts/readthedocs.org/user_builds/drf-yasg/envs/latest/lib/python3.5/site-packages/sphinx/ext/viewcode.py", line 74, in has_tag
if entry is None or entry[0] != code:
TypeError: 'bool' object is not subscriptable
```
This is not critical as whipping the build or even just running it again fixes it, but the error is confusing...
I believe switching the two if statement above should prevent this from happening.
closes#4142closes#4357closes#4359
refs: #3967
Adds ``smartquotes``, ``smartquotes_action``, ``smartquotes_excludes``
configuration variables.
- if ``smartquotes`` is set to False, then Smart Quotes transform is not
applied even if a Docutils configuration file activates it,
- the current default of ``smartquotes_excludes`` deactivates Smart
Quotes for Japanese language, and also for the ``man`` and ``text``
builders.
However, currently ``make text html`` deactivates Smart Quotes for
``html`` too, and ``make html text`` activates them for ``text`` too,
because the picked environment is shared and already transformed.
- now Smart Quotes get applied also when source documents are in
Markdown or other formats.
Given that we install Sphinx as part of the dependencies, there's no
reason to do it twice. Skip that step.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Use the ensuredir() function consistently across Sphinx code to avoid
race conditions e.g. when multiple Sphinx instances attempt to create
the same output directory. The ensuredir() function that was already
present in sphinx.util.osutil correctly catches EEXIST exception that
occurs if the specified directory already exists (i.e. it was created
between the call to os.path.isdir() and os.makedirs() that follows it).
While at it, remove redundant os.path.isdir() calls when they only
guarded the os.makedirs() call, and replace mkdir_p() which had pretty
much the same purpose, except for being prone to race conditions.
I did not modify testing-related code as race conditions mostly affect
real applications and not the test environment.
Fix#4281: Race conditions when creating output directory