repo stringclasses 454
values | file_path stringlengths 5 201 | extension stringclasses 1
value | content stringlengths 8 509k | num_lines int64 3 16.9k | size_bytes int64 8 511k |
|---|---|---|---|---|---|
sphinx | tests/roots/test-ext-autodoc/target/classes.py | .py | from __future__ import annotations
from inspect import Parameter, Signature
from typing import List, Union # NoQA: UP035
class Foo:
pass
class Bar:
def __init__(self, x, y):
pass
class Baz:
def __new__(cls, x, y):
pass
class Qux:
__signature__ = Signature(
parameters=[
... | 50 | 728 |
sphinx | tests/roots/test-ext-autodoc/target/name_mangling.py | .py | class Foo:
#: name of Foo
__name = None
__age = None
class Bar(Foo):
__address = None
#: a member having mangled-like name
_Baz__email = None
| 12 | 169 |
sphinx | tests/roots/test-ext-autodoc/target/callable.py | .py | class Callable:
"""A callable object that behaves like a function."""
def __call__(self, arg1, arg2, **kwargs):
pass
def method(self, arg1, arg2):
"""docstring of Callable.method()."""
pass
function = Callable()
method = function.method
| 14 | 277 |
sphinx | tests/roots/test-ext-autodoc/target/private.py | .py | def private_function(name):
"""private_function is a docstring().
:meta private:
"""
def _public_function(name):
"""public_function is a docstring().
:meta public:
"""
PRIVATE_CONSTANT = None #: :meta private:
_PUBLIC_CONSTANT = None #: :meta public:
class Foo:
#: A public class at... | 29 | 557 |
sphinx | tests/roots/test-ext-autodoc/target/final.py | .py | from __future__ import annotations
import typing
from typing import final
import typing_extensions
from typing_extensions import final as final_ext # noqa: UP035
@typing.final
class Class:
"""docstring"""
@final
def meth1(self):
"""docstring"""
def meth2(self):
"""docstring"""
... | 28 | 453 |
sphinx | tests/roots/test-ext-autodoc/target/inherited_annotations.py | .py | """Test case for https://github.com/sphinx-doc/sphinx/issues/11387,
corner case involving inherited members with type annotations
on python 3.9 and earlier
"""
class HasTypeAnnotatedMember:
inherit_me: int
"""Inherited"""
class NoTypeAnnotation(HasTypeAnnotatedMember):
a = 1
"""Local"""
class NoTy... | 20 | 385 |
sphinx | tests/roots/test-ext-autodoc/target/overload.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING, overload
if TYPE_CHECKING:
from typing import Any
@overload
def sum(x: int, y: int = 0) -> int: ...
@overload
def sum(x: float, y: float = 0.0) -> float: ...
@overload
def sum(x: str, y: str = ...) -> str: ...
def sum(x, y=None):
"""... | 82 | 1,320 |
sphinx | tests/roots/test-ext-autodoc/target/preserve_defaults_special_constructs.py | .py | from __future__ import annotations
from collections import namedtuple
from dataclasses import dataclass, field
from typing import NamedTuple, TypedDict
#: docstring
SENTINEL = object()
#: docstring
ze_lambda = lambda z=SENTINEL: None # NoQA: E731
def foo(x, y, z=SENTINEL):
"""docstring"""
@dataclass
class ... | 55 | 952 |
sphinx | tests/roots/test-ext-autodoc/target/cached_property.py | .py | from functools import cached_property
class Foo:
@cached_property
def prop(self) -> int:
return 1
@cached_property
def prop_with_type_comment(self):
# type: () -> int
return 1
| 13 | 219 |
sphinx | tests/roots/test-ext-autodoc/target/abstractmethods.py | .py | from abc import abstractmethod
class Base:
def meth(self):
pass
@abstractmethod
def abstractmeth(self):
pass
@staticmethod
@abstractmethod
def staticmeth():
pass
@classmethod
@abstractmethod
def classmeth(cls):
pass
@property
@abstractmet... | 30 | 426 |
sphinx | tests/roots/test-ext-autodoc/target/empty_all.py | .py | """docsting of empty_all module."""
__all__ = []
def foo():
"""docstring"""
def bar():
"""docstring"""
def baz():
"""docstring"""
| 16 | 149 |
sphinx | tests/roots/test-ext-autodoc/target/partialmethod.py | .py | from functools import partialmethod
class Cell:
"""An example for partialmethod.
refs: https://docs.python.org/3/library/functools.html#functools.partialmethod
"""
def set_state(self, state):
"""Update state of cell to *state*."""
#: Make a cell alive.
set_alive = partialmethod(set_... | 18 | 421 |
sphinx | tests/roots/test-ext-autodoc/target/pep604.py | .py | from __future__ import annotations
attr: int | str #: docstring
def sum(x: int | str, y: int | str) -> int | str:
"""docstring"""
class Foo:
"""docstring"""
attr: int | str #: docstring
def meth(self, x: int | str, y: int | str) -> int | str:
"""docstring"""
| 17 | 292 |
sphinx | tests/roots/test-ext-autodoc/target/slots.py | .py | class Foo:
"""docstring"""
__slots__ = ['attr']
class Bar:
"""docstring"""
__slots__ = {
'attr1': 'docstring of attr1',
'attr2': 'docstring of attr2',
'attr3': None,
}
__annotations__ = {'attr1': int}
def __init__(self):
self.attr2 = None #: docstring of... | 25 | 410 |
sphinx | tests/roots/test-ext-autodoc/target/_functions_to_import.py | .py | from typing import TYPE_CHECKING, Optional
if TYPE_CHECKING:
from sphinx.application import Sphinx
def function_to_be_imported(app: Optional['Sphinx']) -> str:
"""docstring"""
| 9 | 187 |
sphinx | tests/roots/test-ext-autodoc/target/literal.py | .py | from __future__ import annotations
from enum import Enum
from typing import Literal, TypeVar
class MyEnum(Enum):
a = 1
b = 2
T = TypeVar('T', bound=Literal[1234, 'abcd'])
"""docstring"""
U = TypeVar('U', bound=Literal[MyEnum.a, MyEnum.b])
"""docstring"""
def bar(x: Literal[1234, 'abcd']):
"""docstr... | 26 | 390 |
sphinx | tests/roots/test-ext-autodoc/target/overload2.py | .py | from target.overload import Bar
class Baz(Bar):
pass
| 6 | 59 |
sphinx | tests/roots/test-ext-autodoc/target/docstring_signature.py | .py | class A:
"""A(foo, bar)"""
class B:
"""B(foo, bar)"""
def __init__(self):
"""B(foo, bar, baz)"""
class C:
"""C(foo, bar)"""
def __new__(cls):
"""C(foo, bar, baz)"""
class D:
def __init__(self):
"""D(foo, bar, baz)"""
class E:
def __init__(self):
r"""... | 36 | 672 |
sphinx | tests/roots/test-ext-autodoc/target/canonical/original.py | .py | class Foo:
"""docstring"""
def meth(self):
"""docstring"""
def bar():
class Bar:
"""docstring"""
return Bar
Bar = bar()
| 16 | 158 |
sphinx | tests/roots/test-ext-autodoc/target/name_conflict/__init__.py | .py | from .foo import bar
class foo:
"""docstring of target.name_conflict::foo."""
pass
| 8 | 94 |
sphinx | tests/roots/test-ext-autodoc/target/name_conflict/foo.py | .py | class bar:
"""docstring of target.name_conflict.foo::bar."""
| 3 | 65 |
sphinx | tests/roots/test-local-logo/conf.py | .py | latex_documents = [
(
'index',
'test.tex',
'The basic Sphinx documentation for testing',
'Sphinx',
'report',
)
]
html_logo = 'images/img.png'
| 11 | 190 |
sphinx | tests/roots/test-ext-graphviz/conf.py | .py | extensions = ['sphinx.ext.graphviz']
exclude_patterns = ['_build']
html_static_path = ['_static']
| 4 | 98 |
sphinx | tests/roots/test-search/conf.py | .py | exclude_patterns = ['_build']
html_search_language = 'en'
| 3 | 58 |
sphinx | tests/roots/test-extensions/read_serial.py | .py | def setup(app):
return {
'parallel_read_safe': False,
}
| 5 | 72 |
sphinx | tests/roots/test-extensions/read_parallel.py | .py | def setup(app):
return {
'parallel_read_safe': True,
}
| 5 | 71 |
sphinx | tests/roots/test-extensions/conf.py | .py | import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd().resolve()))
| 5 | 83 |
sphinx | tests/roots/test-extensions/write_parallel.py | .py | def setup(app):
return {
'parallel_write_safe': True,
}
| 5 | 72 |
sphinx | tests/roots/test-extensions/write_serial.py | .py | def setup(app):
return {
'parallel_write_safe': False,
}
| 5 | 73 |
sphinx | tests/roots/test-linkcheck/conf.py | .py | root_doc = 'links'
exclude_patterns = ['_build']
linkcheck_anchors = True
linkcheck_timeout = 0.25
| 5 | 99 |
sphinx | tests/roots/test-util-copyasset_overwrite/myext.py | .py | from pathlib import Path
from sphinx.util.fileutil import copy_asset
def _copy_asset_overwrite_hook(app):
css = app.outdir / '_static' / 'custom-styles.css'
# html_static_path is copied by default
css_content = css.read_text(encoding='utf-8')
assert css_content == '/* html_static_path */\n', 'invalid... | 25 | 823 |
sphinx | tests/roots/test-util-copyasset_overwrite/conf.py | .py | import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd().resolve()))
extensions = ['myext']
html_static_path = ['user_static']
html_theme = 'basic'
| 9 | 163 |
sphinx | tests/roots/test-html_entity/conf.py | .py | html_theme = 'classic'
exclude_patterns = ['_build']
| 3 | 53 |
sphinx | tests/roots/test-latex-includegraphics/conf.py | .py | exclude_patterns = ['_build']
latex_elements = {
'preamble': r"""
\makeatletter
\def\dividetwolengths#1#2{\the\dimexpr
\numexpr65536*\dimexpr#1\relax/\dimexpr#2\relax sp}%
\newwrite\out
\immediate\openout\out=\jobname-dimensions.txt
\def\toout{\immediate\write\out}
\def\getWfromoptions #1width=#2,#3\relax{\def... | 48 | 1,573 |
sphinx | tests/roots/test-ext_static_dir/conf.py | .py | import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd().resolve()))
project = 'Test Extension Static Dir'
extensions = ['staticdirext']
| 8 | 152 |
sphinx | tests/roots/test-ext_static_dir/staticdirext/__init__.py | .py | """Test extension that registers a static directory."""
from pathlib import Path
HERE = Path(__file__).resolve().parent
def setup(app):
app.add_static_dir(HERE / 'static')
app.add_js_file('js/myext.js')
app.add_css_file('css/myext.css')
return {
'version': '1.0',
'parallel_read_safe'... | 17 | 371 |
sphinx | tests/roots/test-need-escaped/conf.py | .py | project = 'need <b>"escaped"</b> project'
smartquotes = False
| 3 | 62 |
sphinx | tests/roots/test-remote-logo/conf.py | .py | latex_documents = [
(
'index',
'test.tex',
'The basic Sphinx documentation for testing',
'Sphinx',
'report',
)
]
html_logo = 'https://www.python.org/static/img/python-logo.png'
html_favicon = 'https://www.python.org/static/favicon.ico'
| 12 | 284 |
sphinx | tests/roots/test-ext-viewcode-find/conf.py | .py | extensions = ['sphinx.ext.viewcode']
exclude_patterns = ['_build']
viewcode_follow_imported_members = False
| 4 | 108 |
sphinx | tests/roots/test-ext-viewcode-find/not_a_package/submodule.py | .py | """
submodule
""" # NoQA: D212
raise RuntimeError('This module should not get imported') # NoQA: EM101,TRY003
def decorator(f):
return f
@decorator
def func1(a, b):
"""
this is func1
""" # NoQA: D212
return a, b
@decorator
class Class1:
"""this is Class1"""
class Class3:
"""this ... | 30 | 403 |
sphinx | tests/roots/test-ext-doctest-with-autodoc/conf.py | .py | import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd().resolve()))
project = 'test project for doctest + autodoc reporting'
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest']
| 8 | 199 |
sphinx | tests/roots/test-ext-autosummary-recursive/conf.py | .py | import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd().resolve()))
extensions = ['sphinx.ext.autosummary']
autosummary_generate = True
| 8 | 152 |
sphinx | tests/roots/test-ext-autosummary-recursive/package/module_importfail.py | .py | # Fail module import in a catastrophic way
raise SystemExit(1)
| 3 | 63 |
sphinx | tests/roots/test-ext-autosummary-recursive/package/module.py | .py | from os import * # NoQA: F403
class Foo:
def __init__(self):
pass
def bar(self):
pass
@property
def baz(self):
pass
| 14 | 161 |
sphinx | tests/roots/test-ext-autosectionlabel-prefix-document/conf.py | .py | extensions = ['sphinx.ext.autosectionlabel']
autosectionlabel_prefix_document = True
| 3 | 85 |
sphinx | tests/roots/test-latex-numfig/conf.py | .py | extensions = ['sphinx.ext.imgmath'] # for math_numfig
latex_documents = [
('indexmanual', 'SphinxManual.tex', 'Test numfig manual', 'Sphinx', 'manual'),
('indexhowto', 'SphinxHowTo.tex', 'Test numfig howto', 'Sphinx', 'howto'),
]
| 7 | 240 |
sphinx | tests/roots/test-directive-only/conf.py | .py | project = 'test-directive-only'
exclude_patterns = ['_build']
| 3 | 62 |
sphinx | tests/roots/test-config/conf.py | .py | project = 'Sphinx <Tests>'
release = '0.6alpha1'
templates_path = ['_templates']
| 4 | 81 |
sphinx | tests/roots/test-html_style/conf.py | .py | html_style = 'default.css'
html_static_path = ['_static']
| 3 | 58 |
sphinx | tests/roots/test-versioning/conf.py | .py | project = 'versioning test root'
source_suffix = {
'.txt': 'restructuredtext',
}
exclude_patterns = ['_build']
| 6 | 115 |
sphinx | tests/roots/test-latex-title/conf.py | .py | # set empty string to the third column to use the first section title to document title
latex_documents = [
('index', 'test.tex', '', 'Sphinx', 'report'),
]
| 5 | 161 |
sphinx | tests/roots/test-intl/conf.py | .py | project = 'Sphinx intl <Tests>'
source_suffix = {
'.txt': 'restructuredtext',
}
keep_warnings = True
templates_path = ['_templates']
html_additional_pages = {'contents': 'contents.html'}
release = version = '2013.120'
gettext_additional_targets = ['index']
exclude_patterns = ['_build']
| 11 | 291 |
sphinx | tests/roots/test-theming/conf.py | .py | html_theme = 'test-theme'
html_theme_path = ['.', 'test_theme']
exclude_patterns = ['_build']
| 4 | 94 |
sphinx | tests/roots/test-latex-babel/conf.py | .py | numfig_format = {
'figure': 'Fig. %s',
'table': 'Table. %s',
'code-block': 'List.',
}
| 6 | 98 |
sphinx | tests/roots/test-image-in-section/conf.py | .py | exclude_patterns = ['_build']
rst_epilog = """
.. |picture| image:: pic.png
:width: 15pt
:height: 15pt
:alt: alternative_text
"""
| 9 | 143 |
sphinx | tests/roots/test-toctree-empty/conf.py | .py | exclude_patterns = ['_build']
templates_path = ['_templates']
| 3 | 62 |
sphinx | tests/roots/test-ext-doctest-fail-fast/conf.py | .py | extensions = ['sphinx.ext.doctest']
project = 'test project for doctest'
root_doc = 'fail-fast'
source_suffix = {
'.txt': 'restructuredtext',
}
exclude_patterns = ['_build']
# Set in tests.
# doctest_fail_fast = ...
| 12 | 222 |
sphinx | tests/roots/test-linkcheck-localserver-warn-redirects/conf.py | .py | exclude_patterns = ['_build']
linkcheck_timeout = 0.25
| 3 | 55 |
sphinx | tests/roots/test-ext-math-compat/conf.py | .py | from docutils import nodes
from docutils.parsers.rst import Directive
extensions = ['sphinx.ext.mathjax']
def my_math_role(role, rawtext, text, lineno, inliner, options={}, content=[]): # NoQA: B006
text = 'E = mc^2'
return [nodes.math(text, text)], []
class MyMathDirective(Directive):
def run(self):
... | 21 | 502 |
sphinx | tests/roots/test-ext-autosummary-skip-member/conf.py | .py | import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd().resolve()))
extensions = ['sphinx.ext.autosummary']
autosummary_generate = True
autodoc_default_options = {'members': True}
def skip_member(app, what, name, obj, skip, options):
if name == 'skipmeth':
return True
elif name == '_pr... | 21 | 439 |
sphinx | tests/roots/test-ext-autosummary-skip-member/target.py | .py | class Foo:
"""docstring of Foo."""
def meth(self):
"""docstring of meth."""
pass
def skipmeth(self):
"""docstring of skipmeth."""
pass
def _privatemeth(self):
"""docstring of _privatemeth."""
pass
| 15 | 264 |
sphinx | tests/roots/test-warnings/autodoc_fodder.py | .py | class MarkupError:
""".. note:: This is a docstring with a
small markup error which should have
correct location information.
"""
| 6 | 146 |
sphinx | tests/roots/test-ext-ifconfig/conf.py | .py | extensions = ['sphinx.ext.ifconfig']
exclude_patterns = ['_build']
confval1 = True
def setup(app):
app.add_config_value('confval1', False, None)
app.add_config_value('confval2', False, None)
app.add_config_value('false_config', False, None)
| 11 | 256 |
sphinx | tests/roots/test-latex-equations/conf.py | .py | root_doc = 'equations'
extensions = ['sphinx.ext.imgmath']
| 3 | 59 |
sphinx | tests/roots/test-ext-viewcode/conf.py | .py | import sys
from pathlib import Path
from sphinx.ext.linkcode import add_linkcode_domain
sys.path.insert(0, str(Path.cwd().resolve()))
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
exclude_patterns = ['_build']
if 'test_linkcode' in tags: # NoQA: F821 (tags is injected into conf.py)
extensions.rem... | 31 | 972 |
sphinx | tests/roots/test-ext-viewcode/spam/mod1.py | .py | """mod1"""
def decorator(f):
return f
@decorator
def func1(a, b):
"""this is func1"""
return a, b
@decorator
class Class1:
"""this is Class1"""
class Class3:
"""this is Class3"""
class_attr = 42
"""this is the class attribute class_attr"""
| 24 | 277 |
sphinx | tests/roots/test-ext-viewcode/spam/mod3.py | .py | from spam.mod1 import Class3
__all__ = ('Class3',)
| 4 | 52 |
sphinx | tests/roots/test-ext-viewcode/spam/mod2.py | .py | """mod2"""
def decorator(f):
return f
@decorator
def func2(a, b):
"""this is func2"""
return a, b
@decorator
class Class2:
"""this is Class2"""
| 17 | 166 |
sphinx | tests/roots/test-ext-doctest-skipif/conf.py | .py | extensions = ['sphinx.ext.doctest']
project = 'test project for the doctest :skipif: directive'
root_doc = 'skipif'
source_suffix = {
'.txt': 'restructuredtext',
}
exclude_patterns = ['_build']
doctest_global_setup = """
from tests.test_extensions.test_ext_doctest import record
record('doctest_global_setup', 'bo... | 19 | 416 |
sphinx | tests/roots/test-ext-doctest/conf.py | .py | extensions = ['sphinx.ext.doctest']
project = 'test project for doctest'
root_doc = 'doctest'
source_suffix = {
'.txt': 'restructuredtext',
}
exclude_patterns = ['_build']
| 9 | 177 |
sphinx | tests/roots/test-stylesheets/conf.py | .py | html_theme = 'classic'
templates_path = ['_templates']
def setup(app):
app.add_css_file('persistent.css')
app.add_css_file('default.css', title='Default')
app.add_css_file('alternate1.css', title='Alternate', rel='alternate stylesheet')
app.add_css_file('alternate2.css', rel='alternate stylesheet')
| 10 | 318 |
sphinx | tests/roots/test-markup-rubric/conf.py | .py | latex_documents = [
(
'index',
'test.tex',
'The basic Sphinx documentation for testing',
'Sphinx',
'report',
)
]
latex_toplevel_sectioning = 'section'
| 11 | 199 |
sphinx | tests/roots/test-basic/conf.py | .py | html_theme = 'basic'
latex_documents = [
(
'index',
'test.tex',
'The basic Sphinx documentation for testing',
'Sphinx',
'report',
)
]
| 11 | 182 |
sphinx | tests/roots/test-ext-extlinks-hardcoded-urls/conf.py | .py | extensions = ['sphinx.ext.extlinks']
extlinks = {'issue': ('https://github.com/sphinx-doc/sphinx/issues/%s', 'issue %s')}
extlinks_detect_hardcoded_links = True
| 4 | 161 |
sphinx | tests/roots/test-image-in-parsed-literal/conf.py | .py | exclude_patterns = ['_build']
rst_epilog = """
.. |picture| image:: pic.png
:height: 1cm
:scale: 200%
:align: middle
:alt: alternative_text
"""
| 10 | 161 |
sphinx | tests/roots/test-ext-inheritance_diagram/conf.py | .py | import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd().resolve()))
extensions = ['sphinx.ext.inheritance_diagram', 'sphinx.ext.intersphinx']
| 7 | 158 |
sphinx | tests/roots/test-ext-inheritance_diagram/test.py | .py | class Foo:
pass
class DocHere(Foo):
pass
class DocSubDir1(DocHere):
pass
class DocSubDir2(DocSubDir1):
pass
class DocMainLevel(Foo):
pass
class Alice(object): # NoQA: UP004
pass
| 23 | 213 |
sphinx | tests/roots/test-ext-inheritance_diagram/external/other.py | .py | from test import Alice
class Bob(Alice):
pass
| 6 | 52 |
sphinx | tests/roots/test-ext-inheritance_diagram/example/sphinx.py | .py | # example.sphinx
class DummyClass:
pass
| 6 | 46 |
sphinx | tests/roots/test-ext-napoleon/conf.py | .py | import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd().resolve()))
extensions = ['sphinx.ext.napoleon']
| 7 | 121 |
sphinx | tests/roots/test-ext-napoleon/mypackage/typehints.py | .py | def hello(x: int, *args: int, **kwargs: int) -> None:
"""Parameters
----------
x
X
*args
Additional arguments.
**kwargs
Extra arguments.
"""
| 11 | 189 |
sphinx | tests/roots/test-ext-autosummary-mock_imports/conf.py | .py | import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd().resolve()))
extensions = ['sphinx.ext.autosummary']
autosummary_generate = True
autosummary_mock_imports = ['unknown']
| 9 | 191 |
sphinx | tests/roots/test-ext-autosummary-mock_imports/foo.py | .py | import unknown
class Foo(unknown.Class):
"""Foo class"""
pass
| 8 | 73 |
sphinx | tests/roots/test-ext-autosummary-module_all/conf.py | .py | import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd().resolve()))
extensions = ['sphinx.ext.autosummary']
autosummary_generate = True
autosummary_ignore_module_all = False
| 9 | 190 |
sphinx | tests/roots/test-ext-autosummary-module_all/autosummary_dummy_package_all/__init__.py | .py | from .autosummary_dummy_module import Bar, PublicBar, foo, public_foo
def baz():
"""Baz function"""
pass
def public_baz():
"""Public Baz function"""
__all__ = ['PublicBar', 'public_foo', 'public_baz', 'extra_dummy_module'] # NoQA: F822
| 14 | 255 |
sphinx | tests/roots/test-ext-autosummary-module_all/autosummary_dummy_package_all/autosummary_dummy_module.py | .py | class Bar:
"""Bar class"""
pass
class PublicBar:
"""Public Bar class"""
pass
def foo():
"""Foo function"""
pass
def public_foo():
"""Public Foo function"""
pass
| 21 | 201 |
sphinx | tests/roots/test-ext-autosummary-module_prefix/conf.py | .py | import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd().resolve()))
extensions = [
'sphinx.ext.autosummary',
]
| 9 | 131 |
sphinx | tests/roots/test-directive-include/conf.py | .py | project = 'test-directive-include'
exclude_patterns = ['_build']
| 3 | 65 |
sphinx | tests/roots/test-ext-apidoc-trailing-underscore/package_/module_.py | .py | """A module with a trailing underscore"""
class SomeClass_:
"""A class with a trailing underscore"""
def some_function_(some_arg_):
"""A function with a trailing underscore in name and argument"""
| 10 | 209 |
sphinx | tests/roots/test-add_enumerable_node/enumerable_node.py | .py | from docutils import nodes
from docutils.parsers.rst import Directive
class my_figure(nodes.figure):
pass
def visit_my_figure(self, node):
self.visit_figure(node)
def depart_my_figure(self, node):
self.depart_figure(node)
class MyFigure(Directive):
required_arguments = 1
has_content = True
... | 65 | 1,453 |
sphinx | tests/roots/test-add_enumerable_node/conf.py | .py | import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd().resolve()))
extensions = ['enumerable_node']
numfig = True
| 9 | 132 |
sphinx | tests/roots/test-intl_substitution_definitions/conf.py | .py | exclude_patterns = ['_build']
rst_prolog = """\
.. |subst_prolog_1| replace:: prologue substitute text
.. |subst_prolog_2| image:: /img.png
"""
rst_epilog = """\
.. |subst_epilog_1| replace:: epilogue substitute text
.. |subst_epilog_2| image:: /i18n.png
"""
| 14 | 263 |
sphinx | tests/roots/test-maxlistdepth/conf.py | .py | exclude_patterns = ['_build']
latex_elements = {
'maxlistdepth': '10',
}
| 6 | 78 |
sphinx | tests/roots/test-copyright-multiline/conf.py | .py | copyright = (
'2006',
'2006-2009, Alice',
'2010-2013, Bob',
'2014-2017, Charlie',
'2018-2021, David',
'2022-2025, Eve',
)
html_theme = 'basic'
| 10 | 167 |
sphinx | tests/roots/test-add_source_parser/conf.py | .py | import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd().resolve()))
extensions = ['source_parser']
| 7 | 115 |
sphinx | tests/roots/test-ext-viewcode-find-package/conf.py | .py | import sys
from pathlib import Path
source_dir = str(Path.cwd().resolve())
if source_dir not in sys.path:
sys.path.insert(0, source_dir)
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
exclude_patterns = ['_build']
if 'test_linkcode' in tags: # NoQA: F821 (tags is injected into conf.py)
extension... | 25 | 815 |
sphinx | tests/roots/test-ext-viewcode-find-package/main_package/subpackage/__init__.py | .py | from main_package.subpackage._subpackage2 import submodule
__all__ = ['submodule']
| 4 | 84 |
sphinx | tests/roots/test-ext-viewcode-find-package/main_package/subpackage/_subpackage2/submodule.py | .py | """submodule"""
# raise RuntimeError('This module should not get imported')
def decorator(f):
return f
@decorator
def func1(a, b):
"""this is func1"""
return a, b
@decorator
class Class1:
"""this is Class1"""
class Class3:
"""this is Class3"""
class_attr = 42
"""this is the class at... | 25 | 342 |
sphinx | tests/roots/test-ext-autosummary-module_empty_all/conf.py | .py | import sys
from pathlib import Path
sys.path.insert(0, str(Path.cwd().resolve()))
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.autosummary']
autodoc_default_options = {'members': True}
autosummary_ignore_module_all = False
autosummary_imorted_members = False
templates_path = ['templates']
| 12 | 296 |
sphinx | tests/roots/test-ext-autosummary/autosummary_dummy_inherited_module.py | .py | from autosummary_dummy_module import Foo
class InheritedAttrClass(Foo):
def __init__(self):
#: other docstring
self.subclassattr = 'subclassattr'
super().__init__()
__all__ = ['InheritedAttrClass']
| 13 | 231 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.