Skip to content

Commit

Permalink
Fix doc build
Browse files Browse the repository at this point in the history
  • Loading branch information
drew2a committed Mar 9, 2022
1 parent d43b9ce commit 8e27c71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
10 changes: 4 additions & 6 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,20 @@
# pylint: disable=wrong-import-position
root_dir = os.path.abspath(os.path.join(os.path.dirname(__name__), '..'))
tribler_components = [
os.path.join(root_dir, "src", "pyipv8"),
os.path.join(root_dir, "src", "anydex"),
os.path.join(root_dir, "src", "tribler-core"),
os.path.join(root_dir, "src", "tribler-gui"),
os.path.join(root_dir, "src", "tribler"),
os.path.join(root_dir, "doc"),
]
for component in tribler_components:
sys.path.append(str(component))

from tribler_core.utilities.dependencies import Scope, get_dependencies
from tribler_core.utilities.patch_import import patch_import
from tribler.core.utilities.dependencies import Scope, get_dependencies
from tribler.core.utilities.patch_import import patch_import

modules_to_mock = set(get_dependencies(scope=Scope.core)) | {'libtorrent', 'validate'}

with patch_import(modules=modules_to_mock):
from tribler_core.components.restapi.rest.root_endpoint import RootEndpoint
from tribler.core.components.restapi.rest.root_endpoint import RootEndpoint
add_endpoint = RootEndpoint.add_endpoint
RootEndpoint.add_endpoint = lambda self, path, ep: add_endpoint(self, path, ep) \
if path not in ['/ipv8', '/market', '/wallets'] else None
Expand Down
6 changes: 3 additions & 3 deletions doc/extract_swagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

import yaml

from tribler_core.components.restapi.rest.rest_manager import ApiKeyMiddleware, RESTManager, error_middleware
from tribler_core.components.restapi.rest.root_endpoint import RootEndpoint
from tribler_core.config.tribler_config import TriblerConfig
from tribler.core.components.restapi.rest.rest_manager import ApiKeyMiddleware, RESTManager, error_middleware
from tribler.core.components.restapi.rest.root_endpoint import RootEndpoint
from tribler.core.config.tribler_config import TriblerConfig


async def extract_swagger(destination_fn):
Expand Down

0 comments on commit 8e27c71

Please sign in to comment.