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

Fix documentation build issue #6329

Merged
merged 2 commits into from
Sep 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: doc/conf.py

build:
image: latest

# Include all submodules
submodules:
include: all

python:
version: "3.8"
xoriole marked this conversation as resolved.
Show resolved Hide resolved
install:
- requirements: doc/requirements.txt
16 changes: 9 additions & 7 deletions doc/extract_swagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@
import aiohttp

from tribler_core.config.tribler_config import TriblerConfig
from tribler_core.restapi.rest_manager import RESTManager
from tribler_core.restapi.rest_manager import ApiKeyMiddleware, error_middleware, RESTManager
from tribler_core.restapi.root_endpoint import RootEndpoint

import yaml


async def extract_swagger(destination_fn):
session = Mock()
session.config = TriblerConfig()
session.config.api.key = 'apikey'
session.config.api.http_enabled = False
session.config.api.https_enabled = False
api_manager = RESTManager(session)
config = TriblerConfig()
config.api.key = 'apikey'
config.api.http_enabled = False
config.api.https_enabled = False

root_endpoint = RootEndpoint(config, middlewares=[ApiKeyMiddleware(config.api.key), error_middleware])
api_manager = RESTManager(config=config.api, root_endpoint=root_endpoint, state_dir=config.state_dir)
await api_manager.start()

fp = StringIO()
Expand Down