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

AttributeError: 'ServiceDirective' object has no attribute 'get_field_type_map' #22

Closed
bowlofeggs opened this issue Jun 6, 2019 · 0 comments · Fixed by #26
Closed
Labels

Comments

@bowlofeggs
Copy link
Member

With the recently released Sphinx 2.1.0, it seems that cornice_sphinx might be using a different kind of Directive object than Sphinx is expecting:

# Sphinx version: 2.1.0
# Python version: 3.7.3 (CPython)
# Docutils version: 0.14 
# Jinja2 version: 2.10.1
# Last messages:
#   reading sources... [ 26%] index
#   reading sources... [ 28%] python_bindings
#   reading sources... [ 30%] server_api/index
#   reading sources... [ 32%] server_api/messages/base
#   reading sources... [ 34%] server_api/messages/buildroot_override
#   reading sources... [ 36%] server_api/messages/compose
#   reading sources... [ 38%] server_api/messages/composer
#   reading sources... [ 40%] server_api/messages/errata
#   reading sources... [ 42%] server_api/messages/update
#   reading sources... [ 44%] server_api/rest/builds
# Loaded extensions:
#   sphinx.ext.mathjax (2.1.0) from /usr/local/lib64/python3.7/site-packages/sphinx/ext/mathjax.py
#   sphinxcontrib.applehelp (1.0.1) from /usr/local/lib/python3.7/site-packages/sphinxcontrib/applehelp/__init__.py
#   sphinxcontrib.devhelp (1.0.1) from /usr/local/lib/python3.7/site-packages/sphinxcontrib/devhelp/__init__.py
#   sphinxcontrib.htmlhelp (1.0.2) from /usr/local/lib/python3.7/site-packages/sphinxcontrib/htmlhelp/__init__.py
#   sphinxcontrib.serializinghtml (1.1.3) from /usr/local/lib/python3.7/site-packages/sphinxcontrib/serializinghtml/__init__.py
#   sphinxcontrib.qthelp (1.0.2) from /usr/local/lib/python3.7/site-packages/sphinxcontrib/qthelp/__init__.py
#   alabaster (0.7.12) from /usr/local/lib/python3.7/site-packages/alabaster/__init__.py
#   cornice_sphinx (unknown version) from /usr/local/lib/python3.7/site-packages/cornice_sphinx/__init__.py
#   sphinx.ext.autodoc (2.1.0) from /usr/local/lib64/python3.7/site-packages/sphinx/ext/autodoc/__init__.py
#   sphinx.ext.autosummary (2.1.0) from /usr/local/lib64/python3.7/site-packages/sphinx/ext/autosummary/__init__.py
#   sphinx.ext.coverage (2.1.0) from /usr/local/lib64/python3.7/site-packages/sphinx/ext/coverage.py
#   sphinx.ext.extlinks (2.1.0) from /usr/local/lib64/python3.7/site-packages/sphinx/ext/extlinks.py
#   sphinx.ext.napoleon (2.1.0) from /usr/local/lib64/python3.7/site-packages/sphinx/ext/napoleon/__init__.py
#   sphinx.ext.todo (2.1.0) from /usr/local/lib64/python3.7/site-packages/sphinx/ext/todo.py
#   sphinx.ext.viewcode (2.1.0) from /usr/local/lib64/python3.7/site-packages/sphinx/ext/viewcode.py
Traceback (most recent call last):
  File "/usr/local/lib64/python3.7/site-packages/sphinx/cmd/build.py", line 284, in build_main
    app.build(args.force_all, filenames)
  File "/usr/local/lib64/python3.7/site-packages/sphinx/application.py", line 345, in build
    self.builder.build_update()
  File "/usr/local/lib64/python3.7/site-packages/sphinx/builders/__init__.py", line 319, in build_update
    len(to_build))
  File "/usr/local/lib64/python3.7/site-packages/sphinx/builders/__init__.py", line 332, in build
    updated_docnames = set(self.read())
  File "/usr/local/lib64/python3.7/site-packages/sphinx/builders/__init__.py", line 438, in read
    self._read_serial(docnames)
  File "/usr/local/lib64/python3.7/site-packages/sphinx/builders/__init__.py", line 460, in _read_serial
    self.read_doc(docname)
  File "/usr/local/lib64/python3.7/site-packages/sphinx/builders/__init__.py", line 504, in read_doc
    doctree = read_doc(self.app, self.env, self.env.doc2path(docname))
  File "/usr/local/lib64/python3.7/site-packages/sphinx/io.py", line 325, in read_doc
    pub.publish()
  File "/usr/local/lib/python3.7/site-packages/docutils/core.py", line 217, in publish
    self.settings)
  File "/usr/local/lib64/python3.7/site-packages/sphinx/io.py", line 113, in read
    self.parse()
  File "/usr/local/lib/python3.7/site-packages/docutils/readers/__init__.py", line 78, in parse
    self.parser.parse(self.input, document)
  File "/usr/local/lib64/python3.7/site-packages/sphinx/parsers.py", line 94, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 171, in run
    input_source=document['source'])
  File "/usr/local/lib/python3.7/site-packages/docutils/statemachine.py", line 239, in run
    context, state, transitions)
  File "/usr/local/lib/python3.7/site-packages/docutils/statemachine.py", line 460, in check_line
    return method(match, context, next_state)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2753, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 395, in new_subsection
    node=section_node, match_titles=True)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 282, in nested_parse
    node=node, match_titles=match_titles)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/local/lib/python3.7/site-packages/docutils/statemachine.py", line 239, in run
    context, state, transitions)
  File "/usr/local/lib/python3.7/site-packages/docutils/statemachine.py", line 460, in check_line
    return method(match, context, next_state)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2326, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2338, in explicit_construct
    return method(self, expmatch)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2081, in directive
    directive_class, match, type_name, option_presets)
  File "/usr/local/lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2130, in run_directive
    result = directive_instance.run()
  File "/usr/local/lib/python3.7/site-packages/cornice_sphinx/__init__.py", line 101, in run
    return [self._render_service(s) for s in services]
  File "/usr/local/lib/python3.7/site-packages/cornice_sphinx/__init__.py", line 101, in <listcomp>
    return [self._render_service(s) for s in services]
  File "/usr/local/lib/python3.7/site-packages/cornice_sphinx/__init__.py", line 216, in _render_service
    DocFieldTransformer(self).transform_all(node)
  File "/usr/local/lib64/python3.7/site-packages/sphinx/util/docfields.py", line 252, in __init__
    self.typemap = directive.get_field_type_map()
AttributeError: 'ServiceDirective' object has no attribute 'get_field_type_map'
@bowlofeggs bowlofeggs added the bug label Jun 6, 2019
bowlofeggs added a commit to bowlofeggs/bodhi that referenced this issue Jun 6, 2019
Sphinx 2.1.0 does not work with cornice_sphinx[0]. This is causing
our CI to fail, but fixing it is not easy. For now, we are going
to install an older Sphinx until we can figure out what to do to
work with Sphinx >= 2.1.0.

re fedora-infra#3300

[0] Cornices/cornice.ext.sphinx#22

Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
mergify bot pushed a commit to fedora-infra/bodhi that referenced this issue Jun 6, 2019
Sphinx 2.1.0 does not work with cornice_sphinx[0]. This is causing
our CI to fail, but fixing it is not easy. For now, we are going
to install an older Sphinx until we can figure out what to do to
work with Sphinx >= 2.1.0.

re #3300

[0] Cornices/cornice.ext.sphinx#22

Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
mattiaverga pushed a commit to mattiaverga/bodhi that referenced this issue Jun 10, 2019
Sphinx 2.1.0 does not work with cornice_sphinx[0]. This is causing
our CI to fail, but fixing it is not easy. For now, we are going
to install an older Sphinx until we can figure out what to do to
work with Sphinx >= 2.1.0.

re fedora-infra#3300

[0] Cornices/cornice.ext.sphinx#22

Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
@Natim Natim closed this as completed in #26 Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant