diff --git a/.readthedocs.yml b/.readthedocs.yml index 6ce9308f2b..442f3089ec 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -19,16 +19,22 @@ build: tools: python: "3.10" apt_packages: + - graphviz - libkrb5-dev + - python3-pydot - python3-rpm - python3-librepo jobs: post_install: - - pip install rpm + - pip install sqlalchemy-schemadisplay rpm - dpkg -L python3-librepo - ln -s /usr/lib/python3/dist-packages/librepo $READTHEDOCS_VIRTUALENV_PATH/lib/python3.10/site-packages/librepo - cp devel/development.ini.example bodhi-server/development.ini - python -c "import bodhi.server.models" + pre_build: + - mkdir -p docs/generated + - python docs/generate_db_schema + - python docs/generate_json_schema # commands: # - ./devel/ci/bodhi-ci docs -r pip # - mv test_results/pip-docs/html/ $READTHEDOCS_OUTPUT/ diff --git a/docs/generate_db_schema b/docs/generate_db_schema index a731f4a166..436663a8a3 100755 --- a/docs/generate_db_schema +++ b/docs/generate_db_schema @@ -2,6 +2,8 @@ """ Generate an image of the database schema """ +import os + from packaging import version from sqlalchemy import create_engine from sqlalchemy_schemadisplay import create_schema_graph @@ -13,6 +15,9 @@ except ImportError: from bodhi.server import models +DOCS_DIR = os.path.dirname(__file__) + + def write_graph(filename): if version.parse(sqlschemaver) >= version.parse('2.0'): graph = create_schema_graph( @@ -35,4 +40,4 @@ def write_graph(filename): if __name__ == '__main__': - write_graph('generated/database.png') + write_graph(f'{DOCS_DIR}/generated/database.png') diff --git a/news/PR5789.bug b/news/PR5789.bug new file mode 100644 index 0000000000..dcc2124d30 --- /dev/null +++ b/news/PR5789.bug @@ -0,0 +1 @@ +Bodhi documentation on RTD was missing some content generated by external scripts