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 schemas generation on RTD (backport #5789) #5792

Merged
merged 1 commit into from
Nov 11, 2024
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
8 changes: 7 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
7 changes: 6 additions & 1 deletion docs/generate_db_schema
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand All @@ -35,4 +40,4 @@ def write_graph(filename):


if __name__ == '__main__':
write_graph('generated/database.png')
write_graph(f'{DOCS_DIR}/generated/database.png')
1 change: 1 addition & 0 deletions news/PR5789.bug
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bodhi documentation on RTD was missing some content generated by external scripts