bitprophet / releases

A powerful Sphinx changelog-generating extension.
http://releases.readthedocs.io/
BSD 2-Clause "Simplified" License
177 stars 41 forks source link

1.6.3: issue with man page generation using sphinx #96

Open kloczek opened 3 years ago

kloczek commented 3 years ago

Just found that I'm not able to generate man page in sphinx-theme-alabaster python module (https://github.com/bitprophet/alabaster/)

+ sphinx-build -b man -d sphinx-theme-alabaster docs .
Running Sphinx v3.5.3
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 4 added, 0 changed, 0 removed
reading sources... [ 25%] changelog
Extension error (releases):
Handler <function generate_changelog at 0x7f85d9b5eee0> for event 'doctree-read' threw an exception (exception: Call either Version('1.2.3') or Version(major=1, ...).)
kloczek commented 3 years ago

ping .. Just tested that with latest sphinx and it still fails

+ /usr/bin/python3 setup.py build_sphinx -b man --build-dir build/sphinx
running build_sphinx
Running Sphinx v4.1.1
making output directory... done
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 4 added, 0 changed, 0 removed
reading sources... [ 25%] changelog
Extension error (releases):
Handler <function generate_changelog at 0x7fca0f4949d0> for event 'doctree-read' threw an exception (exception: Call either Version('1.2.3') or Version(major=1, ...).)
kloczek commented 2 years ago

Gentle ping 😄 Updated output with latest sphinx

+ /usr/bin/sphinx-build -n -T -b man docs build/sphinx/man
Running Sphinx v4.5.0
making output directory... done
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 4 added, 0 changed, 0 removed
reading sources... [ 25%] changelog
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/events.py", line 94, in emit
    results.append(listener.handler(self.app, *args))
  File "/home/tkloczko/rpmbuild/BUILD/releases-1.6.3/releases/__init__.py", line 612, in generate_changelog
    doctree.walk(changelog_visitor)
  File "/usr/lib/python3.8/site-packages/docutils/nodes.py", line 191, in walk
    if child.walk(visitor):
  File "/usr/lib/python3.8/site-packages/docutils/nodes.py", line 191, in walk
    if child.walk(visitor):
  File "/usr/lib/python3.8/site-packages/docutils/nodes.py", line 183, in walk
    visitor.dispatch_visit(self)
  File "/usr/lib/python3.8/site-packages/docutils/nodes.py", line 2021, in dispatch_visit
    return method(node)
  File "/home/tkloczko/rpmbuild/BUILD/releases-1.6.3/releases/__init__.py", line 595, in visit_bullet_list
    releases, _ = construct_releases(node.children, self.app)
  File "/home/tkloczko/rpmbuild/BUILD/releases-1.6.3/releases/__init__.py", line 521, in construct_releases
    construct_entry_without_release(focus, issues, manager, log, rest)
  File "/home/tkloczko/rpmbuild/BUILD/releases-1.6.3/releases/__init__.py", line 405, in construct_entry_without_release
    focus.add_to_manager(manager)
  File "/home/tkloczko/rpmbuild/BUILD/releases-1.6.3/releases/models.py", line 136, in add_to_manager
    families = [Version(str(x)) for x in manager]
  File "/home/tkloczko/rpmbuild/BUILD/releases-1.6.3/releases/models.py", line 136, in <listcomp>
    families = [Version(str(x)) for x in manager]
  File "/home/tkloczko/rpmbuild/BUILD/releases-1.6.3/releases/models.py", line 14, in __init__
    super(Version, self).__init__(version_string, partial)
  File "/usr/lib/python3.8/site-packages/semantic_version/base.py", line 102, in __init__
    raise ValueError("Call either Version('1.2.3') or Version(major=1, ...).")
ValueError: Call either Version('1.2.3') or Version(major=1, ...).

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

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/cmd/build.py", line 276, in build_main
    app.build(args.force_all, filenames)
  File "/usr/lib/python3.8/site-packages/sphinx/application.py", line 330, in build
    self.builder.build_update()
  File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 283, in build_update
    self.build(['__all__'], to_build)
  File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 300, in build
    updated_docnames = set(self.read())
  File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 407, in read
    self._read_serial(docnames)
  File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 428, in _read_serial
    self.read_doc(docname)
  File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 468, in read_doc
    doctree = read_doc(self.app, self.env, self.env.doc2path(docname))
  File "/usr/lib/python3.8/site-packages/sphinx/io.py", line 181, in read_doc
    pub.publish()
  File "/usr/lib/python3.8/site-packages/docutils/core.py", line 219, in publish
    self.apply_transforms()
  File "/usr/lib/python3.8/site-packages/docutils/core.py", line 200, in apply_transforms
    self.document.transformer.apply_transforms()
  File "/usr/lib/python3.8/site-packages/sphinx/transforms/__init__.py", line 79, in apply_transforms
    super().apply_transforms()
  File "/usr/lib/python3.8/site-packages/docutils/transforms/__init__.py", line 171, in apply_transforms
    transform.apply(**kwargs)
  File "/usr/lib/python3.8/site-packages/sphinx/transforms/__init__.py", line 380, in apply
    self.app.emit('doctree-read', self.document)
  File "/usr/lib/python3.8/site-packages/sphinx/application.py", line 440, in emit
    return self.events.emit(event, *args, allowed_exceptions=allowed_exceptions)
  File "/usr/lib/python3.8/site-packages/sphinx/events.py", line 102, in emit
    raise ExtensionError(__("Handler %r for event %r threw an exception") %
sphinx.errors.ExtensionError: Handler <function generate_changelog at 0x7f508fc20b80> for event 'doctree-read' threw an exception (exception: Call either Version('1.2.3') or Version(major=1, ...).)

Extension error (releases):
Handler <function generate_changelog at 0x7f508fc20b80> for event 'doctree-read' threw an exception (exception: Call either Version('1.2.3') or Version(major=1, ...).)
kloczek commented 1 year ago

Just tested 2.1.1 and sphinx 7.0.1 still fails in releases code

```console + /usr/bin/sphinx-build -n -T -b man docs build/sphinx/man Running Sphinx v7.0.1 making output directory... done building [mo]: targets for 0 po files that are out of date writing output... building [man]: all manpages updating environment: [new config] 4 added, 0 changed, 0 removed reading sources... [100%] usage looking for now-outdated files... none found pickling environment... done checking consistency... done writing... python--releases.3 { concepts usage changelog } /home/tkloczko/rpmbuild/BUILD/releases-2.1.1/docs/changelog.rst:5: WARNING: unknown node type: failed Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/sphinx/cmd/build.py", line 285, in build_main app.build(args.force_all, args.filenames) File "/usr/lib/python3.8/site-packages/sphinx/application.py", line 351, in build self.builder.build_update() File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 291, in build_update self.build(['__all__'], to_build) File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 361, in build self.write(docnames, list(updated_docnames), method) File "/usr/lib/python3.8/site-packages/sphinx/util/display.py", line 85, in wrapper return f(*args, **kwargs) File "/usr/lib/python3.8/site-packages/sphinx/builders/manpage.py", line 101, in write docwriter.write(largetree, destination) File "/usr/lib/python3.8/site-packages/docutils/writers/__init__.py", line 80, in write self.translate() File "/usr/lib/python3.8/site-packages/sphinx/writers/manpage.py", line 33, in translate self.document.walkabout(visitor) File "/usr/lib/python3.8/site-packages/docutils/nodes.py", line 186, in walkabout if child.walkabout(visitor): File "/usr/lib/python3.8/site-packages/docutils/nodes.py", line 186, in walkabout if child.walkabout(visitor): File "/usr/lib/python3.8/site-packages/docutils/nodes.py", line 186, in walkabout if child.walkabout(visitor): [Previous line repeated 6 more times] File "/usr/lib/python3.8/site-packages/docutils/nodes.py", line 199, in walkabout visitor.dispatch_departure(self) File "/usr/lib/python3.8/site-packages/sphinx/util/docutils.py", line 592, in dispatch_departure super().dispatch_departure(node) File "/usr/lib/python3.8/site-packages/docutils/nodes.py", line 2019, in dispatch_departure return method(node) File "/usr/lib/python3.8/site-packages/docutils/nodes.py", line 2041, in unknown_departure raise NotImplementedError( NotImplementedError: departing unknown node type: Release Exception occurred: File "/usr/lib/python3.8/site-packages/docutils/nodes.py", line 2041, in unknown_departure raise NotImplementedError( NotImplementedError: departing unknown node type: Release The full traceback has been saved in /tmp/sphinx-err-jpts2bcv.log, if you want to report the issue to the developers. Please also report this if it was a user error, so that a better error message can be provided next time. A bug report can be filed in the tracker at . Thanks! ``` ```console [tkloczko@pers-jacek build]$ cat /tmp/sphinx-err-jpts2bcv.log # Platform: linux; (Linux-6.3.8-200.fc38.x86_64-x86_64-with-glibc2.34) # Sphinx version: 7.0.1 # Python version: 3.8.17 (CPython) # Docutils version: 0.20.1 # Jinja2 version: 3.1.2 # Pygments version: 2.16.0 # Last messages: # done # checking consistency... # done # writing... # python--releases.3 { # concepts # usage # changelog # } # failed # Loaded extensions: # sphinx.ext.mathjax (7.0.1) # alabaster (0.7.13) # sphinxcontrib.applehelp (1.0.4) # sphinxcontrib.devhelp (1.0.2) # sphinxcontrib.htmlhelp (2.0.3) # sphinxcontrib.serializinghtml (1.1.9) # sphinxcontrib.qthelp (1.0.3) # releases (2.1.1) # Traceback: Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/sphinx/cmd/build.py", line 285, in build_main app.build(args.force_all, args.filenames) File "/usr/lib/python3.8/site-packages/sphinx/application.py", line 351, in build self.builder.build_update() File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 291, in build_update self.build(['__all__'], to_build) File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 361, in build self.write(docnames, list(updated_docnames), method) File "/usr/lib/python3.8/site-packages/sphinx/util/display.py", line 85, in wrapper return f(*args, **kwargs) File "/usr/lib/python3.8/site-packages/sphinx/builders/manpage.py", line 101, in write docwriter.write(largetree, destination) File "/usr/lib/python3.8/site-packages/docutils/writers/__init__.py", line 80, in write self.translate() File "/usr/lib/python3.8/site-packages/sphinx/writers/manpage.py", line 33, in translate self.document.walkabout(visitor) File "/usr/lib/python3.8/site-packages/docutils/nodes.py", line 186, in walkabout if child.walkabout(visitor): File "/usr/lib/python3.8/site-packages/docutils/nodes.py", line 186, in walkabout if child.walkabout(visitor): File "/usr/lib/python3.8/site-packages/docutils/nodes.py", line 186, in walkabout if child.walkabout(visitor): [Previous line repeated 6 more times] File "/usr/lib/python3.8/site-packages/docutils/nodes.py", line 199, in walkabout visitor.dispatch_departure(self) File "/usr/lib/python3.8/site-packages/sphinx/util/docutils.py", line 592, in dispatch_departure super().dispatch_departure(node) File "/usr/lib/python3.8/site-packages/docutils/nodes.py", line 2019, in dispatch_departure return method(node) File "/usr/lib/python3.8/site-packages/docutils/nodes.py", line 2041, in unknown_departure raise NotImplementedError( NotImplementedError: departing unknown node type: Release ```