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
mamba
docs/source/conf.py
.py
# Configuration file for the Sphinx documentation builder. # # For the full list of built-in configuration values, see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master...
76
2,401
mamba
docs/source/tools/mermaid_inheritance.py
.py
r""" mermaid_inheritance ~~~~~~~~~~~~~~~~~~~ Modified by the CoSApp team from sphinx.ext.inheritance_diagram https://gitlab.com/cosapp/cosapp Defines a docutils directive for inserting inheritance diagrams. Provide the directive with one or more classes or modules (separated by whitespace)...
304
10,205
mamba
docs/source/tools/mermaid.py
.py
""" sphinx-mermaid ~~~~~~~~~~~~~~~ https://github.com/mgaitan/sphinxcontrib-mermaid Modified for the purpose of CoSApp by the CoSApp team https://gitlab.com/cosapp/cosapp Allow mermaid diagrams to be included in Sphinx-generated documents inline. :copyright: Copyright 2016 by Martín Gaitán and others, see AUTHORS. :...
396
12,683
mamba
libmambapy/tests/test_solver_libsolv.py
.py
import copy import json import pytest import libmambapy import libmambapy.solver.libsolv as libsolv def test_import_submodule(): import libmambapy.solver.libsolv as solv # Dummy execution _p = solv.Priorities def test_import_recursive(): import libmambapy as mamba # Dummy execution _p = ...
420
12,886
mamba
libmambapy/tests/test_legacy.py
.py
import libmambapy def test_context_instance_scoped(): ctx = libmambapy.Context() # Initialize and then terminate libmamba internals assert ctx is not None def test_context_no_log_nor_signal_handling(): ctx = libmambapy.Context( libmambapy.ContextOptions(enable_logging=False, enable_signal_handl...
28
952
mamba
libmambapy/tests/test_solver.py
.py
import random import copy import pytest import libmambapy def test_import_submodule(): import libmambapy.solver as solver # Dummy execution _r = solver.Request def test_import_recursive(): import libmambapy as mamba # Dummy execution _r = mamba.solver.Request @pytest.mark.parametrize( ...
347
10,199
mamba
libmambapy/tests/test_version.py
.py
import libmambapy def test_version(): assert isinstance(libmambapy.__version__, str) assert libmambapy.version.__version__ == libmambapy.__version__
7
159
mamba
libmambapy/tests/test_specs.py
.py
import copy import pytest import libmambapy def test_import_submodule(): import libmambapy.specs as specs # Dummy execution _p = specs.KnownPlatform.noarch def test_import_recursive(): import libmambapy as mamba # Dummy execution _p = mamba.specs.KnownPlatform.noarch def test_ParseErro...
1,006
31,348
mamba
libmambapy/tests/test_utils.py
.py
import copy import pytest import libmambapy def test_import_submodule(): import libmambapy.utils as utils # Dummy execution _p = utils.TextEmphasis def test_import_recursive(): import libmambapy as mamba # Dummy execution _p = mamba.utils.TextEmphasis def test_TextEmphasis(): TextE...
112
3,292
mamba
libmambapy/src/libmambapy/version.py
.py
version_info = ("2", "9", "0") version_prerelease = "" __version__ = ".".join(map(str, version_info)) if version_prerelease != "": __version__ = f"{__version__}.{version_prerelease}"
6
187
mamba
libmamba/data/bin2header.py
.py
# Modified from bin2array, https://github.com/Jamesits/bin2array # Distributed under MIT License: # MIT License # Copyright (c) 2017 James Swineson <github@public.swineson.me> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "So...
64
2,667
mamba
libmamba/data/compile_pyc.py
.py
import os import sys from compileall import compile_file from concurrent.futures import ProcessPoolExecutor def main(): max_workers = int(os.environ.get("MAMBA_EXTRACT_THREADS", "0")) if max_workers <= 0: max_workers = None results = [] with sys.stdin: with ProcessPoolExecutor(max_wor...
27
714
mamba
libmambapy-stubs/setup.py
.py
import os import sys import libmambapy import mypy.stubgen import setuptools import setuptools.command.build_py class build_py(setuptools.command.build_py.build_py): def run(self): """Generate stub files.""" options = mypy.stubgen.Options( pyversion=sys.version_info[:2], n...
49
1,314
sphinx
tests/utils.py
.py
from __future__ import annotations __all__ = ( 'http_server', 'extract_node', 'extract_element', ) import os import socket from contextlib import contextmanager from http.server import ThreadingHTTPServer from pathlib import Path from ssl import PROTOCOL_TLS_SERVER, SSLContext from threading import Thread...
188
5,980
sphinx
tests/test_errors.py
.py
from __future__ import annotations from sphinx.errors import ExtensionError def test_extension_error_repr() -> None: exc = ExtensionError('foo') assert repr(exc) == "ExtensionError('foo')" def test_extension_error_with_orig_exc_repr() -> None: exc = ExtensionError('foo', Exception('bar')) assert re...
14
373
sphinx
tests/test_versioning.py
.py
"""Test the versioning implementation.""" from __future__ import annotations import pickle import shutil import pytest from docutils.utils import DependencyList from sphinx.testing.util import SphinxTestApp from sphinx.versioning import add_uids, get_ratio, merge_doctrees TYPE_CHECKING = False if TYPE_CHECKING: ...
134
4,376
sphinx
tests/test_project.py
.py
"""Tests project module.""" from __future__ import annotations from pathlib import Path from typing import TYPE_CHECKING import pytest from sphinx.project import Project if TYPE_CHECKING: from sphinx.testing.util import SphinxTestApp DOCNAMES = { 'autodoc', 'bom', 'extapi', 'extensions', '...
107
3,099
sphinx
tests/test_application.py
.py
"""Test the Sphinx class.""" from __future__ import annotations import shutil import sys from io import StringIO from pathlib import Path from typing import TYPE_CHECKING from unittest.mock import Mock import pytest from docutils import nodes import sphinx.application from sphinx._cli.util.errors import strip_escap...
179
6,088
sphinx
tests/test_search.py
.py
"""Test the search index builder.""" from __future__ import annotations import json from io import BytesIO from typing import TYPE_CHECKING import pytest from docutils import frontend, utils from docutils.parsers import rst from sphinx.search import IndexBuilder from tests.utils import TESTS_ROOT if TYPE_CHECKING...
517
17,968
sphinx
tests/test_addnodes.py
.py
"""Test the non-trivial features in the :mod:`sphinx.addnodes` module.""" from __future__ import annotations from typing import TYPE_CHECKING import pytest from sphinx import addnodes if TYPE_CHECKING: from collections.abc import Iterator @pytest.fixture def sig_elements() -> Iterator[set[type[addnodes.desc_...
58
2,072
sphinx
tests/test_highlighting.py
.py
"""Test the Pygments highlighting bridge.""" from __future__ import annotations from typing import TYPE_CHECKING from unittest import mock import pygments import pytest from pygments.formatters.html import HtmlFormatter from pygments.lexer import RegexLexer from pygments.token import Name, Text from sphinx.highligh...
135
4,009
sphinx
tests/test_events.py
.py
"""Test the EventManager class.""" from __future__ import annotations from types import SimpleNamespace from typing import TYPE_CHECKING import pytest from sphinx.errors import ExtensionError from sphinx.events import EventManager if TYPE_CHECKING: from typing import NoReturn from sphinx.application impor...
67
2,161
sphinx
tests/test_quickstart.py
.py
"""Test the sphinx.quickstart module.""" from __future__ import annotations import time from io import StringIO from typing import TYPE_CHECKING import pytest from sphinx._cli.util.colour import disable_colour, enable_colour from sphinx.cmd import quickstart as qs from sphinx.testing.util import SphinxTestApp if T...
275
7,899
sphinx
tests/test_roles.py
.py
"""Test sphinx.roles""" from __future__ import annotations from unittest.mock import Mock import pytest from docutils import nodes from sphinx.roles import EmphasizedLiteral, _format_rfc_target from sphinx.testing.util import assert_node def test_samp() -> None: emph_literal_role = EmphasizedLiteral() # ...
140
3,751
sphinx
tests/test_command_line.py
.py
from __future__ import annotations import sys from pathlib import Path from typing import TYPE_CHECKING import pytest from sphinx._cli.util.errors import strip_escape_sequences from sphinx.cmd import make_mode from sphinx.cmd.build import get_parser from sphinx.cmd.make_mode import run_make_mode if TYPE_CHECKING: ...
238
6,160
sphinx
tests/conftest.py
.py
from __future__ import annotations import gettext import os import sys from pathlib import Path from types import SimpleNamespace from typing import TYPE_CHECKING import docutils import pytest import sphinx import sphinx.locale from sphinx.testing.util import _clean_up_global_state from tests.utils import TEST_ROOT...
104
2,774
sphinx
tests/roots/test-roles-download/conf.py
.py
latex_documents = [ ( 'index', 'test.tex', 'The basic Sphinx documentation for testing', 'Sphinx', 'report', ) ]
10
161
sphinx
tests/roots/test-latex-theme/conf.py
.py
latex_theme = 'custom' latex_theme_path = ['theme']
3
52
sphinx
tests/roots/test-environment-record-dependencies/conf.py
.py
import sys from pathlib import Path sys.path.insert(0, str(Path.cwd().resolve())) extensions = ['sphinx.ext.autodoc']
7
120
sphinx
tests/roots/test-environment-record-dependencies/example_module.py
.py
def example_function(): return 42
3
38
sphinx
tests/roots/test-domain-cpp-intersphinx/conf.py
.py
exclude_patterns = ['_build'] extensions = [ 'sphinx.ext.intersphinx', ]
5
77
sphinx
tests/roots/test-highlight_options/conf.py
.py
highlight_options = { 'default': {'default_option': True}, 'python': {'python_option': True}, }
5
104
sphinx
tests/roots/test-linkcheck-documents_exclude/conf.py
.py
exclude_patterns = ['_build'] linkcheck_exclude_documents = [ '^broken_link$', 'br[0-9]ken_link', ] linkcheck_timeout = 0.25
7
133
sphinx
tests/roots/test-directive-code/conf.py
.py
exclude_patterns = ['_build'] numfig = True
3
44
sphinx
tests/roots/test-directive-code/target.py
.py
# Literally included file using Python highlighting foo = 'Including Unicode characters: üöä' class Foo: pass class Bar: def baz(): pass # comment after Bar class definition def bar(): pass def block_start_with_comment(): # Comment return 1 def block_start_with_blank(): return 1 ...
32
360
sphinx
tests/roots/test-linkcheck-localserver-anchor/conf.py
.py
exclude_patterns = ['_build'] linkcheck_anchors = True linkcheck_timeout = 0.25
4
80
sphinx
tests/roots/test-api-set-translator/conf.py
.py
# set this by test # import sys # from pathlib import Path # sys.path.insert(0, str(Path.cwd().resolve())) from docutils.writers.docutils_xml import XMLTranslator from sphinx.writers.html import HTML5Translator from sphinx.writers.latex import LaTeXTranslator from sphinx.writers.manpage import ManualPageTranslator fr...
73
1,679
sphinx
tests/roots/test-api-set-translator/translator.py
.py
from sphinx.writers.html import HTML5Translator class ExtHTMLTranslator(HTML5Translator): pass
6
101
sphinx
tests/roots/test-api-set-translator/nonext/conf.py
.py
import sys from pathlib import Path sys.path.insert(0, str(Path.cwd().resolve())) project = 'test'
7
101
sphinx
tests/roots/test-ext-autosummary-import_cycle/conf.py
.py
import sys from pathlib import Path sys.path.insert(0, str(Path.cwd().resolve())) extensions = ['sphinx.ext.autosummary'] autosummary_generate = False
8
153
sphinx
tests/roots/test-ext-autosummary-import_cycle/spam/eggs.py
.py
"""``spam.eggs`` module docstring.""" import spam # Required for test. class Ham: """``spam.eggs.Ham`` class docstring.""" a = 1 b = 2 c = 3
12
162
sphinx
tests/roots/test-ext-apidoc-toc/mypackage/main.py
.py
from pathlib import Path import mod_resource import mod_something if __name__ == '__main__': print(f'Hello, world! -> something returns: {mod_something.something()}') res_path = Path(mod_resource.__file__).parent / 'resource.txt' text = res_path.read_text(encoding='utf-8') print(f'From mod_resource:r...
12
344
sphinx
tests/roots/test-latex-labels-before-module/conf.py
.py
import sys from pathlib import Path sys.path.insert(0, str(Path.cwd().resolve())) extensions = ['sphinx.ext.autodoc'] nitpicky = True
9
137
sphinx
tests/roots/test-double-inheriting-theme/conf.py
.py
templates_path = ['_templates'] html_theme = 'base_theme2' html_theme_path = ['base_themes_dir'] exclude_patterns = ['_build']
5
127
sphinx
tests/roots/test-ext-imgmockconverter/conf.py
.py
import sys from pathlib import Path sys.path.insert(0, str(Path.cwd().resolve())) extensions = ['mocksvgconverter']
7
118
sphinx
tests/roots/test-ext-imgmockconverter/mocksvgconverter.py
.py
"""Does foo.svg --> foo.pdf with no change to the file.""" from __future__ import annotations import shutil from typing import TYPE_CHECKING from sphinx.transforms.post_transforms.images import ImageConverter if TYPE_CHECKING: import os from sphinx.application import Sphinx from sphinx.util.typing impo...
41
939
sphinx
tests/roots/test-ext-intersphinx-role/conf.py
.py
extensions = ['sphinx.ext.intersphinx'] # the role should not honor this conf var intersphinx_disabled_reftypes = ['*']
4
120
sphinx
tests/roots/test-changes/conf.py
.py
project = 'Sphinx ChangesBuilder tests' copyright = '2007' version = '0.6' release = '0.6alpha1'
5
97
sphinx
tests/roots/test-ext-autosummary-ext/conf.py
.py
import sys from pathlib import Path sys.path.insert(0, str(Path.cwd().resolve())) extensions = ['sphinx.ext.autosummary'] autosummary_generate = True exclude_patterns = ['_build']
11
184
sphinx
tests/roots/test-ext-autosummary-ext/underscore_module_.py
.py
"""module with trailing underscores everywhere""" class class_: """Class""" def method_(_arg): # NoQA: N805 """Method""" pass def function_(_arg): """Function""" pass
15
205
sphinx
tests/roots/test-ext-autosummary-ext/dummy_module.py
.py
""" .. autosummary:: module_attr C.class_attr C.instance_attr C.prop_attr1 C.prop_attr2 C.C2 """ # NoQA: D212 def with_sentence(): """I have a sentence which spans multiple lines. Then I have more stuff """ pass def no_sentence(): """this doesn't start with a capital....
82
1,320
sphinx
tests/roots/test-add_source_parser-conflicts-with-users-setting/conf.py
.py
import sys from pathlib import Path sys.path.insert(0, str(Path.cwd().resolve())) from docutils.parsers import Parser class DummyTestParser(Parser): supported = ('dummy',) extensions = ['source_parser'] source_suffix = { '.rst': 'restructuredtext', '.test': 'restructuredtext', } source_parsers = { ...
21
349
sphinx
tests/roots/test-add_source_parser-conflicts-with-users-setting/source_parser.py
.py
from docutils.parsers import Parser class TestSourceParser(Parser): supported = ('test',) def setup(app): app.add_source_suffix('.test', 'test') app.add_source_parser(TestSourceParser)
11
201
sphinx
tests/roots/test-ext-autosummary-filename-map/autosummary_dummy_module.py
.py
from __future__ import annotations from os import path from typing import Union class Foo: class Bar: # NoQA: D106 pass def __init__(self): pass def bar(self): pass @property def baz(self): pass def bar(x: int | str, y: int = 1) -> None: pass
24
308
sphinx
tests/roots/test-ext-autosummary-filename-map/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_filename_map = { 'autosummary_dummy_module': 'module_mangled', 'autosummary_dummy_module.bar': 'bar', }
12
276
sphinx
tests/roots/test-templating/conf.py
.py
project = 'Sphinx templating <Tests>' source_suffix = { '.txt': 'restructuredtext', } keep_warnings = True templates_path = ['_templates'] release = version = '2013.120' exclude_patterns = ['_build'] extensions = ['sphinx.ext.autosummary'] autosummary_generate = ['autosummary_templating']
12
295
sphinx
tests/roots/test-prolog/prolog_markdown_parser.py
.py
from docutils.parsers import Parser class DummyMarkdownParser(Parser): supported = ('markdown',) def parse(self, inputstring, document): document.rawsource = inputstring def setup(app): app.add_source_suffix('.md', 'markdown') app.add_source_parser(DummyMarkdownParser)
14
299
sphinx
tests/roots/test-prolog/conf.py
.py
import sys from pathlib import Path sys.path.insert(0, str(Path.cwd().resolve())) extensions = ['prolog_markdown_parser'] rst_prolog = '*Hello world*.\n\n' rst_epilog = '\n\n*Good-bye world*.'
10
196
sphinx
tests/roots/test-build-html-theme-having-multiple-stylesheets/conf.py
.py
html_theme_path = ['_themes'] html_theme = 'mytheme'
3
53
sphinx
tests/roots/test-ext-autodoc/autodoc_dummy_bar.py
.py
from bug2437.autodoc_dummy_foo import Foo class Bar: """Dummy class Bar with alias.""" my_name = Foo
8
112
sphinx
tests/roots/test-ext-autodoc/conf.py
.py
import sys from pathlib import Path sys.path.insert(0, str(Path.cwd().resolve())) extensions = ['sphinx.ext.autodoc'] autodoc_mock_imports = [ 'dummy', ] autodoc_type_aliases = { 'buffer_like': 'buffer_like', 'pathlike': 'pathlike', 'Handler': 'Handler', } nitpicky = True
19
294
sphinx
tests/roots/test-ext-autodoc/autodoc_dummy_module.py
.py
from dummy import * # NoQA: F403 def test(): """Dummy function using dummy.*""" dummy_function() # NoQA: F405
7
122
sphinx
tests/roots/test-ext-autodoc/bug2437/autodoc_dummy_foo.py
.py
class Foo: """Dummy class Foo.""" pass
5
48
sphinx
tests/roots/test-ext-autodoc/circular_import/c.py
.py
import circular_import.a import circular_import.b class SomeClass: X = circular_import.a.X
7
97
sphinx
tests/roots/test-ext-autodoc/circular_import/b.py
.py
import typing if typing.TYPE_CHECKING: from circular_import import SomeClass
5
82
sphinx
tests/roots/test-ext-autodoc/target/typevar.py
.py
from __future__ import annotations from datetime import date from typing import NewType, TypeVar #: T1 T1 = TypeVar('T1') T2 = TypeVar('T2') # A TypeVar not having doc comment #: T3 T3 = TypeVar('T3', int, str) #: T4 T4 = TypeVar('T4', covariant=True) # NoQA: PLC0105 #: T5 T5 = TypeVar('T5', contravariant=True)...
33
495
sphinx
tests/roots/test-ext-autodoc/target/hide_value.py
.py
#: docstring #: #: :meta hide-value: SENTINEL1 = object() #: :meta hide-value: SENTINEL2 = object() class Foo: """docstring""" #: docstring #: #: :meta hide-value: SENTINEL1 = object() #: :meta hide-value: SENTINEL2 = object()
20
260
sphinx
tests/roots/test-ext-autodoc/target/preserve_defaults.py
.py
from __future__ import annotations from datetime import datetime from typing import Any # NoQA: TC003 CONSTANT = 'foo' SENTINEL = object() def foo( name: str = CONSTANT, sentinel: Any = SENTINEL, now: datetime = datetime.now(), # NoQA: B008,DTZ005 color: int = 0xFFFFFF, *, kwarg1, kwar...
79
1,701
sphinx
tests/roots/test-ext-autodoc/target/inheritance.py
.py
class Base: #: docstring inheritedattr = None def inheritedmeth(self): """Inherited function.""" @classmethod def inheritedclassmeth(cls): """Inherited class method.""" @staticmethod def inheritedstaticmeth(cls): # NoQA: PLW0211 """Inherited static method.""" cl...
32
622
sphinx
tests/roots/test-ext-autodoc/target/wrappedfunction.py
.py
from __future__ import annotations from contextlib import contextmanager from functools import lru_cache from typing import Generator # NoQA: TC003,UP035 @lru_cache(maxsize=None) # NoQA: UP033 def slow_function(message, timeout): """This function is slow.""" print(message) @contextmanager def feeling_goo...
18
408
sphinx
tests/roots/test-ext-autodoc/target/need_mocks.py
.py
import missing_module import missing_package1.missing_module1 import sphinx.missing_module4 from missing_module import missing_name from missing_package2 import missing_module2 from missing_package3.missing_module3 import missing_name # NoQA: F811 from sphinx.missing_module4 import missing_name2 @missing_name(int) d...
43
944
sphinx
tests/roots/test-ext-autodoc/target/partialfunction.py
.py
from functools import partial def func1(a, b, c): """docstring of func1""" pass func2 = partial(func1, 1) func3 = partial(func2, 2) func3.__doc__ = 'docstring of func3' func4 = partial(func3, 3)
13
207
sphinx
tests/roots/test-ext-autodoc/target/methods.py
.py
from functools import partialmethod class Base: def meth(self): pass @staticmethod def staticmeth(): pass @classmethod def classmeth(cls): pass @property def prop(self): pass partialmeth = partialmethod(meth) async def coroutinemeth(self): ...
30
420
sphinx
tests/roots/test-ext-autodoc/target/singledispatch.py
.py
import inspect from functools import singledispatch def assign_signature(func): # This is intended to cover more complex signature-rewriting decorators. func.__signature__ = inspect.signature(func) return func @singledispatch def func(arg, kwarg=None): """A function for general use.""" pass @f...
36
704
sphinx
tests/roots/test-ext-autodoc/target/sort_by_all.py
.py
__all__ = ['baz', 'foo', 'Bar'] def foo(): pass class Bar: pass def baz(): pass def qux(): pass class Quux: pass def foobar(): pass
26
168
sphinx
tests/roots/test-ext-autodoc/target/metadata.py
.py
def foo(): """:meta metadata-only-docstring:"""
3
52
sphinx
tests/roots/test-ext-autodoc/target/TYPE_CHECKING.py
.py
# NoQA: N999 from __future__ import annotations from gettext import NullTranslations # NoQA: TC003 from typing import TYPE_CHECKING if TYPE_CHECKING: from collections.abc import Iterable from io import StringIO class Foo: attr1: StringIO def spam(ham: Iterable[str]) -> tuple[NullTranslations, bool]: ...
18
329
sphinx
tests/roots/test-ext-autodoc/target/decorator.py
.py
from functools import wraps def deco1(func): """docstring for deco1""" @wraps(func) def wrapper(): return func() return wrapper def deco2(condition, message): """docstring for deco2""" def decorator(func): def wrapper(): return func() return wrapper ...
57
767
sphinx
tests/roots/test-ext-autodoc/target/generic_class.py
.py
from __future__ import annotations from typing import Generic, TypeVar T = TypeVar('T') # Test that typing.Generic's __new__ method does not mask our class' # __init__ signature. class A(Generic[T]): # NoQA: UP046 """docstring for A""" def __init__(self, a, b=None): pass
15
294
sphinx
tests/roots/test-ext-autodoc/target/bound_method.py
.py
class Cls: def method(self): """Method docstring""" pass bound_method = Cls().method
8
107
sphinx
tests/roots/test-ext-autodoc/target/autoclass_content.py
.py
class A: """A class having no __init__, no __new__""" class B: """A class having __init__(no docstring), no __new__""" def __init__(self): pass class C: """A class having __init__, no __new__""" def __init__(self): """__init__ docstring""" class D: """A class having no __...
55
889
sphinx
tests/roots/test-ext-autodoc/target/coroutine.py
.py
import asyncio from functools import wraps class AsyncClass: async def do_coroutine(self): """A documented coroutine function""" attr_coro_result = await _other_coro_func() @classmethod async def do_coroutine2(cls): """A documented coroutine classmethod""" pass @stati...
39
781
sphinx
tests/roots/test-ext-autodoc/target/descriptor.py
.py
class CustomDataDescriptor: """Descriptor class docstring.""" def __init__(self, doc): self.__doc__ = doc def __get__(self, obj, type=None): if obj is None: return self return 42 def meth(self): """Function.""" return 'The Answer' class CustomData...
33
684
sphinx
tests/roots/test-ext-autodoc/target/typehints.py
.py
from __future__ import annotations import pathlib from typing import TYPE_CHECKING, Tuple, TypeVar, Union # NoQA: UP035 if TYPE_CHECKING: from typing import Any CONST1: int #: docstring CONST2: int = 1 #: docstring CONST3: pathlib.PurePosixPath = pathlib.PurePosixPath('/a/b/c') #: docstring T = TypeVar('T', bou...
111
2,140
sphinx
tests/roots/test-ext-autodoc/target/process_docstring.py
.py
def func(): """first line --- second line --- third line """
8
85
sphinx
tests/roots/test-ext-autodoc/target/genericalias.py
.py
from __future__ import annotations from typing import Callable, List #: A list of int T = List[int] C = Callable[[int], None] # a generic alias not having a doccomment class Class: #: A list of int T = List[int] #: A list of Class L = List[Class]
18
263
sphinx
tests/roots/test-ext-autodoc/target/singledispatchmethod.py
.py
from functools import singledispatchmethod class Foo: """docstring""" @singledispatchmethod def meth(self, arg, kwarg=None): """A method for general use.""" pass @meth.register(int) @meth.register(float) def _meth_int(self, arg, kwarg=None): """A method for int.""" ...
28
628
sphinx
tests/roots/test-ext-autodoc/target/__init__.py
.py
import enum from io import StringIO from ._functions_to_import import function_to_be_imported __all__ = ['Class'] #: documentation for the integer integer = 1 def raises(exc, func, *args, **kwds): """Raise AssertionError if ``func(*args, **kwds)`` does not raise *exc*.""" pass class CustomEx(Exception): ...
214
4,543
sphinx
tests/roots/test-ext-autodoc/target/overload3.py
.py
import typing from typing import TYPE_CHECKING, overload import typing_extensions from typing_extensions import overload as over_ext # noqa: UP035 @overload def test(x: int) -> int: ... @typing.overload def test(x: list[int]) -> list[int]: ... @over_ext def test(x: str) -> str: ... @typing_extensions.overload def t...
19
399
sphinx
tests/roots/test-ext-autodoc/target/annotated.py
.py
# from __future__ import annotations import dataclasses import types from typing import Annotated @dataclasses.dataclass(frozen=True) class FuncValidator: func: types.FunctionType @dataclasses.dataclass(frozen=True) class MaxLen: max_length: int whitelisted_words: list[str] def validate(value: str) -...
43
869
sphinx
tests/roots/test-ext-autodoc/target/singledispatchmethod_classmethod.py
.py
from functools import singledispatchmethod class Foo: """docstring""" @singledispatchmethod @classmethod def class_meth(cls, arg, kwarg=None): """A class method for general use.""" pass @class_meth.register(int) @class_meth.register(float) @classmethod def _class_meth...
32
768
sphinx
tests/roots/test-ext-autodoc/target/instance_variable.py
.py
class Foo: def __init__(self): self.attr1 = None #: docstring foo self.attr2 = None #: docstring foo class Bar(Foo): def __init__(self): self.attr2 = None #: docstring bar self.attr3 = None #: docstring bar self.attr4 = None
12
279
sphinx
tests/roots/test-ext-autodoc/target/typed_vars.py
.py
#: attr1 attr1: str = '' #: attr2 attr2: str #: attr3 attr3 = '' # type: str class _Descriptor: def __init__(self, name): self.__doc__ = f'This is {name}' def __get__(self): # NoQA: PLE0302 pass class Class: attr1: int = 0 attr2: int attr3 = 0 # type: int descr4: int = _...
38
606
sphinx
tests/roots/test-ext-autodoc/target/module.py
.py
undocumented = 1 #: docstring documented = 1 undoc_annotated: int #: docstring annotated: int __special__ = 1 #: docstring __documented_special__ = 1
15
155
sphinx
tests/roots/test-ext-autodoc/target/uninitialized_attributes.py
.py
class Base: attr1: int #: docstring attr2: str class Derived(Base): attr3: int #: docstring attr4: str
9
123
sphinx
tests/roots/test-ext-autodoc/target/functions.py
.py
from functools import partial def func(): pass async def coroutinefunc(): pass async def asyncgenerator(): # NoQA: RUF029 yield partial_func = partial(func) partial_coroutinefunc = partial(coroutinefunc) builtin_func = print partial_builtin_func = partial(print) def slice_arg_func(arg: 'float64[...
25
352
sphinx
tests/roots/test-ext-autodoc/target/properties.py
.py
import sys TYPE_CHECKING = False if sys.version_info[:2] < (3, 14) or TYPE_CHECKING: TypeCheckingOnlyName = int class Foo: """docstring""" @property def prop1(self) -> int: """docstring""" @classmethod @property def prop2(cls) -> int: """docstring""" @property d...
34
633
sphinx
tests/roots/test-ext-autodoc/target/enums.py
.py
# ruff: NoQA: PIE796 import enum from typing import final class MemberType: """Custom data type with a simple API.""" # this mangled attribute will never be shown on subclasses # even if :inherited-members: and :private-members: are set __slots__ = ('__data',) def __new__(cls, value): se...
245
5,158
sphinx
tests/roots/test-ext-autodoc/target/pep695.py
.py
from __future__ import annotations import pathlib from typing import NewType, TypeAliasType import typing_extensions #: Some buffer-like object buffer_like = bytes | bytearray | memoryview #: Any type of path pathlike = str | pathlib.Path #: A generic type alias Handler = type[Exception] class Foo: """This i...
73
1,848
sphinx
tests/roots/test-ext-autodoc/target/autodoc_type_aliases.py
.py
from __future__ import annotations import io # NoQA: TC003 from typing import TYPE_CHECKING, overload if TYPE_CHECKING: from typing import Optional myint = int #: docstring variable: myint #: docstring variable2 = None # type: myint #: docstring variable3: Optional[myint] # NoQA: UP045 def read(r: io.Byt...
51
743