conf.py 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # -*- coding: utf-8 -*-
  2. import os
  3. import sys
  4. from datetime import date
  5. # If extensions (or modules to document with autodoc) are in another directory,
  6. # add these directories to sys.path here. If the directory is relative to the
  7. # documentation root, use os.path.abspath to make it absolute, like shown here.
  8. root_path = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
  9. sys.path.insert(0, root_path)
  10. # Mock some expensive/platform-specific modules so build will work.
  11. # (https://read-the-docs.readthedocs.io/en/latest/faq.html#\
  12. # i-get-import-errors-on-libraries-that-depend-on-c-modules)
  13. import mock
  14. class MockModule(mock.Mock):
  15. @classmethod
  16. def __getattr__(cls, name):
  17. return MockModule()
  18. MOCK_MODULES = ("ntlm",)
  19. sys.modules.update((mod_name, MockModule()) for mod_name in MOCK_MODULES)
  20. import urllib3
  21. # -- General configuration -----------------------------------------------------
  22. # Add any Sphinx extension module names here, as strings. They can be extensions
  23. # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
  24. extensions = [
  25. "sphinx.ext.autodoc",
  26. "sphinx.ext.doctest",
  27. "sphinx.ext.intersphinx",
  28. ]
  29. # Test code blocks only when explicitly specified
  30. doctest_test_doctest_blocks = ""
  31. # Add any paths that contain templates here, relative to this directory.
  32. templates_path = ["_templates"]
  33. # The suffix of source filenames.
  34. source_suffix = ".rst"
  35. # The master toctree document.
  36. master_doc = "index"
  37. # General information about the project.
  38. project = "urllib3"
  39. copyright = "{year}, Andrey Petrov".format(year=date.today().year)
  40. # The short X.Y version.
  41. version = urllib3.__version__
  42. # The full version, including alpha/beta/rc tags.
  43. release = version
  44. # List of patterns, relative to source directory, that match files and
  45. # directories to ignore when looking for source files.
  46. exclude_patterns = ["_build"]
  47. # The name of the Pygments (syntax highlighting) style to use.
  48. pygments_style = "friendly"
  49. # The theme to use for HTML and HTML Help pages. See the documentation for
  50. # a list of builtin themes.
  51. html_theme = "furo"
  52. html_favicon = "images/favicon.png"
  53. html_static_path = ["_static"]
  54. html_theme_options = {
  55. "announcement": """
  56. <a style=\"text-decoration: none; color: white;\"
  57. href=\"https://github.com/sponsors/urllib3\">
  58. <img src=\"/en/latest/_static/favicon.png\"/> Support urllib3 on GitHub Sponsors
  59. </a>
  60. """,
  61. "sidebar_hide_name": True,
  62. "light_logo": "banner.svg",
  63. "dark_logo": "dark-logo.svg",
  64. }
  65. intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}