Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTD build failure during docbuild in mapper #324

Closed
mhmdkanj opened this issue Feb 8, 2022 · 1 comment
Closed

RTD build failure during docbuild in mapper #324

mhmdkanj opened this issue Feb 8, 2022 · 1 comment

Comments

@mhmdkanj
Copy link

mhmdkanj commented Feb 8, 2022

Hi,

for some reason, my ReadTheDocs build is failing due to an exception raised in the mapper.py.
But I'm not sure what exactly is the problem.
I'm currently using the following

  • Python 3.6
  • Sphinx 4.4.0
  • sphinx-autoapi 1.8.4

I have a usual docs directory tree which includes:

docs/
        requirements.txt
        source/
                  conf.py
                  index.rst

I'm experiencing the following during the execution of the following command:
/home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/envs/latest/bin/python -m sphinx -T -b html -d _build/doctrees -D language=en . _build/html

Running Sphinx v4.4.0
loading translations [en]... done
making output directory... done
WARNING: html_static_path entry '_static' does not exist
myst v0.16.1: MdParserConfig(renderer='sphinx', commonmark_only=False, enable_extensions=['dollarmath'], linkify_fuzzy_links=True, dmath_allow_labels=True, dmath_allow_space=True, dmath_allow_digits=True, dmath_double_inline=False, update_mathjax=True, mathjax_classes='tex2jax_process|mathjax_process|math|output_area', disable_syntax=[], url_schemes=['http', 'https', 'mailto', 'ftp'], heading_anchors=None, heading_slug_func=None, html_meta=[], footnote_transition=True, substitutions=[], sub_delimiters=['{', '}'], words_per_minute=200)
[AutoAPI] Ignoring /home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/checkouts/latest/renamerename/__init__.py
[AutoAPI] Ignoring /home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/checkouts/latest/renamerename/__main__.py
[AutoAPI] Ignoring /home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/checkouts/latest/renamerename/__main__.py
[AutoAPI] Ignoring /home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/checkouts/latest/renamerename/executor/app.py
[AutoAPI] Ignoring /home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/checkouts/latest/renamerename/executor/app.py
[AutoAPI] Ignoring /home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/checkouts/latest/renamerename/executor/executor.py
[AutoAPI] Ignoring /home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/checkouts/latest/renamerename/executor/__init__.py
[AutoAPI] Ignoring /home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/checkouts/latest/renamerename/executor/encoder_decoder.py
[AutoAPI] Ignoring /home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/checkouts/latest/renamerename/handlers/__init__.py
[AutoAPI] Ignoring /home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/checkouts/latest/renamerename/handlers/filetransformation.py
[AutoAPI] Ignoring /home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/checkouts/latest/renamerename/handlers/handlers.py
[AutoAPI] Ignoring /home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/checkouts/latest/renamerename/tests/test_filenamehandler.py
[AutoAPI] Ignoring /home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/checkouts/latest/renamerename/tests/test_filenamehandler.py
[AutoAPI] Ignoring /home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/checkouts/latest/renamerename/tests/__init__.py
[AutoAPI] Ignoring /home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/checkouts/latest/renamerename/tests/test_filelisthandler.py
[AutoAPI] Ignoring /home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/checkouts/latest/renamerename/tests/test_filelisthandler.py
[AutoAPI] Ignoring /home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/checkouts/latest/renamerename/tests/test_executor.py
[AutoAPI] Ignoring /home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/checkouts/latest/renamerename/tests/test_executor.py
[AutoAPI] Ignoring /home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/checkouts/latest/renamerename/tests/test_filetransformation.py
[AutoAPI] Ignoring /home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/checkouts/latest/renamerename/tests/test_filetransformation.py
[AutoAPI] Ignoring /home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/checkouts/latest/renamerename/tests/test_encoder_decoder.py
[AutoAPI] Ignoring /home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/checkouts/latest/renamerename/tests/test_encoder_decoder.py

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/envs/latest/lib/python3.7/site-packages/sphinx/events.py", line 101, in emit
    results.append(listener.handler(self.app, *args))
  File "/home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/envs/latest/lib/python3.7/site-packages/autoapi/extension.py", line 165, in run_autoapi
    patterns=file_patterns, dirs=normalised_dirs, ignore=ignore_patterns
  File "/home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/envs/latest/lib/python3.7/site-packages/autoapi/mappers/python/mapper.py", line 289, in load
    if not self._need_to_load(dir_root_files):
  File "/home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/envs/latest/lib/python3.7/site-packages/autoapi/mappers/python/mapper.py", line 259, in _need_to_load
    this_mtime = max(os.path.getmtime(file) for _, file in files)
ValueError: max() arg is an empty sequence

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/envs/latest/lib/python3.7/site-packages/sphinx/cmd/build.py", line 283, in build_main
    args.tags, args.verbosity, args.jobs, args.keep_going)
  File "/home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 263, in __init__
    self._init_builder()
  File "/home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 322, in _init_builder
    self.events.emit('builder-inited')
  File "/home/docs/checkouts/readthedocs.org/user_builds/mhmdkanj-renamerename/envs/latest/lib/python3.7/site-packages/sphinx/events.py", line 110, in emit
    (listener.handler, name), exc, modname=modname) from exc
sphinx.errors.ExtensionError: Handler <function run_autoapi at 0x7f86eb1aa3b0> for event 'builder-inited' threw an exception (exception: max() arg is an empty sequence)

Extension error (autoapi.extension):
Handler <function run_autoapi at 0x7f86eb1aa3b0> for event 'builder-inited' threw an exception (exception: max() arg is an empty sequence)

@mhmdkanj
Copy link
Author

mhmdkanj commented Feb 9, 2022

Hi @AWhetter , thanks for the fix!
So this actually works locally and docs are built. However on ReadTheDocs, I guess it should fail elegantly with the ExtensionError, right? But why wouldn't it find source fails if they exist under docs/sources along with the conf.py

netbsd-srcmastr referenced this issue in NetBSD/pkgsrc May 6, 2023
v2.1.0 (2023-03-28)
-------------------

Deprecations and Removals
^^^^^^^^^^^^^^^^^^^^^^^^^

- Support for documenting languages other than Python is deprecated. (#248)
- Removed the option to have autoapi generate toctree entries for domain objects.
  Domain objects are now added to the toctree by Sphinx.
  Dropped support for sphinx < 5.2.0. (#369)


Misc
^^^^

- Added basic type checking.
- Integrated towncrier into the release workflow.


v2.0.1 (2023-01-16)
-------------------

Features
^^^^^^^^
- Can turn off the addition of documented objects to the TOC tree.
- Added support for Python 3.11.

Bug Fixes
^^^^^^^^^
- `#330 <https://github.com/readthedocs/sphinx-autoapi/issues/330>`: (Python)
  Render tuple values as tuples, not lists.
- `#341 <https://github.com/readthedocs/sphinx-autoapi/issues/341>`: (Python)
  Fix module level assignments to class attributes being documented as
  module level attributes.
- (Python) Fix "bysource" sort order showing items in alphabetical order.
- (Python) Use the correct directives for a variable type and value.

Trivial/Internal Changes
^^^^^^^^^^^^^^^^^^^^^^^^
- Removed some autogenerated test data from the repository.


v2.0.0 (2022-09-27)
-------------------

Breaking Changes
^^^^^^^^^^^^^^^^

- Dropped support for Sphinx <4.
- `#352 <https://github.com/readthedocs/sphinx-autoapi/issues/352>`: (Python)
  Properties are rendered with the ``property`` directive,
  fixing support for Sphinx 5.2.
  A new ``PythonPythonMapper`` object (``PythonProperty``) has been created
  to support this change. This object can be passed to templates, filters,
  and hooks.
  A new ``property.rst`` template has also been created to support this change.

Trivial/Internal Changes
^^^^^^^^^^^^^^^^^^^^^^^^
- Use https links where possible in documentation.
- Pass correct argument types to ``status_iterator``.


V1.9.0 (2022-07-25)
-------------------

Breaking Changes
^^^^^^^^^^^^^^^^

- Dropped support for Python 3.6.

Features
^^^^^^^^

- Added support for Python 3.10.
- `#222 <https://github.com/readthedocs/sphinx-autoapi/issues/222>`:
  Marked extension as parallel read safe.

Bug Fixes
^^^^^^^^^
- `#324 <https://github.com/readthedocs/sphinx-autoapi/issues/324>`: (Python)
  Fail elegantly when no source files are found.
- (Python) Stop calling ``autodoc-process-docstring`` when docstring is empty.
  Works around sphinx-doc/sphinx#10701.
- `#318 <https://github.com/readthedocs/sphinx-autoapi/issues/318>`: (Python)
  Fixed misaligned argument types on methods/classmethods when using type comments.
- `#278 <https://github.com/readthedocs/sphinx-autoapi/issues/278>`: (Python)
  Limit signatures to 60 characters in summaries.
- Fix keyerror when using markdown sources.
- `#328 <https://github.com/readthedocs/sphinx-autoapi/issues/328>`: (Python)
  Fix kw-only marker getting ignored if first in the signature.

Trivial/Internal Changes
^^^^^^^^^^^^^^^^^^^^^^^^
- Fixed tests in Sphinx 5.
- Fixed many typos throughout the documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants