ansys / ansys-sphinx-theme

PyData-based Sphinx theme from the PyAnsys community
https://sphinxdocs.ansys.com
MIT License
21 stars 5 forks source link

JSONDecodeError when running doc build #351

Closed SMoraisAnsys closed 3 months ago

SMoraisAnsys commented 3 months ago

🔍 Before submitting the issue

🐞 Description of the bug

When one tries to build the documentation, the function extract_example_links is called and it seems that the content of the request received is no longer decodable as JSON.

This is currently breaking the CICD for other PR (see https://github.com/ansys/ansys-sphinx-theme/pull/349)

📝 Steps to reproduce

Use the function in conf.py as follow:

import requests

def extract_example_links(
    archive_url: str, archive_base_url: str, exclude_files: List[str]
) -> List[str]:
    response = requests.get(archive_url)
    # Following call is triggering the error
    json_data = response.json()

URL_ARCHIVE = "https://github.com/executablebooks/sphinx-design/tree/main/docs/snippets/rst"
ARCHIVE_BASE_URL = f"https://raw.githubusercontent.com/executablebooks/sphinx-design/main/"
example_links = extract_example_links(
    URL_ARCHIVE, ARCHIVE_BASE_URL, exclude_files=["article-info.txt"]
)

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

No response

🐍 Which Python version are you using?

3.10

📦 Installed packages

Only  requests seems to be relevant here:
requests==2.31.0