Bug 1698477 - python-sphinxcontrib-bibtex-0.4.2-2.fc31 FTBFS with Sphinx 2 and Python 3.8
Summary: python-sphinxcontrib-bibtex-0.4.2-2.fc31 FTBFS with Sphinx 2 and Python 3.8
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-sphinxcontrib-bibtex
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jerry James
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: SPHINX2 PYTHON38
TreeView+ depends on / blocked
 
Reported: 2019-04-10 12:52 UTC by Miro Hrončok
Modified: 2019-07-09 14:55 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-09 14:55:48 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Full log from Copr (154.11 KB, text/plain)
2019-04-10 12:52 UTC, Miro Hrončok
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github mcmtroffaes sphinxcontrib-bibtex issues 163 0 None None None 2019-04-10 13:00:32 UTC
Github mcmtroffaes sphinxcontrib-bibtex issues 167 0 None None None 2019-04-22 17:41:11 UTC
Github mcmtroffaes sphinxcontrib-bibtex pull 168 0 None None None 2019-04-22 17:41:11 UTC

Description Miro Hrončok 2019-04-10 12:52:36 UTC
Created attachment 1554221 [details]
Full log from Copr

======================================================================
ERROR: test_bibfile_out_of_date.test_bibfile_out_of_date
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/usr/lib/python3.8/site-packages/sphinx_testing/util.py", line 166, in decorator
    return func(*(args + (app, status, warning)), **kwargs)
  File "/builddir/build/BUILD/sphinxcontrib-bibtex-0.4.2/test/test_bibfile_out_of_date.py", line 27, in test_bibfile_out_of_date
    app.builder.build_all()
  File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 284, in build_all
    self.build(None, summary=__('all source files'), method='all')
  File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 339, in build
    updated_docnames = set(self.read())
  File "/usr/lib64/python3.8/contextlib.py", line 120, in __exit__
    next(self.gen)
  File "/usr/lib/python3.8/site-packages/sphinx/util/logging.py", line 230, in pending_warnings
    memhandler.flushTo(logger)
  File "/usr/lib/python3.8/site-packages/sphinx/util/logging.py", line 193, in flushTo
    logger.handle(record)
  File "/usr/lib64/python3.8/logging/__init__.py", line 1598, in handle
    self.callHandlers(record)
  File "/usr/lib64/python3.8/logging/__init__.py", line 1660, in callHandlers
    hdlr.handle(record)
  File "/usr/lib64/python3.8/logging/__init__.py", line 959, in handle
    rv = self.filter(record)
  File "/usr/lib64/python3.8/logging/__init__.py", line 820, in filter
    result = f.filter(record)
  File "/usr/lib/python3.8/site-packages/sphinx/util/logging.py", line 428, in filter
    raise SphinxWarning(message)
sphinx.errors.SphinxWarning: Since v2.0, Sphinx uses "index" as master_doc by default. Please add "master_doc = 'contents'" to your conf.py.

======================================================================
FAIL: test_issue14.test_duplicate_label
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/usr/lib/python3.8/site-packages/sphinx_testing/util.py", line 166, in decorator
    return func(*(args + (app, status, warning)), **kwargs)
  File "/builddir/build/BUILD/sphinxcontrib-bibtex-0.4.2/test/test_issue14.py", line 23, in test_duplicate_label
    assert re.search(
AssertionError


Complete results:


FAILED (errors=19, failures=1)

Log attached.

This blocks the bootstrap toward python-notebook.

Comment 2 Miro Hrončok 2019-04-10 13:03:56 UTC
This is not only reproducible with python 3.8 but also with older Pythons. However it blocks the bootstrap of Python 3.8.

Comment 3 Jerry James 2019-04-12 01:22:19 UTC
Right, it appears to be an issue with Sphinx 2, not with python 3.8.  The advice to change the master_doc setting to 'contents' is wrong; there is no file named doc/contents.rst.  The warning comes from this code in sphinx's config.py, lines 510 to 522:

def check_master_doc(app, env, added, changed, removed):
    # type: (Sphinx, BuildEnvironment, Set[str], Set[str], Set[str]) -> Set[str]
    """Adjust master_doc to 'contents' to support an old project which does not have
    no master_doc setting.
    """
    if (app.config.master_doc == 'index' and
            'index' not in app.project.docnames and
            'contents' in app.project.docnames):
        logger.warning(__('Since v2.0, Sphinx uses "index" as master_doc by default. '
                          'Please add "master_doc = \'contents\'" to your conf.py.'))
        app.config.master_doc = "contents"  # type: ignore

    return changed

"Does not have no"?  Double negatives are so hard to understand.  Do they mean "does not have any"?  But that's wrong.  The project does have a master_doc setting.  Furthermore, there *is* a file named doc/index.rst, and there *is not* a file named doc/contents.rst, so how did we end up with 'index' not in app.project.docnames, and with 'contents' in app.project.docnames?  That suggests that app.project.docnames got set by traversing the test directory, which is where the files named contents.rst are, but we're working with doc/conf.py in the code where the warning is thrown.

Are we sure this isn't a sphinx 2 bug?  It sure looks like one.

Comment 4 Miro Hrončok 2019-04-12 08:13:43 UTC
> Are we sure this isn't a sphinx 2 bug?

We are totally not sure. Thanks for looking into it.

Comment 5 Miro Hrončok 2019-04-12 08:14:29 UTC
> The project does have a master_doc setting.

Note that those are test failures, not doc build failures. Does your investigation apply to the tests?

Comment 7 Miro Hrončok 2019-04-22 17:27:12 UTC
Note that that fixes the immediate problem, but there are indeed Python 3.8 incompatibilities:

ERROR: test_issue62.test_local_bibliographies
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/usr/lib/python3.8/site-packages/sphinx_testing/util.py", line 171, in decorator
    return func(*(args + (app, status, warning)), **kwargs)
  File "/builddir/build/BUILD/sphinxcontrib-bibtex-e8fb75a5491c1e560fea1f18d58041ea177103c0/test/test_issue62.py", line 75, in test_local_bibliographies
    app.builder.build_all()
  File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 284, in build_all
    self.build(None, summary=__('all source files'), method='all')
  File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 339, in build
    updated_docnames = set(self.read())
  File "/usr/lib64/python3.8/contextlib.py", line 120, in __exit__
    next(self.gen)
  File "/usr/lib/python3.8/site-packages/sphinx/util/logging.py", line 230, in pending_warnings
    memhandler.flushTo(logger)
  File "/usr/lib/python3.8/site-packages/sphinx/util/logging.py", line 193, in flushTo
    logger.handle(record)
  File "/usr/lib64/python3.8/logging/__init__.py", line 1598, in handle
    self.callHandlers(record)
  File "/usr/lib64/python3.8/logging/__init__.py", line 1660, in callHandlers
    hdlr.handle(record)
  File "/usr/lib64/python3.8/logging/__init__.py", line 959, in handle
    rv = self.filter(record)
  File "/usr/lib64/python3.8/logging/__init__.py", line 820, in filter
    result = f.filter(record)
  File "/usr/lib/python3.8/site-packages/sphinx/util/logging.py", line 428, in filter
    raise SphinxWarning(message)
sphinx.errors.SphinxWarning: syntax error in :filter: expression; invalid node <_ast.Constant object at 0x7f30d74c32e0> in filter expression

Comment 8 Miro Hrončok 2019-04-22 17:41:11 UTC
Fix at https://github.com/mcmtroffaes/sphinxcontrib-bibtex/pull/168


Note You need to log in before you can comment on or make changes to this bug.