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

1.4.4: issues on building module and documentation #364

Closed
kloczek opened this issue Jan 17, 2023 · 5 comments
Closed

1.4.4: issues on building module and documentation #364

kloczek opened this issue Jan 17, 2023 · 5 comments

Comments

@kloczek
Copy link

kloczek commented Jan 17, 2023

  • aiosmtpd/docs is included in generated .whl archive
Archive:  /home/tkloczko/rpmbuild/BUILD/aiosmtpd-1.4.4/dist/aiosmtpd-1.4.4-py3-none-any.whl
 Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
--------  ------  ------- ---- ---------- ----- --------  ----
     633  Defl:N      327  48% 01-17-2023 10:42 edbb888e  aiosmtpd/__init__.py
     155  Defl:N      134  14% 01-17-2023 10:42 2f067cf0  aiosmtpd/__main__.py
   18846  Defl:N     5285  72% 01-17-2023 10:42 44428795  aiosmtpd/controller.py
    8752  Defl:N     2729  69% 01-17-2023 10:42 19b5fb8a  aiosmtpd/handlers.py
     724  Defl:N      347  52% 01-17-2023 10:42 5df15299  aiosmtpd/lmtp.py
    9527  Defl:N     2949  69% 01-17-2023 10:42 28b8388e  aiosmtpd/main.py
   17402  Defl:N     5068  71% 01-17-2023 10:42 a1e45118  aiosmtpd/proxy_protocol.py
      68  Defl:N       70  -3% 01-17-2023 10:42 3413f128  aiosmtpd/py.typed
   59999  Defl:N    15402  74% 01-17-2023 10:42 b1159579  aiosmtpd/smtp.py
       7  Defl:N        9 -29% 01-17-2023 10:42 da584abe  aiosmtpd/docs/.gitignore
    6770  Defl:N     1859  73% 01-17-2023 10:42 882657b7  aiosmtpd/docs/Makefile
   13040  Defl:N     5323  59% 01-17-2023 10:42 ce6ed8b3  aiosmtpd/docs/NEWS.rst
     227  Defl:N      168  26% 01-17-2023 10:42 43830cd9  aiosmtpd/docs/RTD-requirements.txt
       0  Defl:N        2   0% 01-17-2023 10:42 00000000  aiosmtpd/docs/__init__.py
    7410  Defl:N     2746  63% 01-17-2023 10:42 644cc411  aiosmtpd/docs/auth.rst
    1253  Defl:N      647  48% 01-17-2023 10:42 1e50a05d  aiosmtpd/docs/cli.rst
    5802  Defl:N     2118  64% 01-17-2023 10:42 c31c6e06  aiosmtpd/docs/concepts.rst
   10162  Defl:N     3820  62% 01-17-2023 15:04 ae1f1e9b  aiosmtpd/docs/conf.py
   24993  Defl:N     7812  69% 01-17-2023 10:42 f0a443dc  aiosmtpd/docs/controller.rst
   14378  Defl:N     4503  69% 01-17-2023 10:42 bfab7783  aiosmtpd/docs/handlers.rst
     312  Defl:N      193  38% 01-17-2023 10:42 062cf260  aiosmtpd/docs/index.rst
    1864  Defl:N      833  55% 01-17-2023 10:42 5075235d  aiosmtpd/docs/intro.rst
     620  Defl:N      369  41% 01-17-2023 10:42 acd1fc5c  aiosmtpd/docs/lmtp.rst
     608  Defl:N      387  36% 01-17-2023 10:42 27c8656b  aiosmtpd/docs/manpage.rst
    2129  Defl:N      834  61% 01-17-2023 10:42 4efb8ab9  aiosmtpd/docs/migrating.rst
   16707  Defl:N     5518  67% 01-17-2023 10:42 4520c34b  aiosmtpd/docs/proxyprotocol.rst
   19251  Defl:N     6512  66% 01-17-2023 10:42 e7f4e5ab  aiosmtpd/docs/smtp.rst
    5020  Defl:N     1649  67% 01-17-2023 10:42 09edaded  aiosmtpd/docs/testing.rst
   11707  Defl:N     3605  69% 01-17-2023 10:42 835bc49f  aiosmtpd/docs/_exts/autoprogramm.py
    1243  Defl:N      481  61% 01-17-2023 10:42 4cc6bf70  aiosmtpd/docs/_static/aiosmtpd.css
[..]

This can be fixed by move aiosmtpd/docs to docs/

  • documentation build fail
    First of all looks like in conf.py is missing add path to the aiosmtpd tree so I've added patch
--- a/aiosmtpd/docs/conf.py
+++ b/aiosmtpd/docs/conf.py
@@ -16,6 +16,8 @@
 import datetime
 import sphinx_rtd_theme  # noqa: F401 # pytype: disable=import-error
 import sys
+import os
+sys.path.insert(0, os.path.abspath("../.."))

 from pathlib import Path

But even with that it is not possible to build documentation

+ /usr/bin/sphinx-build -n -T -b man aiosmtpd/docs build/sphinx/man
Running Sphinx v5.3.0
Inserting /home/tkloczko/rpmbuild/BUILD/aiosmtpd-1.4.4
Inserting /home/tkloczko/rpmbuild/BUILD/aiosmtpd-1.4.4/aiosmtpd/docs/_exts
Inserting /home/tkloczko/rpmbuild/BUILD/aiosmtpd-1.4.4/aiosmtpd
making output directory... done
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 14 added, 0 changed, 0 removed
reading sources... [ 71%] manpage
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/aiosmtpd-1.4.4/aiosmtpd/docs/_exts/autoprogramm.py", line 158, in import_object
    mod = __import__(module_name)
  File "/home/tkloczko/rpmbuild/BUILD/aiosmtpd-1.4.4/aiosmtpd/main.py", line 16, in <module>
    from public import public
ModuleNotFoundError: No module named 'public'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/cmd/build.py", line 281, in build_main
    app.build(args.force_all, args.filenames)
  File "/usr/lib/python3.8/site-packages/sphinx/application.py", line 347, in build
    self.builder.build_update()
  File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 307, in build_update
    self.build(['__all__'], to_build)
  File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 326, in build
    updated_docnames = set(self.read())
  File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 433, in read
    self._read_serial(docnames)
  File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 454, in _read_serial
    self.read_doc(docname)
  File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 510, in read_doc
    publisher.publish()
  File "/usr/lib/python3.8/site-packages/docutils/core.py", line 224, in publish
    self.document = self.reader.read(self.source, self.parser,
  File "/usr/lib/python3.8/site-packages/sphinx/io.py", line 104, in read
    self.parse()
  File "/usr/lib/python3.8/site-packages/docutils/readers/__init__.py", line 76, in parse
    self.parser.parse(self.input, document)
  File "/usr/lib/python3.8/site-packages/sphinx/parsers.py", line 78, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 169, in run
    results = StateMachineWS.run(self, input_lines, input_offset,
  File "/usr/lib/python3.8/site-packages/docutils/statemachine.py", line 233, in run
    context, next_state, result = self.check_line(
  File "/usr/lib/python3.8/site-packages/docutils/statemachine.py", line 445, in check_line
    return method(match, context, next_state)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 3024, in text
    self.section(title.lstrip(), source, style, lineno + 1, messages)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 325, in section
    self.new_subsection(title, lineno, messages)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 391, in new_subsection
    newabsoffset = self.nested_parse(
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 279, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/lib/python3.8/site-packages/docutils/statemachine.py", line 233, in run
    context, next_state, result = self.check_line(
  File "/usr/lib/python3.8/site-packages/docutils/statemachine.py", line 445, in check_line
    return method(match, context, next_state)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2785, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 325, in section
    self.new_subsection(title, lineno, messages)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 391, in new_subsection
    newabsoffset = self.nested_parse(
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 279, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/lib/python3.8/site-packages/docutils/statemachine.py", line 233, in run
    context, next_state, result = self.check_line(
  File "/usr/lib/python3.8/site-packages/docutils/statemachine.py", line 445, in check_line
    return method(match, context, next_state)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2355, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2367, in explicit_construct
    return method(self, expmatch)
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2104, in directive
    return self.run_directive(
  File "/usr/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2154, in run_directive
    result = directive_instance.run()
  File "/home/tkloczko/rpmbuild/BUILD/aiosmtpd-1.4.4/aiosmtpd/docs/_exts/autoprogramm.py", line 294, in run
    for line in self.make_rst():
  File "/home/tkloczko/rpmbuild/BUILD/aiosmtpd-1.4.4/aiosmtpd/docs/_exts/autoprogramm.py", line 209, in make_rst
    parser = import_object(import_name or "__undefined__")
  File "/home/tkloczko/rpmbuild/BUILD/aiosmtpd-1.4.4/aiosmtpd/docs/_exts/autoprogramm.py", line 181, in import_object
    raise ImportError("No module named {}".format(module_name))
ImportError: No module named aiosmtpd.main

Exception occurred:
  File "/home/tkloczko/rpmbuild/BUILD/aiosmtpd-1.4.4/aiosmtpd/docs/_exts/autoprogramm.py", line 181, in import_object
    raise ImportError("No module named {}".format(module_name))
ImportError: No module named aiosmtpd.main
The full traceback has been saved in /tmp/sphinx-err-v4kv9ql8.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 <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
@pepoluan
Copy link
Collaborator

pepoluan commented Jan 18, 2023

Hmm, that is strange. Because one of the steps for GitHub Actions -- which is run on every commit to master -- is to build the documentation, and so far it always passes. I also can run the tox qa in my Windows laptop, and it passes as well.

Have you installed all docs dependencies as listed in aiosmtpd/docs/RTD-requirements.txt ?

Because I noted you have this error: ModuleNotFoundError: No module named 'public'

(You might want to install colorama as well to get nice colored Sphinx output.)

Basically, just follow the steps as listed in tox.ini or the steps in GitHub Actions

@pepoluan
Copy link
Collaborator

  • aiosmtpd/docs is included in generated .whl archive

As for this, docs will be excluded from .whl after PR #363 is merged. Likely not earlier than 1.5.0 milestone.

@dvzrv
Copy link
Contributor

dvzrv commented Jan 18, 2023

Isn't this a duplicate of #356?

@pepoluan
Copy link
Collaborator

Isn't this a duplicate of #356?

The first part, yes.

The second part, the part starting from "documentation build fail", wherein building docs failed, no.

@webknjaz
Copy link
Member

webknjaz commented Mar 4, 2024

It fails for manpages that were never supported. Nothing actionable.

@webknjaz webknjaz closed this as not planned Won't fix, can't repro, duplicate, stale Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants