Skip to content

Maintenance: Remove sphinx-build-compatibility #595

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
32 changes: 0 additions & 32 deletions src/crate/theme/rtd/conf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,35 +209,6 @@

def setup(app):

def setup_sphinx_compatibility():
"""
Resolve problem with `sphinx_build_compatibility` extension.

Add Sphinx extension at runtime, in order to be able to configure it previously.
This is needed because it has some quirks that reveal themselves when invoked in
non-RTD environments.

- https://github.com/crate/crate-docs-theme/issues/536
- https://about.readthedocs.com/blog/2024/07/addons-by-default/
- https://github.com/readthedocs/sphinx-build-compatibility
"""

# Extension error (sphinx_build_compatibility.extension):
# Handler <function manipulate_config at 0x10a4289a0> for event 'config-inited' threw an exception
# (exception: argument of type 'NoneType' is not iterable)
os.environ.setdefault("READTHEDOCS_GIT_CLONE_URL", "")

# IndexError: list index out of range
# project_id = response_project["results"][0]["id"]
# Currently needs a valid project on PyPI. Long-term fix should go into upstream code.
os.environ.setdefault("READTHEDOCS_PROJECT", "crate-docs-theme")

# Exception: 'NoneType' object is not subscriptable
os.environ.setdefault("READTHEDOCS_GIT_COMMIT_HASH", "")

# Register vendorized Sphinx plugin.
app.setup_extension("crate.theme.vendor.rtd_compat.extension")

# Configure Sphinx/RTD to host projects on a custom domain, but also on a non-root resource.
def configure_self_hosted_on_path(app_inited):
"""
Expand Down Expand Up @@ -331,9 +302,6 @@ def apply_html_context_custom(app_inited):
except Exception as ex:
print(f"ERROR: Unable to adjust `html_context`. Reason: {ex}")

# Read The Docs compatibility issues.
setup_sphinx_compatibility()

# Modern / NG / Furo.
app.require_sphinx("3.0")
app.connect("html-page-context", _html_page_context)
Expand Down
Empty file removed src/crate/theme/vendor/__init__.py
Empty file.
Empty file.
213 changes: 0 additions & 213 deletions src/crate/theme/vendor/rtd_compat/extension.py

This file was deleted.

55 changes: 0 additions & 55 deletions src/crate/theme/vendor/rtd_compat/utils.py

This file was deleted.