[build-system] requires = ["flit_core>=3.7"] build-backend = "flit_core.buildapi" # project metadata [project] name = "Sphinx" description = "Python documentation generator" readme = "README.rst" urls.Changelog = "https://www.sphinx-doc.org/en/master/changes.html" urls.Code = "https://github.com/sphinx-doc/sphinx" urls.Download = "https://pypi.org/project/Sphinx/" urls.Homepage = "https://www.sphinx-doc.org/" urls."Issue tracker" = "https://github.com/sphinx-doc/sphinx/issues" license.text = "BSD-2-Clause" requires-python = ">=3.9" # Classifiers list: https://pypi.org/classifiers/ classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Environment :: Web Environment", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: End Users/Desktop", "Intended Audience :: Science/Research", "Intended Audience :: System Administrators", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Framework :: Sphinx", "Framework :: Sphinx :: Domain", "Framework :: Sphinx :: Extension", "Framework :: Sphinx :: Theme", "Topic :: Documentation", "Topic :: Documentation :: Sphinx", "Topic :: Internet :: WWW/HTTP :: Site Management", "Topic :: Printing", "Topic :: Software Development", "Topic :: Software Development :: Documentation", "Topic :: Text Processing", "Topic :: Text Processing :: General", "Topic :: Text Processing :: Indexing", "Topic :: Text Processing :: Markup", "Topic :: Text Processing :: Markup :: HTML", "Topic :: Text Processing :: Markup :: LaTeX", "Topic :: Utilities", ] dependencies = [ "sphinxcontrib-applehelp", "sphinxcontrib-devhelp", "sphinxcontrib-jsmath", "sphinxcontrib-htmlhelp>=2.0.0", "sphinxcontrib-serializinghtml>=1.1.9", "sphinxcontrib-qthelp", "Jinja2>=3.1", "Pygments>=2.17", "docutils>=0.20,<0.22", "snowballstemmer>=2.2", "babel>=2.13", "alabaster~=0.7.14", "imagesize>=1.3", "requests>=2.30.0", "packaging>=23.0", "importlib-metadata>=6.0; python_version < '3.10'", "tomli>=2; python_version < '3.11'", "colorama>=0.4.6; sys_platform == 'win32'", ] dynamic = ["version"] [project.optional-dependencies] docs = [ "sphinxcontrib-websupport", ] lint = [ "flake8>=6.0", "ruff==0.5.2", "mypy==1.10.1", "sphinx-lint>=0.9", "types-docutils==0.21.0.20240711", "types-requests>=2.30.0", # align with requests "importlib-metadata>=6.0", # for mypy (Python<=3.9) "tomli>=2", # for mypy (Python<=3.10) "pytest>=6.0", ] test = [ "pytest>=8.0", "defusedxml>=0.7.1", # for secure XML/HTML parsing "cython>=3.0", "setuptools>=70.0", # for Cython compilation "typing_extensions>=4.9", # for typing_extensions.Unpack ] [[project.authors]] name = "Georg Brandl" email = "georg@python.org" [project.scripts] sphinx-build = "sphinx.cmd.build:main" sphinx-quickstart = "sphinx.cmd.quickstart:main" sphinx-apidoc = "sphinx.ext.apidoc:main" sphinx-autogen = "sphinx.ext.autosummary.generate:main" [tool.flit.module] name = "sphinx" [tool.flit.sdist] include = [ "LICENSE.rst", "AUTHORS.rst", "CHANGES.rst", # Documentation "doc/", "CODE_OF_CONDUCT.rst", # used as an include in the Documentation "EXAMPLES.rst", # used as an include in the Documentation # Tests "tests/", "tox.ini", # Utilities "utils/", "babel.cfg", ] exclude = [ "doc/_build", ] [tool.mypy] files = ["sphinx", "utils", "tests"] exclude = [ "tests/certs", "tests/js", "tests/roots", # tests/ "^tests/test_events\\.py$", "^tests/test_quickstart\\.py$", "^tests/test_search\\.py$", "^tests/test_versioning\\.py$", # tests/test_builders "^tests/test_builders/test_build_dirhtml\\.py$", "^tests/test_builders/test_build_epub\\.py$", "^tests/test_builders/test_builder\\.py$", "^tests/test_builders/test_build_gettext\\.py$", "^tests/test_builders/test_build_html\\.py$", "^tests/test_builders/test_build_latex\\.py$", "^tests/test_builders/test_build_texinfo\\.py$", # tests/test_config "^tests/test_config/test_config\\.py$", # tests/test_directives "^tests/test_directives/test_directive_object_description\\.py$", "^tests/test_directives/test_directive_only\\.py$", "^tests/test_directives/test_directive_other\\.py$", "^tests/test_directives/test_directive_patch\\.py$", # tests/test_domains "^tests/test_domains/test_domain_c\\.py$", "^tests/test_domains/test_domain_cpp\\.py$", "^tests/test_domains/test_domain_js\\.py$", "^tests/test_domains/test_domain_py\\.py$", "^tests/test_domains/test_domain_py_fields\\.py$", "^tests/test_domains/test_domain_py_pyfunction\\.py$", "^tests/test_domains/test_domain_py_pyobject\\.py$", "^tests/test_domains/test_domain_rst\\.py$", "^tests/test_domains/test_domain_std\\.py$", # tests/test_environment "^tests/test_environment/test_environment_toctree\\.py$", # tests/test_extensions "^tests/test_extensions/test_ext_apidoc\\.py$", "^tests/test_extensions/test_ext_autodoc\\.py$", "^tests/test_extensions/test_ext_autodoc_autofunction\\.py$", "^tests/test_extensions/test_ext_autodoc_events\\.py$", "^tests/test_extensions/test_ext_autodoc_mock\\.py$", "^tests/test_extensions/test_ext_autosummary\\.py$", "^tests/test_extensions/test_ext_doctest\\.py$", "^tests/test_extensions/test_ext_inheritance_diagram\\.py$", "^tests/test_extensions/test_ext_intersphinx\\.py$", "^tests/test_extensions/test_ext_napoleon\\.py$", "^tests/test_extensions/test_ext_napoleon_docstring\\.py$", # tests/test_intl "^tests/test_intl/test_intl\\.py$", # tests/test_markup "^tests/test_markup/test_markup\\.py$", # tests/test_pycode "^tests/test_pycode/test_pycode\\.py$", "^tests/test_pycode/test_pycode_ast\\.py$", # tests/test_theming # tests/test_transforms "^tests/test_transforms/test_transforms_move_module_targets\\.py$", "^tests/test_transforms/test_transforms_post_transforms\\.py$", # tests/test_util "^tests/test_util/test_util_fileutil\\.py$", "^tests/test_util/test_util_i18n\\.py$", "^tests/test_util/test_util_inspect\\.py$", "^tests/test_util/test_util_logging\\.py$", "^tests/test_util/test_util_nodes\\.py$", "^tests/test_util/test_util_rst\\.py$", "^tests/test_util/test_util_template\\.py$", "^tests/test_util/test_util_typing\\.py$", "^tests/test_util/typing_test_data\\.py$", # tests/test_writers ] check_untyped_defs = true disallow_incomplete_defs = true python_version = "3.9" show_column_numbers = true show_error_context = true strict_optional = true warn_redundant_casts = true warn_unused_configs = true warn_unused_ignores = true disallow_any_generics = true extra_checks = true enable_error_code = [ "type-arg", "redundant-self", "truthy-iterable", "ignore-without-code", "unused-awaitable", ] disable_error_code = [ "import-untyped", ] [[tool.mypy.overrides]] module = [ "sphinx.domains.c", "sphinx.domains.c._ast", "sphinx.domains.c._parser", "sphinx.domains.c._symbol", "sphinx.domains.cpp", "sphinx.domains.cpp._ast", "sphinx.domains.cpp._parser", "sphinx.domains.cpp._symbol", ] strict_optional = false [[tool.mypy.overrides]] module = [ "sphinx.application", "sphinx.cmd.quickstart", "sphinx.config", "sphinx.domains", "sphinx.domains.c", "sphinx.domains.cpp", "sphinx.events", "sphinx.ext.autodoc", "sphinx.ext.autodoc.directive", "sphinx.ext.autodoc.importer", "sphinx.ext.autosummary.generate", "sphinx.ext.doctest", "sphinx.ext.graphviz", "sphinx.ext.inheritance_diagram", "sphinx.ext.intersphinx._load", "sphinx.ext.napoleon.docstring", "sphinx.highlighting", "sphinx.jinja2glue", "sphinx.registry", "sphinx.search", "sphinx.util", "sphinx.util.docfields", "sphinx.util.docutils", "sphinx.util.i18n", "sphinx.util.inspect", "sphinx.util.logging", "sphinx.util.parallel", "sphinx.util.template", ] disallow_any_generics = false [tool.pytest.ini_options] minversion = "6.0" addopts = [ "-ra", "--import-mode=prepend", # "--pythonwarnings=error", "--strict-config", "--strict-markers", ] empty_parameter_set_mark = "xfail" filterwarnings = [ "all", "ignore::DeprecationWarning:docutils.io", "ignore:Distutils was imported before Setuptools:UserWarning:_distutils_hack", "ignore:Setuptools is replacing distutils:UserWarning:_distutils_hack", "ignore::DeprecationWarning:pyximport.pyximport", "ignore::ImportWarning:importlib._bootstrap", ] log_cli_level = "INFO" markers = [ "apidoc", ] testpaths = ["tests"] xfail_strict = true [tool.coverage.run] branch = true parallel = true source = ['sphinx'] [tool.coverage.report] exclude_lines = [ # Have to re-enable the standard pragma 'pragma: no cover', # Don't complain if tests don't hit defensive assertion code: 'raise NotImplementedError', # Don't complain if non-runnable code isn't run: 'if __name__ == .__main__.:', ] ignore_errors = true