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

Sphinx-doc conflicts with Pony #6099

Closed
ichorid opened this issue May 5, 2021 · 3 comments
Closed

Sphinx-doc conflicts with Pony #6099

ichorid opened this issue May 5, 2021 · 3 comments
Assignees

Comments

@ichorid
Copy link
Contributor

ichorid commented May 5, 2021

Importing Pony's OperationalError causes sphinx-doc to fail:

+ cd tribler/doc
+ sphinx-build . _build/html -W -v
Running Sphinx v2.3.1

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/sphinx/config.py", line 368, in eval_config_file
    execfile_(filename, namespace)
  File "/usr/local/lib/python3.7/dist-packages/sphinx/util/pycompat.py", line 81, in execfile_
    exec(code, _globals)
  File "/home/jenkins/ci/workspace/GH_Tribler_PR_Tests/PR_build_docs/tribler/doc/conf.py", line 63, in <module>
    from tribler_core.restapi.root_endpoint import RootEndpoint
  File "/home/jenkins/ci/workspace/GH_Tribler_PR_Tests/PR_build_docs/tribler/src/tribler-core/tribler_core/restapi/root_endpoint.py", line 8, in <module>
    from tribler_core.modules.metadata_store.restapi.channels_endpoint import ChannelsEndpoint
  File "/home/jenkins/ci/workspace/GH_Tribler_PR_Tests/PR_build_docs/tribler/src/tribler-core/tribler_core/modules/metadata_store/restapi/channels_endpoint.py", line 20, in <module>
    from tribler_core.modules.metadata_store.community.gigachannel_community import NoChannelSourcesException
  File "/home/jenkins/ci/workspace/GH_Tribler_PR_Tests/PR_build_docs/tribler/src/tribler-core/tribler_core/modules/metadata_store/community/gigachannel_community.py", line 15, in <module>
    from tribler_core.modules.metadata_store.community.remote_query_community import (
  File "/home/jenkins/ci/workspace/GH_Tribler_PR_Tests/PR_build_docs/tribler/src/tribler-core/tribler_core/modules/metadata_store/community/remote_query_community.py", line 12, in <module>
    from pony.orm.dbapiprovider import OperationalError
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 963, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 906, in _find_spec
  File "<frozen importlib._bootstrap_external>", line 1280, in find_spec
  File "<frozen importlib._bootstrap_external>", line 1246, in _get_spec
TypeError: 'Mock' object is not iterable
@ichorid ichorid added this to the 7.10.0 May milestone May 5, 2021
@devos50
Copy link
Contributor

devos50 commented May 6, 2021

We are mocking the imports to be able to extract the API documentation, see here. You most likely have to add pony.orm.dbapiprovider to this list 👍

@ichorid ichorid modified the milestones: 7.10.0 May, Next-next release May 25, 2021
kozlovsky added a commit to kozlovsky/tribler that referenced this issue May 28, 2021
@xoriole
Copy link
Contributor

xoriole commented Jul 14, 2021

Currently, build is success for sphinx version: 2.3.1 so the original issue is fixed. However, sphinx-build is failing for the latest version: 4.1.0

Traceback (most recent call last):
  File "/home/sysadmin/tudelft/tribler/venv/lib/python3.8/site-packages/sphinx/cmd/build.py", line 280, in build_main
    app.build(args.force_all, filenames)
  File "/home/sysadmin/tudelft/tribler/venv/lib/python3.8/site-packages/sphinx/application.py", line 343, in build
    self.builder.build_update()
  File "/home/sysadmin/tudelft/tribler/venv/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 293, in build_update
    self.build(to_build,
  File "/home/sysadmin/tudelft/tribler/venv/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 307, in build
    updated_docnames = set(self.read())
  File "/usr/lib/python3.8/contextlib.py", line 120, in __exit__
    next(self.gen)
  File "/home/sysadmin/tudelft/tribler/venv/lib/python3.8/site-packages/sphinx/util/logging.py", line 213, in pending_warnings
    memhandler.flushTo(logger)
  File "/home/sysadmin/tudelft/tribler/venv/lib/python3.8/site-packages/sphinx/util/logging.py", line 178, in flushTo
    logger.handle(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 1599, in handle
    self.callHandlers(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 1661, in callHandlers
    hdlr.handle(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 950, in handle
    rv = self.filter(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 811, in filter
    result = f.filter(record)
  File "/home/sysadmin/tudelft/tribler/venv/lib/python3.8/site-packages/sphinx/util/logging.py", line 423, in filter
    raise exc
sphinx.errors.SphinxWarning: <openapi>:1:Problem in http domain: field is supposed to use role 'obj', but that role is not in the domain.

Warning, treated as error:
<openapi>:1:Problem in http domain: field is supposed to use role 'obj', but that role is not in the domain.

@drew2a drew2a modified the milestones: Next-next release, Backlog Sep 15, 2021
@xoriole
Copy link
Contributor

xoriole commented Sep 20, 2021

Documentation build is fixed with this PR: #6329

@xoriole xoriole closed this as completed Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants