ripe-atlas-tools icon indicating copy to clipboard operation
ripe-atlas-tools copied to clipboard

intersphinx tries to use network to generate the docs

Open RaitoBezarius opened this issue 1 year ago • 0 comments

intersphinx setup is trying to use network to generate the docs as shown by this trace (in a sandbox with no network access):


self = <tests.test_docs.DocTest testMethod=test_html_documentation>

    def test_html_documentation(self):
>       Sphinx(
            self.SOURCE_DIR,
            self.CONFIG_DIR,
            self.OUTPUT_DIR,
            self.DOCTREE_DIR,
            buildername="html",
            warningiserror=True,
        ).build(force_all=True)

tests/test_docs.py:29: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/nix/store/6vj5njls91d0wsk0jq6l8rzywq081qkj-python3.10-sphinx-5.0.2/lib/python3.10/site-packages/sphinx/application.py:256: in __init__
    self._init_builder()
/nix/store/6vj5njls91d0wsk0jq6l8rzywq081qkj-python3.10-sphinx-5.0.2/lib/python3.10/site-packages/sphinx/application.py:314: in _init_builder
    self.events.emit('builder-inited')
/nix/store/6vj5njls91d0wsk0jq6l8rzywq081qkj-python3.10-sphinx-5.0.2/lib/python3.10/site-packages/sphinx/events.py:94: in emit
    results.append(listener.handler(self.app, *args))
/nix/store/6vj5njls91d0wsk0jq6l8rzywq081qkj-python3.10-sphinx-5.0.2/lib/python3.10/site-packages/sphinx/ext/intersphinx.py:238: in load_mappings
    updated = [f.result() for f in concurrent.futures.as_completed(futures)]
/nix/store/6vj5njls91d0wsk0jq6l8rzywq081qkj-python3.10-sphinx-5.0.2/lib/python3.10/site-packages/sphinx/ext/intersphinx.py:238: in <listcomp>
    updated = [f.result() for f in concurrent.futures.as_completed(futures)]
/nix/store/xf1k5k05vg3zn7dfcpfh1qa7ga48hi3m-python3-3.10.6/lib/python3.10/concurrent/futures/_base.py:451: in result
    return self.__get_result()
/nix/store/xf1k5k05vg3zn7dfcpfh1qa7ga48hi3m-python3-3.10.6/lib/python3.10/concurrent/futures/_base.py:403: in __get_result
    raise self._exception
/nix/store/xf1k5k05vg3zn7dfcpfh1qa7ga48hi3m-python3-3.10.6/lib/python3.10/concurrent/futures/thread.py:58: in run
    result = self.fn(*self.args, **self.kwargs)
/nix/store/6vj5njls91d0wsk0jq6l8rzywq081qkj-python3.10-sphinx-5.0.2/lib/python3.10/site-packages/sphinx/ext/intersphinx.py:223: in fetch_inventory_group
    logger.warning(__("failed to reach any of the inventories "
/nix/store/xf1k5k05vg3zn7dfcpfh1qa7ga48hi3m-python3-3.10.6/lib/python3.10/logging/__init__.py:1847: in warning
    self.log(WARNING, msg, *args, **kwargs)
/nix/store/6vj5njls91d0wsk0jq6l8rzywq081qkj-python3.10-sphinx-5.0.2/lib/python3.10/site-packages/sphinx/util/logging.py:122: in log
    super().log(level, msg, *args, **kwargs)
/nix/store/xf1k5k05vg3zn7dfcpfh1qa7ga48hi3m-python3-3.10.6/lib/python3.10/logging/__init__.py:1879: in log
    self.logger.log(level, msg, *args, **kwargs)
/nix/store/xf1k5k05vg3zn7dfcpfh1qa7ga48hi3m-python3-3.10.6/lib/python3.10/logging/__init__.py:1547: in log
    self._log(level, msg, args, **kwargs)
/nix/store/xf1k5k05vg3zn7dfcpfh1qa7ga48hi3m-python3-3.10.6/lib/python3.10/logging/__init__.py:1624: in _log
    self.handle(record)
/nix/store/xf1k5k05vg3zn7dfcpfh1qa7ga48hi3m-python3-3.10.6/lib/python3.10/logging/__init__.py:1634: in handle
    self.callHandlers(record)
/nix/store/xf1k5k05vg3zn7dfcpfh1qa7ga48hi3m-python3-3.10.6/lib/python3.10/logging/__init__.py:1696: in callHandlers
    hdlr.handle(record)
/nix/store/xf1k5k05vg3zn7dfcpfh1qa7ga48hi3m-python3-3.10.6/lib/python3.10/logging/__init__.py:964: in handle
    rv = self.filter(record)
/nix/store/xf1k5k05vg3zn7dfcpfh1qa7ga48hi3m-python3-3.10.6/lib/python3.10/logging/__init__.py:821: in filter
    result = f.filter(record)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <sphinx.util.logging.WarningIsErrorFilter object at 0x7ffff49170a0>
record = <LogRecord: sphinx.sphinx.ext.intersphinx, 30, /nix/store/6vj5njls91d0wsk0jq6l8rzywq081qkj-python3.10-sphinx-5.0.2/lib...n object at 0x7ffff3ed20b0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))">

    def filter(self, record: logging.LogRecord) -> bool:
        if getattr(record, 'skip_warningsiserror', False):
            # disabled by DisableWarningIsErrorFilter
            return True
        elif self.app.warningiserror:
            location = getattr(record, 'location', '')
            try:
                message = record.msg % record.args
            except (TypeError, ValueError):
                message = record.msg  # use record.msg itself
    
            if location:
                exc = SphinxWarning(location + ":" + str(message))
            else:
                exc = SphinxWarning(message)
            if record.exc_info is not None:
                raise exc from record.exc_info[1]
            else:
>               raise exc
E               sphinx.errors.SphinxWarning: failed to reach any of the inventories with the following issues:
E               intersphinx inventory 'http://docs.python.org/objects.inv' not fetchable due to <class 'requests.exceptions.ConnectionError'>: HTTPConnectionPool(host='docs.python.org', port=80): Max retries exceeded with url: /objects.inv (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ffff3ed20b0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

/nix/store/6vj5njls91d0wsk0jq6l8rzywq081qkj-python3.10-sphinx-5.0.2/lib/python3.10/site-packages/sphinx/util/logging.py:425: SphinxWarning
----------------------------- Captured stdout call -----------------------------
Running Sphinx v5.0.2
making output directory... done
loading intersphinx inventory from http://docs.python.org/objects.inv...

I assume this is due to the example test for intersphinx in conf.py, the fix may be to remove the last line. I can confirm it works fine in our CI to remove the last line.

RaitoBezarius avatar Aug 23 '22 11:08 RaitoBezarius