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 Read the Docs build #1668

Merged
merged 2 commits into from
Sep 6, 2023
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
16 changes: 16 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3"

python:
install:
- method: pip
path: .
extra_requirements:
- develop

sphinx:
fail_on_warning: true
12 changes: 4 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
# serve to show the default.

import datetime
import os

import sphinx_rtd_theme

import elasticsearch_dsl

Expand Down Expand Up @@ -116,13 +117,8 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.

on_rtd = os.environ.get("READTHEDOCS", None) == "True"

if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme

html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ def lint(session):

@nox.session()
def docs(session):
session.install(".[develop]", "sphinx-rtd-theme")
session.install(".[develop]")

session.run("sphinx-build", "docs/", "docs/_build", "-b", "html")
session.run("sphinx-build", "docs/", "docs/_build", "-b", "html", "-W")
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@
"pytest-mock",
"pytz",
"coverage",
"sphinx",
"sphinx_rtd_theme",
# Override Read the Docs default (sphinx<2 and sphinx-rtd-theme<0.5)
"sphinx>2",
"sphinx-rtd-theme>0.5",
]

setup(
Expand Down