pax_global_header00006660000000000000000000000064147062653340014524gustar00rootroot0000000000000052 comment=0bc601e0cc771b26b206a46d3b298ef951b43c7c python-blacken-docs-1.19.1/000077500000000000000000000000001470626533400154615ustar00rootroot00000000000000python-blacken-docs-1.19.1/.editorconfig000066400000000000000000000003451470626533400201400ustar00rootroot00000000000000# http://editorconfig.org root = true [*] indent_style = space indent_size = 2 trim_trailing_whitespace = true insert_final_newline = true charset = utf-8 end_of_line = lf [*.py] indent_size = 4 [Makefile] indent_style = tab python-blacken-docs-1.19.1/.github/000077500000000000000000000000001470626533400170215ustar00rootroot00000000000000python-blacken-docs-1.19.1/.github/CODE_OF_CONDUCT.md000066400000000000000000000001311470626533400216130ustar00rootroot00000000000000This project follows [Django's Code of Conduct](https://www.djangoproject.com/conduct/). python-blacken-docs-1.19.1/.github/ISSUE_TEMPLATE/000077500000000000000000000000001470626533400212045ustar00rootroot00000000000000python-blacken-docs-1.19.1/.github/ISSUE_TEMPLATE/config.yml000066400000000000000000000000341470626533400231710ustar00rootroot00000000000000blank_issues_enabled: false python-blacken-docs-1.19.1/.github/ISSUE_TEMPLATE/feature-request.yml000066400000000000000000000004111470626533400250440ustar00rootroot00000000000000name: Feature Request description: Request an enhancement or new feature. body: - type: textarea id: description attributes: label: Description description: Please describe your feature request with appropriate detail. validations: required: true python-blacken-docs-1.19.1/.github/ISSUE_TEMPLATE/issue.yml000066400000000000000000000012301470626533400230530ustar00rootroot00000000000000name: Issue description: File an issue body: - type: input id: python_version attributes: label: Python Version description: Which version of Python were you using? placeholder: 3.9.0 validations: required: false - type: input id: package_version attributes: label: Package Version description: Which version of this package were you using? If not the latest version, please check this issue has not since been resolved. placeholder: 1.0.0 validations: required: false - type: textarea id: description attributes: label: Description description: Please describe your issue. validations: required: true python-blacken-docs-1.19.1/.github/SECURITY.md000066400000000000000000000001011470626533400206020ustar00rootroot00000000000000Please report security issues directly over email to me@adamj.eu python-blacken-docs-1.19.1/.github/dependabot.yml000066400000000000000000000002471470626533400216540ustar00rootroot00000000000000version: 2 updates: - package-ecosystem: github-actions directory: "/" groups: "GitHub Actions": patterns: - "*" schedule: interval: monthly python-blacken-docs-1.19.1/.github/workflows/000077500000000000000000000000001470626533400210565ustar00rootroot00000000000000python-blacken-docs-1.19.1/.github/workflows/main.yml000066400000000000000000000051521470626533400225300ustar00rootroot00000000000000name: CI on: push: branches: - main tags: - '**' pull_request: concurrency: group: ${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: tests: name: Python ${{ matrix.python-version }} runs-on: ubuntu-24.04 strategy: matrix: python-version: - 3.9 - '3.10' - '3.11' - '3.12' - '3.13' steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} allow-prereleases: true - name: Install uv uses: astral-sh/setup-uv@v3 with: enable-cache: true cache-dependency-glob: tests/requirements/*.txt - name: Install dependencies run: uv pip install --system tox tox-uv - name: Run tox targets for ${{ matrix.python-version }} run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .) - name: Upload coverage data uses: actions/upload-artifact@v4 with: name: coverage-data-${{ matrix.python-version }} path: '${{ github.workspace }}/.coverage.*' include-hidden-files: true if-no-files-found: error coverage: name: Coverage runs-on: ubuntu-24.04 needs: tests steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.12' - name: Install uv uses: astral-sh/setup-uv@v3 - name: Install dependencies run: uv pip install --system coverage[toml] - name: Download data uses: actions/download-artifact@v4 with: path: ${{ github.workspace }} pattern: coverage-data-* merge-multiple: true - name: Combine coverage and fail if it's <100% run: | python -m coverage combine python -m coverage html --skip-covered --skip-empty python -m coverage report --fail-under=100 echo "## Coverage summary" >> $GITHUB_STEP_SUMMARY python -m coverage report --format=markdown >> $GITHUB_STEP_SUMMARY - name: Upload HTML report if: ${{ failure() }} uses: actions/upload-artifact@v4 with: name: html-report path: htmlcov release: needs: [coverage] if: success() && startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-24.04 environment: release permissions: contents: read id-token: write steps: - uses: actions/checkout@v4 - uses: astral-sh/setup-uv@v3 - name: Build run: uv build - uses: pypa/gh-action-pypi-publish@release/v1 python-blacken-docs-1.19.1/.gitignore000066400000000000000000000000771470626533400174550ustar00rootroot00000000000000*.egg-info/ *.pyc /.coverage /.coverage.* /.tox /build/ /dist/ python-blacken-docs-1.19.1/.pre-commit-config.yaml000066400000000000000000000027601470626533400217470ustar00rootroot00000000000000ci: autoupdate_schedule: monthly default_language_version: python: python3.12 repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: - id: check-added-large-files - id: check-case-conflict - id: check-json - id: check-merge-conflict - id: check-symlinks - id: check-toml - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/tox-dev/pyproject-fmt rev: 2.2.4 hooks: - id: pyproject-fmt - repo: https://github.com/tox-dev/tox-ini-fmt rev: 1.4.1 hooks: - id: tox-ini-fmt - repo: https://github.com/rstcheck/rstcheck rev: v6.2.4 hooks: - id: rstcheck additional_dependencies: - tomli==2.0.1 - repo: https://github.com/asottile/pyupgrade rev: v3.17.0 hooks: - id: pyupgrade args: [--py39-plus] - repo: https://github.com/psf/black-pre-commit-mirror rev: 24.8.0 hooks: - id: black - repo: https://github.com/adamchainz/blacken-docs rev: 1.18.0 hooks: - id: blacken-docs additional_dependencies: - black==24.4.2 files: '\.rst$' - repo: https://github.com/pycqa/isort rev: 5.13.2 hooks: - id: isort name: isort (python) - repo: https://github.com/PyCQA/flake8 rev: 7.1.1 hooks: - id: flake8 additional_dependencies: - flake8-bugbear - flake8-comprehensions - flake8-logging - flake8-tidy-imports - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.11.2 hooks: - id: mypy additional_dependencies: - black==24.4.2 - pytest==7.1.2 python-blacken-docs-1.19.1/.pre-commit-hooks.yaml000066400000000000000000000003141470626533400216160ustar00rootroot00000000000000- id: blacken-docs name: blacken-docs description: Run `black` on python code blocks in documentation files entry: blacken-docs language: python files: '\.(rst|md|markdown|py|tex)$' python-blacken-docs-1.19.1/CHANGELOG.rst000066400000000000000000000065211470626533400175060ustar00rootroot00000000000000========= Changelog ========= 1.19.1 (2024-10-23) ------------------- * Add support for Black's ``--pyi`` flag. Thanks to Alex Waygood in `PR #375 `__. 1.19.0 (2024-10-07) ------------------- * reStructuredText: Gracefully ignore empty code blocks. Thanks to Stephen Rosen in `PR #368 `__. * Drop Python 3.8 support. * Support Python 3.13. 1.18.0 (2024-06-30) ------------------- * Add support for on/off comments. Thanks to Timothée Mazzucotelli in `PR #287 `__. * Fix Markdown ``pycon`` formatting to allow formatting the rest of the file. 1.17.0 (2024-06-29) ------------------- * Add a ``--check`` option. When used, blacken-docs will not modify files but indicate when changes are necessary with a message and non-zero exit code. Thanks to Joaquim Esteves in `PR #278 `__. * Allow options in LaTeX minted blocks. Thanks to Peter Cock in `PR #313 `__. * Ignore language specifiers after newlines in Markdown code blocks. Thanks to Harutaka Kawamura in `PR #283 `__. 1.16.0 (2023-08-16) ------------------- * Allow Markdown fence options. Thanks to initial work from Matthew Anderson in `PR #246 `__. * Expand Markdown detection to all Python language names from Pygments: ``py``, ``sage``, ``python3``, ``py3``, and ``numpy``. * Preserve leading whitespace lines in reStructuredText code blocks. Thanks to Julianus Pfeuffer for the report in `Issue #217 `__. * Use exit code 2 to indicate errors from Black, whilst exit code 1 remains for “files have been formatted”. Thanks to Julianus Pfeuffer for the report in `Issue #218 `__. * Support passing the ``--preview`` option through to Black, to select the future style. * Remove ``language_version`` from ``.pre-commit-hooks.yaml``. This change allows ``default_language_version`` in ``.pre-commit-config.yaml` to take precedence. Thanks to Aneesh Agrawal in `PR #258 `__. 1.15.0 (2023-07-09) ------------------- * Drop Python 3.7 support. 1.14.0 (2023-06-13) ------------------- * Support Python 3.12. 1.13.0 (2023-01-16) ------------------- * Note Adam Johnson is new maintainer. * Require Black 22.1.0+. * Add ``--rst-literal-blocks`` option, to also format text in reStructuredText literal blocks, starting with ``::``. Sphinx highlights these with the project’s default language, which defaults to Python. 1.12.1 (2022-01-30) ------------------- * Fix compatibility with Black 22.1.0. Thanks to Jelle Zijlstra for the fix in `PR #142 `__. * Drop Python 3.6 support. Thanks to Anthony Sottile in `PR #140 `__. 1.12.0 (2021-11-19) ------------------- * Fix nested reStructuredText code blocks. No changelog kept for earlier versions. See `log on GitHub `__ for details. python-blacken-docs-1.19.1/HISTORY.rst000066400000000000000000000001071470626533400173520ustar00rootroot00000000000000See https://github.com/adamchainz/blacken-docs/blob/main/CHANGELOG.rst python-blacken-docs-1.19.1/LICENSE000066400000000000000000000020431470626533400164650ustar00rootroot00000000000000Copyright (c) 2018 Anthony Sottile Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. python-blacken-docs-1.19.1/MANIFEST.in000066400000000000000000000001471470626533400172210ustar00rootroot00000000000000include CHANGELOG.rst include LICENSE include pyproject.toml include README.rst include src/*/py.typed python-blacken-docs-1.19.1/README.rst000066400000000000000000000166301470626533400171560ustar00rootroot00000000000000============ blacken-docs ============ .. image:: https://img.shields.io/github/actions/workflow/status/adamchainz/blacken-docs/main.yml.svg?branch=main&style=for-the-badge :target: https://github.com/adamchainz/blacken-docs/actions?workflow=CI .. image:: https://img.shields.io/badge/Coverage-100%25-success?style=for-the-badge :target: https://github.com/adamchainz/blacken-docs/actions?workflow=CI .. image:: https://img.shields.io/pypi/v/blacken-docs.svg?style=for-the-badge :target: https://pypi.org/project/blacken-docs/ .. image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge :target: https://github.com/psf/black .. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=for-the-badge :target: https://github.com/pre-commit/pre-commit :alt: pre-commit Run `Black `__ on Python code blocks in documentation files. Installation ============ Use **pip**: .. code-block:: sh python -m pip install blacken-docs Python 3.9 to 3.13 supported. Black 22.1.0+ supported. pre-commit hook --------------- You can also install blacken-docs as a `pre-commit `__ hook. Add the following to the ``repos`` section of your ``.pre-commit-config.yaml`` file (`docs `__): .. code-block:: yaml - repo: https://github.com/adamchainz/blacken-docs rev: "" # replace with latest tag on GitHub hooks: - id: blacken-docs additional_dependencies: - black==22.12.0 Then, reformat your entire project: .. code-block:: sh pre-commit run blacken-docs --all-files Since Black is a moving target, it’s best to pin it in ``additional_dependencies``, and upgrade as appropriate. If you have Black installed as another hook, you can automate upgrading this pinned hook using `sync-pre-commit-deps `__. Usage ===== blacken-docs is a command line tool that rewrites documentation files in place. It supports Markdown, reStructuredText, and LaTex files. Additionally, you can run it on Python files to reformat Markdown and reStructuredText within docstrings. Run ``blacken-docs`` with the filenames to rewrite: .. code-block:: sh blacken-docs README.rst If any file is modified, ``blacken-docs`` exits nonzero. ``blacken-docs`` does not have any ability to recurse through directories. Use the pre-commit integration, globbing, or another technique for applying to many files. For example, |with git ls-files pipe xargs|_: .. |with git ls-files pipe xargs| replace:: with ``git ls-files | xargs`` .. _with git ls-files pipe xargs: https://adamj.eu/tech/2022/03/09/how-to-run-a-command-on-many-files-in-your-git-repository/ .. code-block:: sh git ls-files -z -- '*.md' | xargs -0 blacken-docs …or PowerShell’s |ForEach-Object|__: .. |ForEach-Object| replace:: ``ForEach-Object`` __ https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/foreach-object .. code-block:: powershell git ls-files -- '*.md' | %{blacken-docs $_} blacken-docs currently passes the following options through to Black: * |-l / --line-length|__ .. |-l / --line-length| replace:: ``-l`` / ``--line-length`` __ https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#l-line-length * |--preview|__ .. |--preview| replace:: ``--preview`` __ https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#preview * |--pyi|__ .. |--pyi| replace:: ``--pyi`` __ https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#pyi * |-S / --skip-string-normalization|__ .. |-S / --skip-string-normalization| replace:: ``-S`` / ``--skip-string-normalization`` __ https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#s-skip-string-normalization * |-t / --target-version|__ .. |-t / --target-version| replace:: ``-t`` / ``--target-version`` __ https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#t-target-version It also has the below extra options: * ``--check`` - Don’t modify files but indicate when changes are necessary with a message and non-zero return code. * ``-E`` / ``--skip-errors`` - Don’t exit non-zero for errors from Black (normally syntax errors). * ``--rst-literal-blocks`` - Also format literal blocks in reStructuredText files (more below). History ======= blacken-docs was created by `Anthony Sottile `__ in 2018. At the end of 2022, Adam Johnson took over maintenance. Supported code block formats ============================ blacken-docs formats code blocks matching the following patterns. Markdown -------- In “python” blocks: .. code-block:: markdown ```python def hello(): print("hello world") ``` And “pycon” blocks: .. code-block:: markdown ```pycon >>> def hello(): ... print("hello world") ... ``` Prevent formatting within a block using ``blacken-docs:off`` and ``blacken-docs:on`` comments: .. code-block:: markdown ```python # whatever you want ``` Within Python files, docstrings that contain Markdown code blocks may be reformatted: .. code-block:: python def f(): """docstring here ```python print("hello world") ``` """ reStructuredText ---------------- In “python” blocks: .. code-block:: rst .. code-block:: python def hello(): print("hello world") In “pycon” blocks: .. code-block:: rst .. code-block:: pycon >>> def hello(): ... print("hello world") ... Prevent formatting within a block using ``blacken-docs:off`` and ``blacken-docs:on`` comments: .. code-block:: rst .. blacken-docs:off .. code-block:: python # whatever you want .. blacken-docs:on Use ``--rst-literal-blocks`` to also format `literal blocks `__: .. code-block:: rst An example:: def hello(): print("hello world") Literal blocks are marked with ``::`` and can be any monospaced text by default. However Sphinx interprets them as Python code `by default `__. If your project uses Sphinx and such a configuration, add ``--rst-literal-blocks`` to also format such blocks. Within Python files, docstrings that contain reStructuredText code blocks may be reformatted: .. code-block:: python def f(): """docstring here .. code-block:: python print("hello world") """ LaTeX ----- In minted “python” blocks: .. code-block:: latex \begin{minted}{python} def hello(): print("hello world") \end{minted} In minted “pycon” blocks: .. code-block:: latex \begin{minted}{pycon} >>> def hello(): ... print("hello world") ... \end{minted} In PythonTeX blocks: .. code-block:: latex \begin{pycode} def hello(): print("hello world") \end{pycode} Prevent formatting within a block using ``blacken-docs:off`` and ``blacken-docs:on`` comments: .. code-block:: latex % blacken-docs:off \begin{minted}{python} # whatever you want \end{minted} % blacken-docs:on python-blacken-docs-1.19.1/pyproject.toml000066400000000000000000000036001470626533400203740ustar00rootroot00000000000000[build-system] build-backend = "setuptools.build_meta" requires = [ "setuptools", ] [project] name = "blacken-docs" version = "1.19.1" description = "Run Black on Python code blocks in documentation files." readme = "README.rst" maintainers = [ { name = "Adam Johnson", email = "me@adamj.eu" }, ] authors = [ { name = "Anthony Sottile", email = "asottile@umich.edu" }, ] requires-python = ">=3.9" classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "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", "Typing :: Typed", ] dependencies = [ "black>=22.1", ] urls.Changelog = "https://github.com/adamchainz/blacken-docs/blob/main/CHANGELOG.rst" urls.Repository = "https://github.com/asottile/blacken-docs" scripts.blacken-docs = "blacken_docs:main" [tool.isort] add_imports = [ "from __future__ import annotations", ] force_single_line = true profile = "black" [tool.pyproject-fmt] max_supported_python = "3.13" [tool.pytest.ini_options] addopts = """\ --strict-config --strict-markers """ xfail_strict = true [tool.coverage.run] branch = true parallel = true source = [ "blacken_docs", "tests", ] [tool.coverage.paths] source = [ "src", ".tox/**/site-packages", ] [tool.coverage.report] show_missing = true [tool.mypy] enable_error_code = [ "ignore-without-code", "redundant-expr", "truthy-bool", ] mypy_path = "src/" namespace_packages = false strict = true warn_unreachable = true [[tool.mypy.overrides]] module = "tests.*" allow_untyped_defs = true [tool.rstcheck] report_level = "ERROR" python-blacken-docs-1.19.1/src/000077500000000000000000000000001470626533400162505ustar00rootroot00000000000000python-blacken-docs-1.19.1/src/blacken_docs/000077500000000000000000000000001470626533400206575ustar00rootroot00000000000000python-blacken-docs-1.19.1/src/blacken_docs/__init__.py000066400000000000000000000273741470626533400230050ustar00rootroot00000000000000from __future__ import annotations import argparse import contextlib import re import textwrap from bisect import bisect from collections.abc import Generator from collections.abc import Sequence from re import Match import black from black.const import DEFAULT_LINE_LENGTH from black.mode import TargetVersion PYGMENTS_PY_LANGS = frozenset(("python", "py", "sage", "python3", "py3", "numpy")) PYGMENTS_PY_LANGS_RE_FRAGMENT = f"({'|'.join(PYGMENTS_PY_LANGS)})" MD_RE = re.compile( r"(?P^(?P *)```[^\S\r\n]*" + PYGMENTS_PY_LANGS_RE_FRAGMENT + r"( .*?)?\n)" r"(?P.*?)" r"(?P^(?P=indent)```[^\S\r\n]*$)", re.DOTALL | re.MULTILINE, ) MD_PYCON_RE = re.compile( r"(?P^(?P *)```[^\S\r\n]*pycon( .*?)?\n)" r"(?P.*?)" r"(?P^(?P=indent)```[^\S\r\n]*$)", re.DOTALL | re.MULTILINE, ) BLOCK_TYPES = "(code|code-block|sourcecode|ipython)" DOCTEST_TYPES = "(testsetup|testcleanup|testcode)" RST_RE = re.compile( rf"(?P" rf"^(?P *)\.\. (" rf"jupyter-execute::|" rf"{BLOCK_TYPES}:: (?P\w+)|" rf"{DOCTEST_TYPES}::.*" rf")\n" rf"((?P=indent) +:.*\n)*" rf"( *\n)*" rf")" rf"(?P(^((?P=indent) +.*)?\n)+)", re.MULTILINE, ) RST_LITERAL_BLOCKS_RE = re.compile( r"(?P" r"^(?! *\.\. )(?P *).*::\n" r"((?P=indent) +:.*\n)*" r"\n*" r")" r"(?P(^((?P=indent) +.*)?\n)+)", re.MULTILINE, ) RST_PYCON_RE = re.compile( r"(?P" r"(?P *)\.\. ((code|code-block):: pycon|doctest::.*)\n" r"((?P=indent) +:.*\n)*" r"\n*" r")" r"(?P(^((?P=indent) +.*)?(\n|$))+)", re.MULTILINE, ) PYCON_PREFIX = ">>> " PYCON_CONTINUATION_PREFIX = "..." PYCON_CONTINUATION_RE = re.compile( rf"^{re.escape(PYCON_CONTINUATION_PREFIX)}( |$)", ) LATEX_RE = re.compile( r"(?P^(?P *)\\begin{minted}(\[.*?\])?{python}\n)" r"(?P.*?)" r"(?P^(?P=indent)\\end{minted}\s*$)", re.DOTALL | re.MULTILINE, ) LATEX_PYCON_RE = re.compile( r"(?P^(?P *)\\begin{minted}(\[.*?\])?{pycon}\n)" r"(?P.*?)" r"(?P^(?P=indent)\\end{minted}\s*$)", re.DOTALL | re.MULTILINE, ) PYTHONTEX_LANG = r"(?Ppyblock|pycode|pyconsole|pyverbatim)" PYTHONTEX_RE = re.compile( rf"(?P^(?P *)\\begin{{{PYTHONTEX_LANG}}}\n)" rf"(?P.*?)" rf"(?P^(?P=indent)\\end{{(?P=lang)}}\s*$)", re.DOTALL | re.MULTILINE, ) INDENT_RE = re.compile("^ +(?=[^ ])", re.MULTILINE) TRAILING_NL_RE = re.compile(r"\n+\Z", re.MULTILINE) ON_OFF = r"blacken-docs:(on|off)" ON_OFF_COMMENT_RE = re.compile( # Markdown rf"(?:^\s*$)|" # rST rf"(?:^\s*\.\. +{ON_OFF}$)|" # LaTeX rf"(?:^\s*% {ON_OFF}$)", re.MULTILINE, ) class CodeBlockError: def __init__(self, offset: int, exc: Exception) -> None: self.offset = offset self.exc = exc def format_str( src: str, black_mode: black.FileMode, *, rst_literal_blocks: bool = False, ) -> tuple[str, Sequence[CodeBlockError]]: errors: list[CodeBlockError] = [] off_ranges = [] off_start = None for comment in re.finditer(ON_OFF_COMMENT_RE, src): # Check for the "off" value across the multiple (on|off) groups. if "off" in comment.groups(): if off_start is None: off_start = comment.start() else: if off_start is not None: off_ranges.append((off_start, comment.end())) off_start = None if off_start is not None: off_ranges.append((off_start, len(src))) def _within_off_range(code_range: tuple[int, int]) -> bool: index = bisect(off_ranges, code_range) try: off_start, off_end = off_ranges[index - 1] except IndexError: return False code_start, code_end = code_range return code_start >= off_start and code_end <= off_end @contextlib.contextmanager def _collect_error(match: Match[str]) -> Generator[None]: try: yield except Exception as e: errors.append(CodeBlockError(match.start(), e)) def _md_match(match: Match[str]) -> str: if _within_off_range(match.span()): return match[0] code = textwrap.dedent(match["code"]) with _collect_error(match): code = black.format_str(code, mode=black_mode) code = textwrap.indent(code, match["indent"]) return f'{match["before"]}{code}{match["after"]}' def _rst_match(match: Match[str]) -> str: if _within_off_range(match.span()): return match[0] lang = match["lang"] if lang is not None and lang not in PYGMENTS_PY_LANGS: return match[0] if not match["code"].strip(): return match[0] min_indent = min(INDENT_RE.findall(match["code"])) trailing_ws_match = TRAILING_NL_RE.search(match["code"]) assert trailing_ws_match trailing_ws = trailing_ws_match.group() code = textwrap.dedent(match["code"]) with _collect_error(match): code = black.format_str(code, mode=black_mode) code = textwrap.indent(code, min_indent) return f'{match["before"]}{code.rstrip()}{trailing_ws}' def _rst_literal_blocks_match(match: Match[str]) -> str: if _within_off_range(match.span()): return match[0] if not match["code"].strip(): return match[0] min_indent = min(INDENT_RE.findall(match["code"])) trailing_ws_match = TRAILING_NL_RE.search(match["code"]) assert trailing_ws_match trailing_ws = trailing_ws_match.group() code = textwrap.dedent(match["code"]) with _collect_error(match): code = black.format_str(code, mode=black_mode) code = textwrap.indent(code, min_indent) return f'{match["before"]}{code.rstrip()}{trailing_ws}' def _pycon_match(match: Match[str]) -> str: code = "" fragment: str | None = None def finish_fragment() -> None: nonlocal code nonlocal fragment if fragment is not None: with _collect_error(match): fragment = black.format_str(fragment, mode=black_mode) fragment_lines = fragment.splitlines() code += f"{PYCON_PREFIX}{fragment_lines[0]}\n" for line in fragment_lines[1:]: # Skip blank lines to handle Black adding a blank above # functions within blocks. A blank line would end the REPL # continuation prompt. # # >>> if True: # ... def f(): # ... pass # ... if line: code += f"{PYCON_CONTINUATION_PREFIX} {line}\n" if fragment_lines[-1].startswith(" "): code += f"{PYCON_CONTINUATION_PREFIX}\n" fragment = None indentation: int | None = None for line in match["code"].splitlines(): orig_line, line = line, line.lstrip() if indentation is None and line: indentation = len(orig_line) - len(line) continuation_match = PYCON_CONTINUATION_RE.match(line) if continuation_match and fragment is not None: fragment += line[continuation_match.end() :] + "\n" else: finish_fragment() if line.startswith(PYCON_PREFIX): fragment = line[len(PYCON_PREFIX) :] + "\n" else: code += orig_line[indentation:] + "\n" finish_fragment() return code def _md_pycon_match(match: Match[str]) -> str: if _within_off_range(match.span()): return match[0] code = _pycon_match(match) code = textwrap.indent(code, match["indent"]) return f'{match["before"]}{code}{match["after"]}' def _rst_pycon_match(match: Match[str]) -> str: if _within_off_range(match.span()): return match[0] code = _pycon_match(match) if not code.strip(): return match[0] min_indent = min(INDENT_RE.findall(match["code"])) code = textwrap.indent(code, min_indent) return f'{match["before"]}{code}' def _latex_match(match: Match[str]) -> str: if _within_off_range(match.span()): return match[0] code = textwrap.dedent(match["code"]) with _collect_error(match): code = black.format_str(code, mode=black_mode) code = textwrap.indent(code, match["indent"]) return f'{match["before"]}{code}{match["after"]}' def _latex_pycon_match(match: Match[str]) -> str: if _within_off_range(match.span()): return match[0] code = _pycon_match(match) code = textwrap.indent(code, match["indent"]) return f'{match["before"]}{code}{match["after"]}' src = MD_RE.sub(_md_match, src) src = MD_PYCON_RE.sub(_md_pycon_match, src) src = RST_RE.sub(_rst_match, src) src = RST_PYCON_RE.sub(_rst_pycon_match, src) if rst_literal_blocks: src = RST_LITERAL_BLOCKS_RE.sub( _rst_literal_blocks_match, src, ) src = LATEX_RE.sub(_latex_match, src) src = LATEX_PYCON_RE.sub(_latex_pycon_match, src) src = PYTHONTEX_RE.sub(_latex_match, src) return src, errors def format_file( filename: str, black_mode: black.FileMode, skip_errors: bool, rst_literal_blocks: bool, check_only: bool, ) -> int: with open(filename, encoding="UTF-8") as f: contents = f.read() new_contents, errors = format_str( contents, black_mode, rst_literal_blocks=rst_literal_blocks, ) for error in errors: lineno = contents[: error.offset].count("\n") + 1 print(f"{filename}:{lineno}: code block parse error {error.exc}") if errors and not skip_errors: return 2 if contents == new_contents: return 0 if check_only: print(f"{filename}: Requires a rewrite.") return 1 print(f"{filename}: Rewriting...") with open(filename, "w", encoding="UTF-8") as f: f.write(new_contents) return 1 def main(argv: Sequence[str] | None = None) -> int: parser = argparse.ArgumentParser() parser.add_argument( "-l", "--line-length", type=int, default=DEFAULT_LINE_LENGTH, ) parser.add_argument("--preview", action="store_true") parser.add_argument( "-S", "--skip-string-normalization", action="store_true", ) parser.add_argument( "-t", "--target-version", action="append", type=lambda v: TargetVersion[v.upper()], default=[], help=f"choices: {[v.name.lower() for v in TargetVersion]}", dest="target_versions", ) parser.add_argument("--check", action="store_true") parser.add_argument("-E", "--skip-errors", action="store_true") parser.add_argument( "--rst-literal-blocks", action="store_true", ) parser.add_argument("--pyi", action="store_true") parser.add_argument("filenames", nargs="*") args = parser.parse_args(argv) black_mode = black.Mode( target_versions=set(args.target_versions), line_length=args.line_length, string_normalization=not args.skip_string_normalization, is_pyi=args.pyi, preview=args.preview, ) retv = 0 for filename in args.filenames: retv |= format_file( filename, black_mode, skip_errors=args.skip_errors, rst_literal_blocks=args.rst_literal_blocks, check_only=args.check, ) return retv python-blacken-docs-1.19.1/src/blacken_docs/__main__.py000066400000000000000000000002171470626533400227510ustar00rootroot00000000000000from __future__ import annotations from blacken_docs import main if __name__ == "__main__": # pragma: no cover raise SystemExit(main()) python-blacken-docs-1.19.1/src/blacken_docs/py.typed000066400000000000000000000000001470626533400223440ustar00rootroot00000000000000python-blacken-docs-1.19.1/tests/000077500000000000000000000000001470626533400166235ustar00rootroot00000000000000python-blacken-docs-1.19.1/tests/__init__.py000066400000000000000000000000001470626533400207220ustar00rootroot00000000000000python-blacken-docs-1.19.1/tests/requirements/000077500000000000000000000000001470626533400213465ustar00rootroot00000000000000python-blacken-docs-1.19.1/tests/requirements/compile.py000077500000000000000000000014421470626533400233540ustar00rootroot00000000000000#!/usr/bin/env python from __future__ import annotations import os import subprocess import sys from functools import partial from pathlib import Path if __name__ == "__main__": os.chdir(Path(__file__).parent) common_args = [ "uv", "pip", "compile", "--quiet", "--generate-hashes", "requirements.in", *sys.argv[1:], ] run = partial(subprocess.run, check=True) run([*common_args, "--python", "3.9", "--output-file", "py39.txt"]) run([*common_args, "--python", "3.10", "--output-file", "py310.txt"]) run([*common_args, "--python", "3.11", "--output-file", "py311.txt"]) run([*common_args, "--python", "3.12", "--output-file", "py312.txt"]) run([*common_args, "--python", "3.13", "--output-file", "py313.txt"]) python-blacken-docs-1.19.1/tests/requirements/py310.txt000066400000000000000000000250701470626533400227670ustar00rootroot00000000000000# This file was autogenerated by uv via the following command: # uv pip compile --generate-hashes requirements.in --python 3.10 --output-file py310.txt black==24.8.0 \ --hash=sha256:09cdeb74d494ec023ded657f7092ba518e8cf78fa8386155e4a03fdcc44679e6 \ --hash=sha256:1f13f7f386f86f8121d76599114bb8c17b69d962137fc70efe56137727c7047e \ --hash=sha256:2500945420b6784c38b9ee885af039f5e7471ef284ab03fa35ecdde4688cd83f \ --hash=sha256:2b59b250fdba5f9a9cd9d0ece6e6d993d91ce877d121d161e4698af3eb9c1018 \ --hash=sha256:3c4285573d4897a7610054af5a890bde7c65cb466040c5f0c8b732812d7f0e5e \ --hash=sha256:505289f17ceda596658ae81b61ebbe2d9b25aa78067035184ed0a9d855d18afd \ --hash=sha256:62e8730977f0b77998029da7971fa896ceefa2c4c4933fcd593fa599ecbf97a4 \ --hash=sha256:649f6d84ccbae73ab767e206772cc2d7a393a001070a4c814a546afd0d423aed \ --hash=sha256:6e55d30d44bed36593c3163b9bc63bf58b3b30e4611e4d88a0c3c239930ed5b2 \ --hash=sha256:707a1ca89221bc8a1a64fb5e15ef39cd755633daa672a9db7498d1c19de66a42 \ --hash=sha256:72901b4913cbac8972ad911dc4098d5753704d1f3c56e44ae8dce99eecb0e3af \ --hash=sha256:73bbf84ed136e45d451a260c6b73ed674652f90a2b3211d6a35e78054563a9bb \ --hash=sha256:7c046c1d1eeb7aea9335da62472481d3bbf3fd986e093cffd35f4385c94ae368 \ --hash=sha256:81c6742da39f33b08e791da38410f32e27d632260e599df7245cccee2064afeb \ --hash=sha256:837fd281f1908d0076844bc2b801ad2d369c78c45cf800cad7b61686051041af \ --hash=sha256:972085c618ee94f402da1af548a4f218c754ea7e5dc70acb168bfaca4c2542ed \ --hash=sha256:9e84e33b37be070ba135176c123ae52a51f82306def9f7d063ee302ecab2cf47 \ --hash=sha256:b19c9ad992c7883ad84c9b22aaa73562a16b819c1d8db7a1a1a49fb7ec13c7d2 \ --hash=sha256:d6417535d99c37cee4091a2f24eb2b6d5ec42b144d50f1f2e436d9fe1916fe1a \ --hash=sha256:eab4dd44ce80dea27dc69db40dab62d4ca96112f87996bca68cd75639aeb2e4c \ --hash=sha256:f490dbd59680d809ca31efdae20e634f3fae27fba3ce0ba3208333b713bc3920 \ --hash=sha256:fb6e2c0b86bbd43dee042e48059c9ad7830abd5c94b0bc518c0eeec57c3eddc1 # via -r requirements.in click==8.1.7 \ --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de # via black coverage==7.6.1 \ --hash=sha256:06a737c882bd26d0d6ee7269b20b12f14a8704807a01056c80bb881a4b2ce6ca \ --hash=sha256:07e2ca0ad381b91350c0ed49d52699b625aab2b44b65e1b4e02fa9df0e92ad2d \ --hash=sha256:0c0420b573964c760df9e9e86d1a9a622d0d27f417e1a949a8a66dd7bcee7bc6 \ --hash=sha256:0dbde0f4aa9a16fa4d754356a8f2e36296ff4d83994b2c9d8398aa32f222f989 \ --hash=sha256:1125ca0e5fd475cbbba3bb67ae20bd2c23a98fac4e32412883f9bcbaa81c314c \ --hash=sha256:13b0a73a0896988f053e4fbb7de6d93388e6dd292b0d87ee51d106f2c11b465b \ --hash=sha256:166811d20dfea725e2e4baa71fffd6c968a958577848d2131f39b60043400223 \ --hash=sha256:170d444ab405852903b7d04ea9ae9b98f98ab6d7e63e1115e82620807519797f \ --hash=sha256:1f4aa8219db826ce6be7099d559f8ec311549bfc4046f7f9fe9b5cea5c581c56 \ --hash=sha256:225667980479a17db1048cb2bf8bfb39b8e5be8f164b8f6628b64f78a72cf9d3 \ --hash=sha256:260933720fdcd75340e7dbe9060655aff3af1f0c5d20f46b57f262ab6c86a5e8 \ --hash=sha256:2bdb062ea438f22d99cba0d7829c2ef0af1d768d1e4a4f528087224c90b132cb \ --hash=sha256:2c09f4ce52cb99dd7505cd0fc8e0e37c77b87f46bc9c1eb03fe3bc9991085388 \ --hash=sha256:3115a95daa9bdba70aea750db7b96b37259a81a709223c8448fa97727d546fe0 \ --hash=sha256:3e0cadcf6733c09154b461f1ca72d5416635e5e4ec4e536192180d34ec160f8a \ --hash=sha256:3f1156e3e8f2872197af3840d8ad307a9dd18e615dc64d9ee41696f287c57ad8 \ --hash=sha256:4421712dbfc5562150f7554f13dde997a2e932a6b5f352edcce948a815efee6f \ --hash=sha256:44df346d5215a8c0e360307d46ffaabe0f5d3502c8a1cefd700b34baf31d411a \ --hash=sha256:502753043567491d3ff6d08629270127e0c31d4184c4c8d98f92c26f65019962 \ --hash=sha256:547f45fa1a93154bd82050a7f3cddbc1a7a4dd2a9bf5cb7d06f4ae29fe94eaf8 \ --hash=sha256:5621a9175cf9d0b0c84c2ef2b12e9f5f5071357c4d2ea6ca1cf01814f45d2391 \ --hash=sha256:609b06f178fe8e9f89ef676532760ec0b4deea15e9969bf754b37f7c40326dbc \ --hash=sha256:645786266c8f18a931b65bfcefdbf6952dd0dea98feee39bd188607a9d307ed2 \ --hash=sha256:6878ef48d4227aace338d88c48738a4258213cd7b74fd9a3d4d7582bb1d8a155 \ --hash=sha256:6a89ecca80709d4076b95f89f308544ec8f7b4727e8a547913a35f16717856cb \ --hash=sha256:6db04803b6c7291985a761004e9060b2bca08da6d04f26a7f2294b8623a0c1a0 \ --hash=sha256:6e2cd258d7d927d09493c8df1ce9174ad01b381d4729a9d8d4e38670ca24774c \ --hash=sha256:6e81d7a3e58882450ec4186ca59a3f20a5d4440f25b1cff6f0902ad890e6748a \ --hash=sha256:702855feff378050ae4f741045e19a32d57d19f3e0676d589df0575008ea5004 \ --hash=sha256:78b260de9790fd81e69401c2dc8b17da47c8038176a79092a89cb2b7d945d060 \ --hash=sha256:7bb65125fcbef8d989fa1dd0e8a060999497629ca5b0efbca209588a73356232 \ --hash=sha256:7dea0889685db8550f839fa202744652e87c60015029ce3f60e006f8c4462c93 \ --hash=sha256:8284cf8c0dd272a247bc154eb6c95548722dce90d098c17a883ed36e67cdb129 \ --hash=sha256:877abb17e6339d96bf08e7a622d05095e72b71f8afd8a9fefc82cf30ed944163 \ --hash=sha256:8929543a7192c13d177b770008bc4e8119f2e1f881d563fc6b6305d2d0ebe9de \ --hash=sha256:8ae539519c4c040c5ffd0632784e21b2f03fc1340752af711f33e5be83a9d6c6 \ --hash=sha256:8f59d57baca39b32db42b83b2a7ba6f47ad9c394ec2076b084c3f029b7afca23 \ --hash=sha256:9054a0754de38d9dbd01a46621636689124d666bad1936d76c0341f7d71bf569 \ --hash=sha256:953510dfb7b12ab69d20135a0662397f077c59b1e6379a768e97c59d852ee51d \ --hash=sha256:95cae0efeb032af8458fc27d191f85d1717b1d4e49f7cb226cf526ff28179778 \ --hash=sha256:9bc572be474cafb617672c43fe989d6e48d3c83af02ce8de73fff1c6bb3c198d \ --hash=sha256:9c56863d44bd1c4fe2abb8a4d6f5371d197f1ac0ebdee542f07f35895fc07f36 \ --hash=sha256:9e0b2df163b8ed01d515807af24f63de04bebcecbd6c3bfeff88385789fdf75a \ --hash=sha256:a09ece4a69cf399510c8ab25e0950d9cf2b42f7b3cb0374f95d2e2ff594478a6 \ --hash=sha256:a1ac0ae2b8bd743b88ed0502544847c3053d7171a3cff9228af618a068ed9c34 \ --hash=sha256:a318d68e92e80af8b00fa99609796fdbcdfef3629c77c6283566c6f02c6d6704 \ --hash=sha256:a4acd025ecc06185ba2b801f2de85546e0b8ac787cf9d3b06e7e2a69f925b106 \ --hash=sha256:a6d3adcf24b624a7b778533480e32434a39ad8fa30c315208f6d3e5542aeb6e9 \ --hash=sha256:a78d169acd38300060b28d600344a803628c3fd585c912cacc9ea8790fe96862 \ --hash=sha256:a95324a9de9650a729239daea117df21f4b9868ce32e63f8b650ebe6cef5595b \ --hash=sha256:abd5fd0db5f4dc9289408aaf34908072f805ff7792632250dcb36dc591d24255 \ --hash=sha256:b06079abebbc0e89e6163b8e8f0e16270124c154dc6e4a47b413dd538859af16 \ --hash=sha256:b43c03669dc4618ec25270b06ecd3ee4fa94c7f9b3c14bae6571ca00ef98b0d3 \ --hash=sha256:b48f312cca9621272ae49008c7f613337c53fadca647d6384cc129d2996d1133 \ --hash=sha256:b5d7b556859dd85f3a541db6a4e0167b86e7273e1cdc973e5b175166bb634fdb \ --hash=sha256:b9f222de8cded79c49bf184bdbc06630d4c58eec9459b939b4a690c82ed05657 \ --hash=sha256:c3c02d12f837d9683e5ab2f3d9844dc57655b92c74e286c262e0fc54213c216d \ --hash=sha256:c44fee9975f04b33331cb8eb272827111efc8930cfd582e0320613263ca849ca \ --hash=sha256:cf4b19715bccd7ee27b6b120e7e9dd56037b9c0681dcc1adc9ba9db3d417fa36 \ --hash=sha256:d0c212c49b6c10e6951362f7c6df3329f04c2b1c28499563d4035d964ab8e08c \ --hash=sha256:d3296782ca4eab572a1a4eca686d8bfb00226300dcefdf43faa25b5242ab8a3e \ --hash=sha256:d85f5e9a5f8b73e2350097c3756ef7e785f55bd71205defa0bfdaf96c31616ff \ --hash=sha256:da511e6ad4f7323ee5702e6633085fb76c2f893aaf8ce4c51a0ba4fc07580ea7 \ --hash=sha256:e05882b70b87a18d937ca6768ff33cc3f72847cbc4de4491c8e73880766718e5 \ --hash=sha256:e61c0abb4c85b095a784ef23fdd4aede7a2628478e7baba7c5e3deba61070a02 \ --hash=sha256:e6a08c0be454c3b3beb105c0596ebdc2371fab6bb90c0c0297f4e58fd7e1012c \ --hash=sha256:e9a6e0eb86070e8ccaedfbd9d38fec54864f3125ab95419970575b42af7541df \ --hash=sha256:ed37bd3c3b063412f7620464a9ac1314d33100329f39799255fb8d3027da50d3 \ --hash=sha256:f1adfc8ac319e1a348af294106bc6a8458a0f1633cc62a1446aebc30c5fa186a \ --hash=sha256:f5796e664fe802da4f57a168c85359a8fbf3eab5e55cd4e4569fbacecc903959 \ --hash=sha256:fc5a77d0c516700ebad189b587de289a20a78324bc54baee03dd486f0855d234 \ --hash=sha256:fd21f6ae3f08b41004dfb433fa895d858f3f5979e7762d052b12aef444e29afc # via -r requirements.in exceptiongroup==1.2.2 \ --hash=sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b \ --hash=sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc # via pytest iniconfig==2.0.0 \ --hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \ --hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374 # via pytest mypy-extensions==1.0.0 \ --hash=sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d \ --hash=sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782 # via black packaging==24.1 \ --hash=sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002 \ --hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124 # via # black # pytest pathspec==0.12.1 \ --hash=sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08 \ --hash=sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712 # via black platformdirs==4.3.1 \ --hash=sha256:63b79589009fa8159973601dd4563143396b35c5f93a58b36f9049ff046949b1 \ --hash=sha256:facaa5a3c57aa1e053e3da7b49e0cc31fe0113ca42a4659d5c2e98e545624afe # via black pluggy==1.5.0 \ --hash=sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1 \ --hash=sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669 # via pytest pytest==8.3.2 \ --hash=sha256:4ba08f9ae7dcf84ded419494d229b48d0903ea6407b030eaec46df5e6a73bba5 \ --hash=sha256:c132345d12ce551242c87269de812483f5bcc87cdbb4722e48487ba194f9fdce # via # -r requirements.in # pytest-randomly pytest-randomly==3.15.0 \ --hash=sha256:0516f4344b29f4e9cdae8bce31c4aeebf59d0b9ef05927c33354ff3859eeeca6 \ --hash=sha256:b908529648667ba5e54723088edd6f82252f540cc340d748d1fa985539687047 # via -r requirements.in tomli==2.0.1 \ --hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \ --hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f # via # black # coverage # pytest typing-extensions==4.12.2 \ --hash=sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d \ --hash=sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8 # via black python-blacken-docs-1.19.1/tests/requirements/py311.txt000066400000000000000000000236441470626533400227750ustar00rootroot00000000000000# This file was autogenerated by uv via the following command: # uv pip compile --generate-hashes requirements.in --python 3.11 --output-file py311.txt black==24.8.0 \ --hash=sha256:09cdeb74d494ec023ded657f7092ba518e8cf78fa8386155e4a03fdcc44679e6 \ --hash=sha256:1f13f7f386f86f8121d76599114bb8c17b69d962137fc70efe56137727c7047e \ --hash=sha256:2500945420b6784c38b9ee885af039f5e7471ef284ab03fa35ecdde4688cd83f \ --hash=sha256:2b59b250fdba5f9a9cd9d0ece6e6d993d91ce877d121d161e4698af3eb9c1018 \ --hash=sha256:3c4285573d4897a7610054af5a890bde7c65cb466040c5f0c8b732812d7f0e5e \ --hash=sha256:505289f17ceda596658ae81b61ebbe2d9b25aa78067035184ed0a9d855d18afd \ --hash=sha256:62e8730977f0b77998029da7971fa896ceefa2c4c4933fcd593fa599ecbf97a4 \ --hash=sha256:649f6d84ccbae73ab767e206772cc2d7a393a001070a4c814a546afd0d423aed \ --hash=sha256:6e55d30d44bed36593c3163b9bc63bf58b3b30e4611e4d88a0c3c239930ed5b2 \ --hash=sha256:707a1ca89221bc8a1a64fb5e15ef39cd755633daa672a9db7498d1c19de66a42 \ --hash=sha256:72901b4913cbac8972ad911dc4098d5753704d1f3c56e44ae8dce99eecb0e3af \ --hash=sha256:73bbf84ed136e45d451a260c6b73ed674652f90a2b3211d6a35e78054563a9bb \ --hash=sha256:7c046c1d1eeb7aea9335da62472481d3bbf3fd986e093cffd35f4385c94ae368 \ --hash=sha256:81c6742da39f33b08e791da38410f32e27d632260e599df7245cccee2064afeb \ --hash=sha256:837fd281f1908d0076844bc2b801ad2d369c78c45cf800cad7b61686051041af \ --hash=sha256:972085c618ee94f402da1af548a4f218c754ea7e5dc70acb168bfaca4c2542ed \ --hash=sha256:9e84e33b37be070ba135176c123ae52a51f82306def9f7d063ee302ecab2cf47 \ --hash=sha256:b19c9ad992c7883ad84c9b22aaa73562a16b819c1d8db7a1a1a49fb7ec13c7d2 \ --hash=sha256:d6417535d99c37cee4091a2f24eb2b6d5ec42b144d50f1f2e436d9fe1916fe1a \ --hash=sha256:eab4dd44ce80dea27dc69db40dab62d4ca96112f87996bca68cd75639aeb2e4c \ --hash=sha256:f490dbd59680d809ca31efdae20e634f3fae27fba3ce0ba3208333b713bc3920 \ --hash=sha256:fb6e2c0b86bbd43dee042e48059c9ad7830abd5c94b0bc518c0eeec57c3eddc1 # via -r requirements.in click==8.1.7 \ --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de # via black coverage==7.6.1 \ --hash=sha256:06a737c882bd26d0d6ee7269b20b12f14a8704807a01056c80bb881a4b2ce6ca \ --hash=sha256:07e2ca0ad381b91350c0ed49d52699b625aab2b44b65e1b4e02fa9df0e92ad2d \ --hash=sha256:0c0420b573964c760df9e9e86d1a9a622d0d27f417e1a949a8a66dd7bcee7bc6 \ --hash=sha256:0dbde0f4aa9a16fa4d754356a8f2e36296ff4d83994b2c9d8398aa32f222f989 \ --hash=sha256:1125ca0e5fd475cbbba3bb67ae20bd2c23a98fac4e32412883f9bcbaa81c314c \ --hash=sha256:13b0a73a0896988f053e4fbb7de6d93388e6dd292b0d87ee51d106f2c11b465b \ --hash=sha256:166811d20dfea725e2e4baa71fffd6c968a958577848d2131f39b60043400223 \ --hash=sha256:170d444ab405852903b7d04ea9ae9b98f98ab6d7e63e1115e82620807519797f \ --hash=sha256:1f4aa8219db826ce6be7099d559f8ec311549bfc4046f7f9fe9b5cea5c581c56 \ --hash=sha256:225667980479a17db1048cb2bf8bfb39b8e5be8f164b8f6628b64f78a72cf9d3 \ --hash=sha256:260933720fdcd75340e7dbe9060655aff3af1f0c5d20f46b57f262ab6c86a5e8 \ --hash=sha256:2bdb062ea438f22d99cba0d7829c2ef0af1d768d1e4a4f528087224c90b132cb \ --hash=sha256:2c09f4ce52cb99dd7505cd0fc8e0e37c77b87f46bc9c1eb03fe3bc9991085388 \ --hash=sha256:3115a95daa9bdba70aea750db7b96b37259a81a709223c8448fa97727d546fe0 \ --hash=sha256:3e0cadcf6733c09154b461f1ca72d5416635e5e4ec4e536192180d34ec160f8a \ --hash=sha256:3f1156e3e8f2872197af3840d8ad307a9dd18e615dc64d9ee41696f287c57ad8 \ --hash=sha256:4421712dbfc5562150f7554f13dde997a2e932a6b5f352edcce948a815efee6f \ --hash=sha256:44df346d5215a8c0e360307d46ffaabe0f5d3502c8a1cefd700b34baf31d411a \ --hash=sha256:502753043567491d3ff6d08629270127e0c31d4184c4c8d98f92c26f65019962 \ --hash=sha256:547f45fa1a93154bd82050a7f3cddbc1a7a4dd2a9bf5cb7d06f4ae29fe94eaf8 \ --hash=sha256:5621a9175cf9d0b0c84c2ef2b12e9f5f5071357c4d2ea6ca1cf01814f45d2391 \ --hash=sha256:609b06f178fe8e9f89ef676532760ec0b4deea15e9969bf754b37f7c40326dbc \ --hash=sha256:645786266c8f18a931b65bfcefdbf6952dd0dea98feee39bd188607a9d307ed2 \ --hash=sha256:6878ef48d4227aace338d88c48738a4258213cd7b74fd9a3d4d7582bb1d8a155 \ --hash=sha256:6a89ecca80709d4076b95f89f308544ec8f7b4727e8a547913a35f16717856cb \ --hash=sha256:6db04803b6c7291985a761004e9060b2bca08da6d04f26a7f2294b8623a0c1a0 \ --hash=sha256:6e2cd258d7d927d09493c8df1ce9174ad01b381d4729a9d8d4e38670ca24774c \ --hash=sha256:6e81d7a3e58882450ec4186ca59a3f20a5d4440f25b1cff6f0902ad890e6748a \ --hash=sha256:702855feff378050ae4f741045e19a32d57d19f3e0676d589df0575008ea5004 \ --hash=sha256:78b260de9790fd81e69401c2dc8b17da47c8038176a79092a89cb2b7d945d060 \ --hash=sha256:7bb65125fcbef8d989fa1dd0e8a060999497629ca5b0efbca209588a73356232 \ --hash=sha256:7dea0889685db8550f839fa202744652e87c60015029ce3f60e006f8c4462c93 \ --hash=sha256:8284cf8c0dd272a247bc154eb6c95548722dce90d098c17a883ed36e67cdb129 \ --hash=sha256:877abb17e6339d96bf08e7a622d05095e72b71f8afd8a9fefc82cf30ed944163 \ --hash=sha256:8929543a7192c13d177b770008bc4e8119f2e1f881d563fc6b6305d2d0ebe9de \ --hash=sha256:8ae539519c4c040c5ffd0632784e21b2f03fc1340752af711f33e5be83a9d6c6 \ --hash=sha256:8f59d57baca39b32db42b83b2a7ba6f47ad9c394ec2076b084c3f029b7afca23 \ --hash=sha256:9054a0754de38d9dbd01a46621636689124d666bad1936d76c0341f7d71bf569 \ --hash=sha256:953510dfb7b12ab69d20135a0662397f077c59b1e6379a768e97c59d852ee51d \ --hash=sha256:95cae0efeb032af8458fc27d191f85d1717b1d4e49f7cb226cf526ff28179778 \ --hash=sha256:9bc572be474cafb617672c43fe989d6e48d3c83af02ce8de73fff1c6bb3c198d \ --hash=sha256:9c56863d44bd1c4fe2abb8a4d6f5371d197f1ac0ebdee542f07f35895fc07f36 \ --hash=sha256:9e0b2df163b8ed01d515807af24f63de04bebcecbd6c3bfeff88385789fdf75a \ --hash=sha256:a09ece4a69cf399510c8ab25e0950d9cf2b42f7b3cb0374f95d2e2ff594478a6 \ --hash=sha256:a1ac0ae2b8bd743b88ed0502544847c3053d7171a3cff9228af618a068ed9c34 \ --hash=sha256:a318d68e92e80af8b00fa99609796fdbcdfef3629c77c6283566c6f02c6d6704 \ --hash=sha256:a4acd025ecc06185ba2b801f2de85546e0b8ac787cf9d3b06e7e2a69f925b106 \ --hash=sha256:a6d3adcf24b624a7b778533480e32434a39ad8fa30c315208f6d3e5542aeb6e9 \ --hash=sha256:a78d169acd38300060b28d600344a803628c3fd585c912cacc9ea8790fe96862 \ --hash=sha256:a95324a9de9650a729239daea117df21f4b9868ce32e63f8b650ebe6cef5595b \ --hash=sha256:abd5fd0db5f4dc9289408aaf34908072f805ff7792632250dcb36dc591d24255 \ --hash=sha256:b06079abebbc0e89e6163b8e8f0e16270124c154dc6e4a47b413dd538859af16 \ --hash=sha256:b43c03669dc4618ec25270b06ecd3ee4fa94c7f9b3c14bae6571ca00ef98b0d3 \ --hash=sha256:b48f312cca9621272ae49008c7f613337c53fadca647d6384cc129d2996d1133 \ --hash=sha256:b5d7b556859dd85f3a541db6a4e0167b86e7273e1cdc973e5b175166bb634fdb \ --hash=sha256:b9f222de8cded79c49bf184bdbc06630d4c58eec9459b939b4a690c82ed05657 \ --hash=sha256:c3c02d12f837d9683e5ab2f3d9844dc57655b92c74e286c262e0fc54213c216d \ --hash=sha256:c44fee9975f04b33331cb8eb272827111efc8930cfd582e0320613263ca849ca \ --hash=sha256:cf4b19715bccd7ee27b6b120e7e9dd56037b9c0681dcc1adc9ba9db3d417fa36 \ --hash=sha256:d0c212c49b6c10e6951362f7c6df3329f04c2b1c28499563d4035d964ab8e08c \ --hash=sha256:d3296782ca4eab572a1a4eca686d8bfb00226300dcefdf43faa25b5242ab8a3e \ --hash=sha256:d85f5e9a5f8b73e2350097c3756ef7e785f55bd71205defa0bfdaf96c31616ff \ --hash=sha256:da511e6ad4f7323ee5702e6633085fb76c2f893aaf8ce4c51a0ba4fc07580ea7 \ --hash=sha256:e05882b70b87a18d937ca6768ff33cc3f72847cbc4de4491c8e73880766718e5 \ --hash=sha256:e61c0abb4c85b095a784ef23fdd4aede7a2628478e7baba7c5e3deba61070a02 \ --hash=sha256:e6a08c0be454c3b3beb105c0596ebdc2371fab6bb90c0c0297f4e58fd7e1012c \ --hash=sha256:e9a6e0eb86070e8ccaedfbd9d38fec54864f3125ab95419970575b42af7541df \ --hash=sha256:ed37bd3c3b063412f7620464a9ac1314d33100329f39799255fb8d3027da50d3 \ --hash=sha256:f1adfc8ac319e1a348af294106bc6a8458a0f1633cc62a1446aebc30c5fa186a \ --hash=sha256:f5796e664fe802da4f57a168c85359a8fbf3eab5e55cd4e4569fbacecc903959 \ --hash=sha256:fc5a77d0c516700ebad189b587de289a20a78324bc54baee03dd486f0855d234 \ --hash=sha256:fd21f6ae3f08b41004dfb433fa895d858f3f5979e7762d052b12aef444e29afc # via -r requirements.in iniconfig==2.0.0 \ --hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \ --hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374 # via pytest mypy-extensions==1.0.0 \ --hash=sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d \ --hash=sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782 # via black packaging==24.1 \ --hash=sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002 \ --hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124 # via # black # pytest pathspec==0.12.1 \ --hash=sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08 \ --hash=sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712 # via black platformdirs==4.3.1 \ --hash=sha256:63b79589009fa8159973601dd4563143396b35c5f93a58b36f9049ff046949b1 \ --hash=sha256:facaa5a3c57aa1e053e3da7b49e0cc31fe0113ca42a4659d5c2e98e545624afe # via black pluggy==1.5.0 \ --hash=sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1 \ --hash=sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669 # via pytest pytest==8.3.2 \ --hash=sha256:4ba08f9ae7dcf84ded419494d229b48d0903ea6407b030eaec46df5e6a73bba5 \ --hash=sha256:c132345d12ce551242c87269de812483f5bcc87cdbb4722e48487ba194f9fdce # via # -r requirements.in # pytest-randomly pytest-randomly==3.15.0 \ --hash=sha256:0516f4344b29f4e9cdae8bce31c4aeebf59d0b9ef05927c33354ff3859eeeca6 \ --hash=sha256:b908529648667ba5e54723088edd6f82252f540cc340d748d1fa985539687047 # via -r requirements.in python-blacken-docs-1.19.1/tests/requirements/py312.txt000066400000000000000000000236441470626533400227760ustar00rootroot00000000000000# This file was autogenerated by uv via the following command: # uv pip compile --generate-hashes requirements.in --python 3.12 --output-file py312.txt black==24.8.0 \ --hash=sha256:09cdeb74d494ec023ded657f7092ba518e8cf78fa8386155e4a03fdcc44679e6 \ --hash=sha256:1f13f7f386f86f8121d76599114bb8c17b69d962137fc70efe56137727c7047e \ --hash=sha256:2500945420b6784c38b9ee885af039f5e7471ef284ab03fa35ecdde4688cd83f \ --hash=sha256:2b59b250fdba5f9a9cd9d0ece6e6d993d91ce877d121d161e4698af3eb9c1018 \ --hash=sha256:3c4285573d4897a7610054af5a890bde7c65cb466040c5f0c8b732812d7f0e5e \ --hash=sha256:505289f17ceda596658ae81b61ebbe2d9b25aa78067035184ed0a9d855d18afd \ --hash=sha256:62e8730977f0b77998029da7971fa896ceefa2c4c4933fcd593fa599ecbf97a4 \ --hash=sha256:649f6d84ccbae73ab767e206772cc2d7a393a001070a4c814a546afd0d423aed \ --hash=sha256:6e55d30d44bed36593c3163b9bc63bf58b3b30e4611e4d88a0c3c239930ed5b2 \ --hash=sha256:707a1ca89221bc8a1a64fb5e15ef39cd755633daa672a9db7498d1c19de66a42 \ --hash=sha256:72901b4913cbac8972ad911dc4098d5753704d1f3c56e44ae8dce99eecb0e3af \ --hash=sha256:73bbf84ed136e45d451a260c6b73ed674652f90a2b3211d6a35e78054563a9bb \ --hash=sha256:7c046c1d1eeb7aea9335da62472481d3bbf3fd986e093cffd35f4385c94ae368 \ --hash=sha256:81c6742da39f33b08e791da38410f32e27d632260e599df7245cccee2064afeb \ --hash=sha256:837fd281f1908d0076844bc2b801ad2d369c78c45cf800cad7b61686051041af \ --hash=sha256:972085c618ee94f402da1af548a4f218c754ea7e5dc70acb168bfaca4c2542ed \ --hash=sha256:9e84e33b37be070ba135176c123ae52a51f82306def9f7d063ee302ecab2cf47 \ --hash=sha256:b19c9ad992c7883ad84c9b22aaa73562a16b819c1d8db7a1a1a49fb7ec13c7d2 \ --hash=sha256:d6417535d99c37cee4091a2f24eb2b6d5ec42b144d50f1f2e436d9fe1916fe1a \ --hash=sha256:eab4dd44ce80dea27dc69db40dab62d4ca96112f87996bca68cd75639aeb2e4c \ --hash=sha256:f490dbd59680d809ca31efdae20e634f3fae27fba3ce0ba3208333b713bc3920 \ --hash=sha256:fb6e2c0b86bbd43dee042e48059c9ad7830abd5c94b0bc518c0eeec57c3eddc1 # via -r requirements.in click==8.1.7 \ --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de # via black coverage==7.6.1 \ --hash=sha256:06a737c882bd26d0d6ee7269b20b12f14a8704807a01056c80bb881a4b2ce6ca \ --hash=sha256:07e2ca0ad381b91350c0ed49d52699b625aab2b44b65e1b4e02fa9df0e92ad2d \ --hash=sha256:0c0420b573964c760df9e9e86d1a9a622d0d27f417e1a949a8a66dd7bcee7bc6 \ --hash=sha256:0dbde0f4aa9a16fa4d754356a8f2e36296ff4d83994b2c9d8398aa32f222f989 \ --hash=sha256:1125ca0e5fd475cbbba3bb67ae20bd2c23a98fac4e32412883f9bcbaa81c314c \ --hash=sha256:13b0a73a0896988f053e4fbb7de6d93388e6dd292b0d87ee51d106f2c11b465b \ --hash=sha256:166811d20dfea725e2e4baa71fffd6c968a958577848d2131f39b60043400223 \ --hash=sha256:170d444ab405852903b7d04ea9ae9b98f98ab6d7e63e1115e82620807519797f \ --hash=sha256:1f4aa8219db826ce6be7099d559f8ec311549bfc4046f7f9fe9b5cea5c581c56 \ --hash=sha256:225667980479a17db1048cb2bf8bfb39b8e5be8f164b8f6628b64f78a72cf9d3 \ --hash=sha256:260933720fdcd75340e7dbe9060655aff3af1f0c5d20f46b57f262ab6c86a5e8 \ --hash=sha256:2bdb062ea438f22d99cba0d7829c2ef0af1d768d1e4a4f528087224c90b132cb \ --hash=sha256:2c09f4ce52cb99dd7505cd0fc8e0e37c77b87f46bc9c1eb03fe3bc9991085388 \ --hash=sha256:3115a95daa9bdba70aea750db7b96b37259a81a709223c8448fa97727d546fe0 \ --hash=sha256:3e0cadcf6733c09154b461f1ca72d5416635e5e4ec4e536192180d34ec160f8a \ --hash=sha256:3f1156e3e8f2872197af3840d8ad307a9dd18e615dc64d9ee41696f287c57ad8 \ --hash=sha256:4421712dbfc5562150f7554f13dde997a2e932a6b5f352edcce948a815efee6f \ --hash=sha256:44df346d5215a8c0e360307d46ffaabe0f5d3502c8a1cefd700b34baf31d411a \ --hash=sha256:502753043567491d3ff6d08629270127e0c31d4184c4c8d98f92c26f65019962 \ --hash=sha256:547f45fa1a93154bd82050a7f3cddbc1a7a4dd2a9bf5cb7d06f4ae29fe94eaf8 \ --hash=sha256:5621a9175cf9d0b0c84c2ef2b12e9f5f5071357c4d2ea6ca1cf01814f45d2391 \ --hash=sha256:609b06f178fe8e9f89ef676532760ec0b4deea15e9969bf754b37f7c40326dbc \ --hash=sha256:645786266c8f18a931b65bfcefdbf6952dd0dea98feee39bd188607a9d307ed2 \ --hash=sha256:6878ef48d4227aace338d88c48738a4258213cd7b74fd9a3d4d7582bb1d8a155 \ --hash=sha256:6a89ecca80709d4076b95f89f308544ec8f7b4727e8a547913a35f16717856cb \ --hash=sha256:6db04803b6c7291985a761004e9060b2bca08da6d04f26a7f2294b8623a0c1a0 \ --hash=sha256:6e2cd258d7d927d09493c8df1ce9174ad01b381d4729a9d8d4e38670ca24774c \ --hash=sha256:6e81d7a3e58882450ec4186ca59a3f20a5d4440f25b1cff6f0902ad890e6748a \ --hash=sha256:702855feff378050ae4f741045e19a32d57d19f3e0676d589df0575008ea5004 \ --hash=sha256:78b260de9790fd81e69401c2dc8b17da47c8038176a79092a89cb2b7d945d060 \ --hash=sha256:7bb65125fcbef8d989fa1dd0e8a060999497629ca5b0efbca209588a73356232 \ --hash=sha256:7dea0889685db8550f839fa202744652e87c60015029ce3f60e006f8c4462c93 \ --hash=sha256:8284cf8c0dd272a247bc154eb6c95548722dce90d098c17a883ed36e67cdb129 \ --hash=sha256:877abb17e6339d96bf08e7a622d05095e72b71f8afd8a9fefc82cf30ed944163 \ --hash=sha256:8929543a7192c13d177b770008bc4e8119f2e1f881d563fc6b6305d2d0ebe9de \ --hash=sha256:8ae539519c4c040c5ffd0632784e21b2f03fc1340752af711f33e5be83a9d6c6 \ --hash=sha256:8f59d57baca39b32db42b83b2a7ba6f47ad9c394ec2076b084c3f029b7afca23 \ --hash=sha256:9054a0754de38d9dbd01a46621636689124d666bad1936d76c0341f7d71bf569 \ --hash=sha256:953510dfb7b12ab69d20135a0662397f077c59b1e6379a768e97c59d852ee51d \ --hash=sha256:95cae0efeb032af8458fc27d191f85d1717b1d4e49f7cb226cf526ff28179778 \ --hash=sha256:9bc572be474cafb617672c43fe989d6e48d3c83af02ce8de73fff1c6bb3c198d \ --hash=sha256:9c56863d44bd1c4fe2abb8a4d6f5371d197f1ac0ebdee542f07f35895fc07f36 \ --hash=sha256:9e0b2df163b8ed01d515807af24f63de04bebcecbd6c3bfeff88385789fdf75a \ --hash=sha256:a09ece4a69cf399510c8ab25e0950d9cf2b42f7b3cb0374f95d2e2ff594478a6 \ --hash=sha256:a1ac0ae2b8bd743b88ed0502544847c3053d7171a3cff9228af618a068ed9c34 \ --hash=sha256:a318d68e92e80af8b00fa99609796fdbcdfef3629c77c6283566c6f02c6d6704 \ --hash=sha256:a4acd025ecc06185ba2b801f2de85546e0b8ac787cf9d3b06e7e2a69f925b106 \ --hash=sha256:a6d3adcf24b624a7b778533480e32434a39ad8fa30c315208f6d3e5542aeb6e9 \ --hash=sha256:a78d169acd38300060b28d600344a803628c3fd585c912cacc9ea8790fe96862 \ --hash=sha256:a95324a9de9650a729239daea117df21f4b9868ce32e63f8b650ebe6cef5595b \ --hash=sha256:abd5fd0db5f4dc9289408aaf34908072f805ff7792632250dcb36dc591d24255 \ --hash=sha256:b06079abebbc0e89e6163b8e8f0e16270124c154dc6e4a47b413dd538859af16 \ --hash=sha256:b43c03669dc4618ec25270b06ecd3ee4fa94c7f9b3c14bae6571ca00ef98b0d3 \ --hash=sha256:b48f312cca9621272ae49008c7f613337c53fadca647d6384cc129d2996d1133 \ --hash=sha256:b5d7b556859dd85f3a541db6a4e0167b86e7273e1cdc973e5b175166bb634fdb \ --hash=sha256:b9f222de8cded79c49bf184bdbc06630d4c58eec9459b939b4a690c82ed05657 \ --hash=sha256:c3c02d12f837d9683e5ab2f3d9844dc57655b92c74e286c262e0fc54213c216d \ --hash=sha256:c44fee9975f04b33331cb8eb272827111efc8930cfd582e0320613263ca849ca \ --hash=sha256:cf4b19715bccd7ee27b6b120e7e9dd56037b9c0681dcc1adc9ba9db3d417fa36 \ --hash=sha256:d0c212c49b6c10e6951362f7c6df3329f04c2b1c28499563d4035d964ab8e08c \ --hash=sha256:d3296782ca4eab572a1a4eca686d8bfb00226300dcefdf43faa25b5242ab8a3e \ --hash=sha256:d85f5e9a5f8b73e2350097c3756ef7e785f55bd71205defa0bfdaf96c31616ff \ --hash=sha256:da511e6ad4f7323ee5702e6633085fb76c2f893aaf8ce4c51a0ba4fc07580ea7 \ --hash=sha256:e05882b70b87a18d937ca6768ff33cc3f72847cbc4de4491c8e73880766718e5 \ --hash=sha256:e61c0abb4c85b095a784ef23fdd4aede7a2628478e7baba7c5e3deba61070a02 \ --hash=sha256:e6a08c0be454c3b3beb105c0596ebdc2371fab6bb90c0c0297f4e58fd7e1012c \ --hash=sha256:e9a6e0eb86070e8ccaedfbd9d38fec54864f3125ab95419970575b42af7541df \ --hash=sha256:ed37bd3c3b063412f7620464a9ac1314d33100329f39799255fb8d3027da50d3 \ --hash=sha256:f1adfc8ac319e1a348af294106bc6a8458a0f1633cc62a1446aebc30c5fa186a \ --hash=sha256:f5796e664fe802da4f57a168c85359a8fbf3eab5e55cd4e4569fbacecc903959 \ --hash=sha256:fc5a77d0c516700ebad189b587de289a20a78324bc54baee03dd486f0855d234 \ --hash=sha256:fd21f6ae3f08b41004dfb433fa895d858f3f5979e7762d052b12aef444e29afc # via -r requirements.in iniconfig==2.0.0 \ --hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \ --hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374 # via pytest mypy-extensions==1.0.0 \ --hash=sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d \ --hash=sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782 # via black packaging==24.1 \ --hash=sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002 \ --hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124 # via # black # pytest pathspec==0.12.1 \ --hash=sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08 \ --hash=sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712 # via black platformdirs==4.3.1 \ --hash=sha256:63b79589009fa8159973601dd4563143396b35c5f93a58b36f9049ff046949b1 \ --hash=sha256:facaa5a3c57aa1e053e3da7b49e0cc31fe0113ca42a4659d5c2e98e545624afe # via black pluggy==1.5.0 \ --hash=sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1 \ --hash=sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669 # via pytest pytest==8.3.2 \ --hash=sha256:4ba08f9ae7dcf84ded419494d229b48d0903ea6407b030eaec46df5e6a73bba5 \ --hash=sha256:c132345d12ce551242c87269de812483f5bcc87cdbb4722e48487ba194f9fdce # via # -r requirements.in # pytest-randomly pytest-randomly==3.15.0 \ --hash=sha256:0516f4344b29f4e9cdae8bce31c4aeebf59d0b9ef05927c33354ff3859eeeca6 \ --hash=sha256:b908529648667ba5e54723088edd6f82252f540cc340d748d1fa985539687047 # via -r requirements.in python-blacken-docs-1.19.1/tests/requirements/py313.txt000066400000000000000000000236441470626533400227770ustar00rootroot00000000000000# This file was autogenerated by uv via the following command: # uv pip compile --generate-hashes requirements.in --python 3.13 --output-file py313.txt black==24.8.0 \ --hash=sha256:09cdeb74d494ec023ded657f7092ba518e8cf78fa8386155e4a03fdcc44679e6 \ --hash=sha256:1f13f7f386f86f8121d76599114bb8c17b69d962137fc70efe56137727c7047e \ --hash=sha256:2500945420b6784c38b9ee885af039f5e7471ef284ab03fa35ecdde4688cd83f \ --hash=sha256:2b59b250fdba5f9a9cd9d0ece6e6d993d91ce877d121d161e4698af3eb9c1018 \ --hash=sha256:3c4285573d4897a7610054af5a890bde7c65cb466040c5f0c8b732812d7f0e5e \ --hash=sha256:505289f17ceda596658ae81b61ebbe2d9b25aa78067035184ed0a9d855d18afd \ --hash=sha256:62e8730977f0b77998029da7971fa896ceefa2c4c4933fcd593fa599ecbf97a4 \ --hash=sha256:649f6d84ccbae73ab767e206772cc2d7a393a001070a4c814a546afd0d423aed \ --hash=sha256:6e55d30d44bed36593c3163b9bc63bf58b3b30e4611e4d88a0c3c239930ed5b2 \ --hash=sha256:707a1ca89221bc8a1a64fb5e15ef39cd755633daa672a9db7498d1c19de66a42 \ --hash=sha256:72901b4913cbac8972ad911dc4098d5753704d1f3c56e44ae8dce99eecb0e3af \ --hash=sha256:73bbf84ed136e45d451a260c6b73ed674652f90a2b3211d6a35e78054563a9bb \ --hash=sha256:7c046c1d1eeb7aea9335da62472481d3bbf3fd986e093cffd35f4385c94ae368 \ --hash=sha256:81c6742da39f33b08e791da38410f32e27d632260e599df7245cccee2064afeb \ --hash=sha256:837fd281f1908d0076844bc2b801ad2d369c78c45cf800cad7b61686051041af \ --hash=sha256:972085c618ee94f402da1af548a4f218c754ea7e5dc70acb168bfaca4c2542ed \ --hash=sha256:9e84e33b37be070ba135176c123ae52a51f82306def9f7d063ee302ecab2cf47 \ --hash=sha256:b19c9ad992c7883ad84c9b22aaa73562a16b819c1d8db7a1a1a49fb7ec13c7d2 \ --hash=sha256:d6417535d99c37cee4091a2f24eb2b6d5ec42b144d50f1f2e436d9fe1916fe1a \ --hash=sha256:eab4dd44ce80dea27dc69db40dab62d4ca96112f87996bca68cd75639aeb2e4c \ --hash=sha256:f490dbd59680d809ca31efdae20e634f3fae27fba3ce0ba3208333b713bc3920 \ --hash=sha256:fb6e2c0b86bbd43dee042e48059c9ad7830abd5c94b0bc518c0eeec57c3eddc1 # via -r requirements.in click==8.1.7 \ --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de # via black coverage==7.6.1 \ --hash=sha256:06a737c882bd26d0d6ee7269b20b12f14a8704807a01056c80bb881a4b2ce6ca \ --hash=sha256:07e2ca0ad381b91350c0ed49d52699b625aab2b44b65e1b4e02fa9df0e92ad2d \ --hash=sha256:0c0420b573964c760df9e9e86d1a9a622d0d27f417e1a949a8a66dd7bcee7bc6 \ --hash=sha256:0dbde0f4aa9a16fa4d754356a8f2e36296ff4d83994b2c9d8398aa32f222f989 \ --hash=sha256:1125ca0e5fd475cbbba3bb67ae20bd2c23a98fac4e32412883f9bcbaa81c314c \ --hash=sha256:13b0a73a0896988f053e4fbb7de6d93388e6dd292b0d87ee51d106f2c11b465b \ --hash=sha256:166811d20dfea725e2e4baa71fffd6c968a958577848d2131f39b60043400223 \ --hash=sha256:170d444ab405852903b7d04ea9ae9b98f98ab6d7e63e1115e82620807519797f \ --hash=sha256:1f4aa8219db826ce6be7099d559f8ec311549bfc4046f7f9fe9b5cea5c581c56 \ --hash=sha256:225667980479a17db1048cb2bf8bfb39b8e5be8f164b8f6628b64f78a72cf9d3 \ --hash=sha256:260933720fdcd75340e7dbe9060655aff3af1f0c5d20f46b57f262ab6c86a5e8 \ --hash=sha256:2bdb062ea438f22d99cba0d7829c2ef0af1d768d1e4a4f528087224c90b132cb \ --hash=sha256:2c09f4ce52cb99dd7505cd0fc8e0e37c77b87f46bc9c1eb03fe3bc9991085388 \ --hash=sha256:3115a95daa9bdba70aea750db7b96b37259a81a709223c8448fa97727d546fe0 \ --hash=sha256:3e0cadcf6733c09154b461f1ca72d5416635e5e4ec4e536192180d34ec160f8a \ --hash=sha256:3f1156e3e8f2872197af3840d8ad307a9dd18e615dc64d9ee41696f287c57ad8 \ --hash=sha256:4421712dbfc5562150f7554f13dde997a2e932a6b5f352edcce948a815efee6f \ --hash=sha256:44df346d5215a8c0e360307d46ffaabe0f5d3502c8a1cefd700b34baf31d411a \ --hash=sha256:502753043567491d3ff6d08629270127e0c31d4184c4c8d98f92c26f65019962 \ --hash=sha256:547f45fa1a93154bd82050a7f3cddbc1a7a4dd2a9bf5cb7d06f4ae29fe94eaf8 \ --hash=sha256:5621a9175cf9d0b0c84c2ef2b12e9f5f5071357c4d2ea6ca1cf01814f45d2391 \ --hash=sha256:609b06f178fe8e9f89ef676532760ec0b4deea15e9969bf754b37f7c40326dbc \ --hash=sha256:645786266c8f18a931b65bfcefdbf6952dd0dea98feee39bd188607a9d307ed2 \ --hash=sha256:6878ef48d4227aace338d88c48738a4258213cd7b74fd9a3d4d7582bb1d8a155 \ --hash=sha256:6a89ecca80709d4076b95f89f308544ec8f7b4727e8a547913a35f16717856cb \ --hash=sha256:6db04803b6c7291985a761004e9060b2bca08da6d04f26a7f2294b8623a0c1a0 \ --hash=sha256:6e2cd258d7d927d09493c8df1ce9174ad01b381d4729a9d8d4e38670ca24774c \ --hash=sha256:6e81d7a3e58882450ec4186ca59a3f20a5d4440f25b1cff6f0902ad890e6748a \ --hash=sha256:702855feff378050ae4f741045e19a32d57d19f3e0676d589df0575008ea5004 \ --hash=sha256:78b260de9790fd81e69401c2dc8b17da47c8038176a79092a89cb2b7d945d060 \ --hash=sha256:7bb65125fcbef8d989fa1dd0e8a060999497629ca5b0efbca209588a73356232 \ --hash=sha256:7dea0889685db8550f839fa202744652e87c60015029ce3f60e006f8c4462c93 \ --hash=sha256:8284cf8c0dd272a247bc154eb6c95548722dce90d098c17a883ed36e67cdb129 \ --hash=sha256:877abb17e6339d96bf08e7a622d05095e72b71f8afd8a9fefc82cf30ed944163 \ --hash=sha256:8929543a7192c13d177b770008bc4e8119f2e1f881d563fc6b6305d2d0ebe9de \ --hash=sha256:8ae539519c4c040c5ffd0632784e21b2f03fc1340752af711f33e5be83a9d6c6 \ --hash=sha256:8f59d57baca39b32db42b83b2a7ba6f47ad9c394ec2076b084c3f029b7afca23 \ --hash=sha256:9054a0754de38d9dbd01a46621636689124d666bad1936d76c0341f7d71bf569 \ --hash=sha256:953510dfb7b12ab69d20135a0662397f077c59b1e6379a768e97c59d852ee51d \ --hash=sha256:95cae0efeb032af8458fc27d191f85d1717b1d4e49f7cb226cf526ff28179778 \ --hash=sha256:9bc572be474cafb617672c43fe989d6e48d3c83af02ce8de73fff1c6bb3c198d \ --hash=sha256:9c56863d44bd1c4fe2abb8a4d6f5371d197f1ac0ebdee542f07f35895fc07f36 \ --hash=sha256:9e0b2df163b8ed01d515807af24f63de04bebcecbd6c3bfeff88385789fdf75a \ --hash=sha256:a09ece4a69cf399510c8ab25e0950d9cf2b42f7b3cb0374f95d2e2ff594478a6 \ --hash=sha256:a1ac0ae2b8bd743b88ed0502544847c3053d7171a3cff9228af618a068ed9c34 \ --hash=sha256:a318d68e92e80af8b00fa99609796fdbcdfef3629c77c6283566c6f02c6d6704 \ --hash=sha256:a4acd025ecc06185ba2b801f2de85546e0b8ac787cf9d3b06e7e2a69f925b106 \ --hash=sha256:a6d3adcf24b624a7b778533480e32434a39ad8fa30c315208f6d3e5542aeb6e9 \ --hash=sha256:a78d169acd38300060b28d600344a803628c3fd585c912cacc9ea8790fe96862 \ --hash=sha256:a95324a9de9650a729239daea117df21f4b9868ce32e63f8b650ebe6cef5595b \ --hash=sha256:abd5fd0db5f4dc9289408aaf34908072f805ff7792632250dcb36dc591d24255 \ --hash=sha256:b06079abebbc0e89e6163b8e8f0e16270124c154dc6e4a47b413dd538859af16 \ --hash=sha256:b43c03669dc4618ec25270b06ecd3ee4fa94c7f9b3c14bae6571ca00ef98b0d3 \ --hash=sha256:b48f312cca9621272ae49008c7f613337c53fadca647d6384cc129d2996d1133 \ --hash=sha256:b5d7b556859dd85f3a541db6a4e0167b86e7273e1cdc973e5b175166bb634fdb \ --hash=sha256:b9f222de8cded79c49bf184bdbc06630d4c58eec9459b939b4a690c82ed05657 \ --hash=sha256:c3c02d12f837d9683e5ab2f3d9844dc57655b92c74e286c262e0fc54213c216d \ --hash=sha256:c44fee9975f04b33331cb8eb272827111efc8930cfd582e0320613263ca849ca \ --hash=sha256:cf4b19715bccd7ee27b6b120e7e9dd56037b9c0681dcc1adc9ba9db3d417fa36 \ --hash=sha256:d0c212c49b6c10e6951362f7c6df3329f04c2b1c28499563d4035d964ab8e08c \ --hash=sha256:d3296782ca4eab572a1a4eca686d8bfb00226300dcefdf43faa25b5242ab8a3e \ --hash=sha256:d85f5e9a5f8b73e2350097c3756ef7e785f55bd71205defa0bfdaf96c31616ff \ --hash=sha256:da511e6ad4f7323ee5702e6633085fb76c2f893aaf8ce4c51a0ba4fc07580ea7 \ --hash=sha256:e05882b70b87a18d937ca6768ff33cc3f72847cbc4de4491c8e73880766718e5 \ --hash=sha256:e61c0abb4c85b095a784ef23fdd4aede7a2628478e7baba7c5e3deba61070a02 \ --hash=sha256:e6a08c0be454c3b3beb105c0596ebdc2371fab6bb90c0c0297f4e58fd7e1012c \ --hash=sha256:e9a6e0eb86070e8ccaedfbd9d38fec54864f3125ab95419970575b42af7541df \ --hash=sha256:ed37bd3c3b063412f7620464a9ac1314d33100329f39799255fb8d3027da50d3 \ --hash=sha256:f1adfc8ac319e1a348af294106bc6a8458a0f1633cc62a1446aebc30c5fa186a \ --hash=sha256:f5796e664fe802da4f57a168c85359a8fbf3eab5e55cd4e4569fbacecc903959 \ --hash=sha256:fc5a77d0c516700ebad189b587de289a20a78324bc54baee03dd486f0855d234 \ --hash=sha256:fd21f6ae3f08b41004dfb433fa895d858f3f5979e7762d052b12aef444e29afc # via -r requirements.in iniconfig==2.0.0 \ --hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \ --hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374 # via pytest mypy-extensions==1.0.0 \ --hash=sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d \ --hash=sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782 # via black packaging==24.1 \ --hash=sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002 \ --hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124 # via # black # pytest pathspec==0.12.1 \ --hash=sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08 \ --hash=sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712 # via black platformdirs==4.3.2 \ --hash=sha256:9e5e27a08aa095dd127b9f2e764d74254f482fef22b0970773bfba79d091ab8c \ --hash=sha256:eb1c8582560b34ed4ba105009a4badf7f6f85768b30126f351328507b2beb617 # via black pluggy==1.5.0 \ --hash=sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1 \ --hash=sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669 # via pytest pytest==8.3.2 \ --hash=sha256:4ba08f9ae7dcf84ded419494d229b48d0903ea6407b030eaec46df5e6a73bba5 \ --hash=sha256:c132345d12ce551242c87269de812483f5bcc87cdbb4722e48487ba194f9fdce # via # -r requirements.in # pytest-randomly pytest-randomly==3.15.0 \ --hash=sha256:0516f4344b29f4e9cdae8bce31c4aeebf59d0b9ef05927c33354ff3859eeeca6 \ --hash=sha256:b908529648667ba5e54723088edd6f82252f540cc340d748d1fa985539687047 # via -r requirements.in python-blacken-docs-1.19.1/tests/requirements/py39.txt000066400000000000000000000257501470626533400227240ustar00rootroot00000000000000# This file was autogenerated by uv via the following command: # uv pip compile --generate-hashes requirements.in --python 3.9 --output-file py39.txt black==24.8.0 \ --hash=sha256:09cdeb74d494ec023ded657f7092ba518e8cf78fa8386155e4a03fdcc44679e6 \ --hash=sha256:1f13f7f386f86f8121d76599114bb8c17b69d962137fc70efe56137727c7047e \ --hash=sha256:2500945420b6784c38b9ee885af039f5e7471ef284ab03fa35ecdde4688cd83f \ --hash=sha256:2b59b250fdba5f9a9cd9d0ece6e6d993d91ce877d121d161e4698af3eb9c1018 \ --hash=sha256:3c4285573d4897a7610054af5a890bde7c65cb466040c5f0c8b732812d7f0e5e \ --hash=sha256:505289f17ceda596658ae81b61ebbe2d9b25aa78067035184ed0a9d855d18afd \ --hash=sha256:62e8730977f0b77998029da7971fa896ceefa2c4c4933fcd593fa599ecbf97a4 \ --hash=sha256:649f6d84ccbae73ab767e206772cc2d7a393a001070a4c814a546afd0d423aed \ --hash=sha256:6e55d30d44bed36593c3163b9bc63bf58b3b30e4611e4d88a0c3c239930ed5b2 \ --hash=sha256:707a1ca89221bc8a1a64fb5e15ef39cd755633daa672a9db7498d1c19de66a42 \ --hash=sha256:72901b4913cbac8972ad911dc4098d5753704d1f3c56e44ae8dce99eecb0e3af \ --hash=sha256:73bbf84ed136e45d451a260c6b73ed674652f90a2b3211d6a35e78054563a9bb \ --hash=sha256:7c046c1d1eeb7aea9335da62472481d3bbf3fd986e093cffd35f4385c94ae368 \ --hash=sha256:81c6742da39f33b08e791da38410f32e27d632260e599df7245cccee2064afeb \ --hash=sha256:837fd281f1908d0076844bc2b801ad2d369c78c45cf800cad7b61686051041af \ --hash=sha256:972085c618ee94f402da1af548a4f218c754ea7e5dc70acb168bfaca4c2542ed \ --hash=sha256:9e84e33b37be070ba135176c123ae52a51f82306def9f7d063ee302ecab2cf47 \ --hash=sha256:b19c9ad992c7883ad84c9b22aaa73562a16b819c1d8db7a1a1a49fb7ec13c7d2 \ --hash=sha256:d6417535d99c37cee4091a2f24eb2b6d5ec42b144d50f1f2e436d9fe1916fe1a \ --hash=sha256:eab4dd44ce80dea27dc69db40dab62d4ca96112f87996bca68cd75639aeb2e4c \ --hash=sha256:f490dbd59680d809ca31efdae20e634f3fae27fba3ce0ba3208333b713bc3920 \ --hash=sha256:fb6e2c0b86bbd43dee042e48059c9ad7830abd5c94b0bc518c0eeec57c3eddc1 # via -r requirements.in click==8.1.7 \ --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de # via black coverage==7.6.1 \ --hash=sha256:06a737c882bd26d0d6ee7269b20b12f14a8704807a01056c80bb881a4b2ce6ca \ --hash=sha256:07e2ca0ad381b91350c0ed49d52699b625aab2b44b65e1b4e02fa9df0e92ad2d \ --hash=sha256:0c0420b573964c760df9e9e86d1a9a622d0d27f417e1a949a8a66dd7bcee7bc6 \ --hash=sha256:0dbde0f4aa9a16fa4d754356a8f2e36296ff4d83994b2c9d8398aa32f222f989 \ --hash=sha256:1125ca0e5fd475cbbba3bb67ae20bd2c23a98fac4e32412883f9bcbaa81c314c \ --hash=sha256:13b0a73a0896988f053e4fbb7de6d93388e6dd292b0d87ee51d106f2c11b465b \ --hash=sha256:166811d20dfea725e2e4baa71fffd6c968a958577848d2131f39b60043400223 \ --hash=sha256:170d444ab405852903b7d04ea9ae9b98f98ab6d7e63e1115e82620807519797f \ --hash=sha256:1f4aa8219db826ce6be7099d559f8ec311549bfc4046f7f9fe9b5cea5c581c56 \ --hash=sha256:225667980479a17db1048cb2bf8bfb39b8e5be8f164b8f6628b64f78a72cf9d3 \ --hash=sha256:260933720fdcd75340e7dbe9060655aff3af1f0c5d20f46b57f262ab6c86a5e8 \ --hash=sha256:2bdb062ea438f22d99cba0d7829c2ef0af1d768d1e4a4f528087224c90b132cb \ --hash=sha256:2c09f4ce52cb99dd7505cd0fc8e0e37c77b87f46bc9c1eb03fe3bc9991085388 \ --hash=sha256:3115a95daa9bdba70aea750db7b96b37259a81a709223c8448fa97727d546fe0 \ --hash=sha256:3e0cadcf6733c09154b461f1ca72d5416635e5e4ec4e536192180d34ec160f8a \ --hash=sha256:3f1156e3e8f2872197af3840d8ad307a9dd18e615dc64d9ee41696f287c57ad8 \ --hash=sha256:4421712dbfc5562150f7554f13dde997a2e932a6b5f352edcce948a815efee6f \ --hash=sha256:44df346d5215a8c0e360307d46ffaabe0f5d3502c8a1cefd700b34baf31d411a \ --hash=sha256:502753043567491d3ff6d08629270127e0c31d4184c4c8d98f92c26f65019962 \ --hash=sha256:547f45fa1a93154bd82050a7f3cddbc1a7a4dd2a9bf5cb7d06f4ae29fe94eaf8 \ --hash=sha256:5621a9175cf9d0b0c84c2ef2b12e9f5f5071357c4d2ea6ca1cf01814f45d2391 \ --hash=sha256:609b06f178fe8e9f89ef676532760ec0b4deea15e9969bf754b37f7c40326dbc \ --hash=sha256:645786266c8f18a931b65bfcefdbf6952dd0dea98feee39bd188607a9d307ed2 \ --hash=sha256:6878ef48d4227aace338d88c48738a4258213cd7b74fd9a3d4d7582bb1d8a155 \ --hash=sha256:6a89ecca80709d4076b95f89f308544ec8f7b4727e8a547913a35f16717856cb \ --hash=sha256:6db04803b6c7291985a761004e9060b2bca08da6d04f26a7f2294b8623a0c1a0 \ --hash=sha256:6e2cd258d7d927d09493c8df1ce9174ad01b381d4729a9d8d4e38670ca24774c \ --hash=sha256:6e81d7a3e58882450ec4186ca59a3f20a5d4440f25b1cff6f0902ad890e6748a \ --hash=sha256:702855feff378050ae4f741045e19a32d57d19f3e0676d589df0575008ea5004 \ --hash=sha256:78b260de9790fd81e69401c2dc8b17da47c8038176a79092a89cb2b7d945d060 \ --hash=sha256:7bb65125fcbef8d989fa1dd0e8a060999497629ca5b0efbca209588a73356232 \ --hash=sha256:7dea0889685db8550f839fa202744652e87c60015029ce3f60e006f8c4462c93 \ --hash=sha256:8284cf8c0dd272a247bc154eb6c95548722dce90d098c17a883ed36e67cdb129 \ --hash=sha256:877abb17e6339d96bf08e7a622d05095e72b71f8afd8a9fefc82cf30ed944163 \ --hash=sha256:8929543a7192c13d177b770008bc4e8119f2e1f881d563fc6b6305d2d0ebe9de \ --hash=sha256:8ae539519c4c040c5ffd0632784e21b2f03fc1340752af711f33e5be83a9d6c6 \ --hash=sha256:8f59d57baca39b32db42b83b2a7ba6f47ad9c394ec2076b084c3f029b7afca23 \ --hash=sha256:9054a0754de38d9dbd01a46621636689124d666bad1936d76c0341f7d71bf569 \ --hash=sha256:953510dfb7b12ab69d20135a0662397f077c59b1e6379a768e97c59d852ee51d \ --hash=sha256:95cae0efeb032af8458fc27d191f85d1717b1d4e49f7cb226cf526ff28179778 \ --hash=sha256:9bc572be474cafb617672c43fe989d6e48d3c83af02ce8de73fff1c6bb3c198d \ --hash=sha256:9c56863d44bd1c4fe2abb8a4d6f5371d197f1ac0ebdee542f07f35895fc07f36 \ --hash=sha256:9e0b2df163b8ed01d515807af24f63de04bebcecbd6c3bfeff88385789fdf75a \ --hash=sha256:a09ece4a69cf399510c8ab25e0950d9cf2b42f7b3cb0374f95d2e2ff594478a6 \ --hash=sha256:a1ac0ae2b8bd743b88ed0502544847c3053d7171a3cff9228af618a068ed9c34 \ --hash=sha256:a318d68e92e80af8b00fa99609796fdbcdfef3629c77c6283566c6f02c6d6704 \ --hash=sha256:a4acd025ecc06185ba2b801f2de85546e0b8ac787cf9d3b06e7e2a69f925b106 \ --hash=sha256:a6d3adcf24b624a7b778533480e32434a39ad8fa30c315208f6d3e5542aeb6e9 \ --hash=sha256:a78d169acd38300060b28d600344a803628c3fd585c912cacc9ea8790fe96862 \ --hash=sha256:a95324a9de9650a729239daea117df21f4b9868ce32e63f8b650ebe6cef5595b \ --hash=sha256:abd5fd0db5f4dc9289408aaf34908072f805ff7792632250dcb36dc591d24255 \ --hash=sha256:b06079abebbc0e89e6163b8e8f0e16270124c154dc6e4a47b413dd538859af16 \ --hash=sha256:b43c03669dc4618ec25270b06ecd3ee4fa94c7f9b3c14bae6571ca00ef98b0d3 \ --hash=sha256:b48f312cca9621272ae49008c7f613337c53fadca647d6384cc129d2996d1133 \ --hash=sha256:b5d7b556859dd85f3a541db6a4e0167b86e7273e1cdc973e5b175166bb634fdb \ --hash=sha256:b9f222de8cded79c49bf184bdbc06630d4c58eec9459b939b4a690c82ed05657 \ --hash=sha256:c3c02d12f837d9683e5ab2f3d9844dc57655b92c74e286c262e0fc54213c216d \ --hash=sha256:c44fee9975f04b33331cb8eb272827111efc8930cfd582e0320613263ca849ca \ --hash=sha256:cf4b19715bccd7ee27b6b120e7e9dd56037b9c0681dcc1adc9ba9db3d417fa36 \ --hash=sha256:d0c212c49b6c10e6951362f7c6df3329f04c2b1c28499563d4035d964ab8e08c \ --hash=sha256:d3296782ca4eab572a1a4eca686d8bfb00226300dcefdf43faa25b5242ab8a3e \ --hash=sha256:d85f5e9a5f8b73e2350097c3756ef7e785f55bd71205defa0bfdaf96c31616ff \ --hash=sha256:da511e6ad4f7323ee5702e6633085fb76c2f893aaf8ce4c51a0ba4fc07580ea7 \ --hash=sha256:e05882b70b87a18d937ca6768ff33cc3f72847cbc4de4491c8e73880766718e5 \ --hash=sha256:e61c0abb4c85b095a784ef23fdd4aede7a2628478e7baba7c5e3deba61070a02 \ --hash=sha256:e6a08c0be454c3b3beb105c0596ebdc2371fab6bb90c0c0297f4e58fd7e1012c \ --hash=sha256:e9a6e0eb86070e8ccaedfbd9d38fec54864f3125ab95419970575b42af7541df \ --hash=sha256:ed37bd3c3b063412f7620464a9ac1314d33100329f39799255fb8d3027da50d3 \ --hash=sha256:f1adfc8ac319e1a348af294106bc6a8458a0f1633cc62a1446aebc30c5fa186a \ --hash=sha256:f5796e664fe802da4f57a168c85359a8fbf3eab5e55cd4e4569fbacecc903959 \ --hash=sha256:fc5a77d0c516700ebad189b587de289a20a78324bc54baee03dd486f0855d234 \ --hash=sha256:fd21f6ae3f08b41004dfb433fa895d858f3f5979e7762d052b12aef444e29afc # via -r requirements.in exceptiongroup==1.2.2 \ --hash=sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b \ --hash=sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc # via pytest importlib-metadata==8.4.0 \ --hash=sha256:66f342cc6ac9818fc6ff340576acd24d65ba0b3efabb2b4ac08b598965a4a2f1 \ --hash=sha256:9a547d3bc3608b025f93d403fdd1aae741c24fbb8314df4b155675742ce303c5 # via pytest-randomly iniconfig==2.0.0 \ --hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \ --hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374 # via pytest mypy-extensions==1.0.0 \ --hash=sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d \ --hash=sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782 # via black packaging==24.1 \ --hash=sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002 \ --hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124 # via # black # pytest pathspec==0.12.1 \ --hash=sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08 \ --hash=sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712 # via black platformdirs==4.3.1 \ --hash=sha256:63b79589009fa8159973601dd4563143396b35c5f93a58b36f9049ff046949b1 \ --hash=sha256:facaa5a3c57aa1e053e3da7b49e0cc31fe0113ca42a4659d5c2e98e545624afe # via black pluggy==1.5.0 \ --hash=sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1 \ --hash=sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669 # via pytest pytest==8.3.2 \ --hash=sha256:4ba08f9ae7dcf84ded419494d229b48d0903ea6407b030eaec46df5e6a73bba5 \ --hash=sha256:c132345d12ce551242c87269de812483f5bcc87cdbb4722e48487ba194f9fdce # via # -r requirements.in # pytest-randomly pytest-randomly==3.15.0 \ --hash=sha256:0516f4344b29f4e9cdae8bce31c4aeebf59d0b9ef05927c33354ff3859eeeca6 \ --hash=sha256:b908529648667ba5e54723088edd6f82252f540cc340d748d1fa985539687047 # via -r requirements.in tomli==2.0.1 \ --hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \ --hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f # via # black # coverage # pytest typing-extensions==4.12.2 \ --hash=sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d \ --hash=sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8 # via black zipp==3.20.1 \ --hash=sha256:9960cd8967c8f85a56f920d5d507274e74f9ff813a0ab8889a5b5be2daf44064 \ --hash=sha256:c22b14cc4763c5a5b04134207736c107db42e9d3ef2d9779d465f5f1bcba572b # via importlib-metadata python-blacken-docs-1.19.1/tests/requirements/requirements.in000066400000000000000000000000641470626533400244210ustar00rootroot00000000000000black>=22.1.0 coverage[toml] pytest pytest-randomly python-blacken-docs-1.19.1/tests/test_blacken_docs.py000066400000000000000000000760301470626533400226510ustar00rootroot00000000000000from __future__ import annotations from textwrap import dedent import black from black.const import DEFAULT_LINE_LENGTH import blacken_docs from blacken_docs import __main__ # noqa: F401 BLACK_MODE = black.FileMode(line_length=DEFAULT_LINE_LENGTH) def test_format_src_trivial(): after, _ = blacken_docs.format_str("", BLACK_MODE) assert after == "" def test_format_src_markdown_simple(): before = dedent( """\ ```python f(1,2,3) ``` """ ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == dedent( """\ ```python f(1, 2, 3) ``` """ ) def test_format_src_markdown_leading_whitespace(): before = dedent( """\ ``` python f(1,2,3) ``` """ ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == dedent( """\ ``` python f(1, 2, 3) ``` """ ) def test_format_src_markdown_python_after_newline(): before = dedent( """\ ``` python --version echo "python" ``` """ ) after, errors = blacken_docs.format_str(before, BLACK_MODE) assert errors == [] assert after == before def test_format_src_markdown_short_name(): before = dedent( """\ ``` py f(1,2,3) ``` """ ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == dedent( """\ ``` py f(1, 2, 3) ``` """ ) def test_format_src_markdown_options(): before = dedent( """\ ```python title='example.py' f(1,2,3) ``` """ ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == dedent( """\ ```python title='example.py' f(1, 2, 3) ``` """ ) def test_format_src_markdown_trailing_whitespace(): before = dedent( """\ ```python f(1,2,3) ``` \n""" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == dedent( """\ ```python f(1, 2, 3) ``` \n""" ) def test_format_src_indented_markdown(): before = dedent( """\ - do this pls: ```python f(1,2,3) ``` - also this """ ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == dedent( """\ - do this pls: ```python f(1, 2, 3) ``` - also this """ ) def test_format_src_markdown_pycon(): before = ( "hello\n" "\n" "```pycon\n" "\n" " >>> f(1,2,3)\n" " output\n" "```\n" "world\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( "hello\n" "\n" "```pycon\n" "\n" ">>> f(1, 2, 3)\n" "output\n" "```\n" "world\n" ) def test_format_src_markdown_pycon_after_newline(): before = dedent( """\ ``` pycon is great >>> yes it is ``` """ ) after, errors = blacken_docs.format_str(before, BLACK_MODE) assert errors == [] assert after == before def test_format_src_markdown_pycon_options(): before = ( "hello\n" "\n" "```pycon title='Session 1'\n" "\n" " >>> f(1,2,3)\n" " output\n" "```\n" "world\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( "hello\n" "\n" "```pycon title='Session 1'\n" "\n" ">>> f(1, 2, 3)\n" "output\n" "```\n" "world\n" ) def test_format_src_markdown_pycon_twice(): before = ( "```pycon\n" ">>> f(1,2,3)\n" "output\n" "```\n" "example 2\n" "```pycon\n" ">>> f(1,2,3)\n" "output\n" "```\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( "```pycon\n" ">>> f(1, 2, 3)\n" "output\n" "```\n" "example 2\n" "```pycon\n" ">>> f(1, 2, 3)\n" "output\n" "```\n" ) def test_format_src_markdown_comments_disable(): before = ( "\n" "```python\n" "'single quotes rock'\n" "```\n" "\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == before def test_format_src_markdown_comments_disabled_enabled(): before = ( "\n" "```python\n" "'single quotes rock'\n" "```\n" "\n" "```python\n" "'double quotes rock'\n" "```\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( "\n" "```python\n" "'single quotes rock'\n" "```\n" "\n" "```python\n" '"double quotes rock"\n' "```\n" ) def test_format_src_markdown_comments_before(): before = ( "\n" "\n" "```python\n" "'double quotes rock'\n" "```\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( "\n" "\n" "```python\n" '"double quotes rock"\n' "```\n" ) def test_format_src_markdown_comments_after(): before = ( "```python\n" "'double quotes rock'\n" "```\n" "\n" "\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( "```python\n" '"double quotes rock"\n' "```\n" "\n" "\n" ) def test_format_src_markdown_comments_only_on(): # fmt: off before = ( "\n" "```python\n" "'double quotes rock'\n" "```\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( "\n" "```python\n" '"double quotes rock"\n' "```\n" ) # fmt: on def test_format_src_markdown_comments_only_off(): # fmt: off before = ( "\n" "```python\n" "'single quotes rock'\n" "```\n" ) # fmt: on after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == before def test_format_src_markdown_comments_multiple(): before = ( "\n" # ignored "\n" "\n" "\n" # ignored "\n" "\n" # ignored "```python\n" "'single quotes rock'\n" "```\n" # no on comment, off until the end ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == before def test_on_off_comments_in_code_blocks(): before = ( "````md\n" "\n" "```python\n" "f(1,2,3)\n" "```\n" "\n" "````\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == before def test_format_src_markdown_comments_disable_pycon(): before = ( "\n" "```pycon\n" ">>> 'single quotes rock'\n" "```\n" "\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == before def test_format_src_latex_minted(): before = ( "hello\n" "\\begin{minted}{python}\n" "f(1,2,3)\n" "\\end{minted}\n" "world!" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( "hello\n" "\\begin{minted}{python}\n" "f(1, 2, 3)\n" "\\end{minted}\n" "world!" ) def test_format_src_latex_minted_opt(): before = ( "maths!\n" "\\begin{minted}[mathescape]{python}\n" "# Returns $\\sum_{i=1}^{n}i$\n" "def sum_from_one_to(n):\n" " r = range(1, n+1)\n" " return sum(r)\n" "\\end{minted}\n" "done" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( "maths!\n" "\\begin{minted}[mathescape]{python}\n" "# Returns $\\sum_{i=1}^{n}i$\n" "def sum_from_one_to(n):\n" " r = range(1, n + 1)\n" " return sum(r)\n" "\\end{minted}\n" "done" ) def test_format_src_latex_minted_indented(): # Personaly I would have minted python code all flush left, # with only the Python code's own four space indentation: before = dedent( """\ hello \\begin{minted}{python} if True: f(1,2,3) \\end{minted} world! """ ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == dedent( """\ hello \\begin{minted}{python} if True: f(1, 2, 3) \\end{minted} world! """ ) def test_format_src_latex_minted_pycon(): before = ( "Preceeding text\n" "\\begin{minted}[gobble=2,showspaces]{pycon}\n" ">>> print( 'Hello World' )\n" "Hello World\n" "\\end{minted}\n" "Following text." ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( "Preceeding text\n" "\\begin{minted}[gobble=2,showspaces]{pycon}\n" '>>> print("Hello World")\n' "Hello World\n" "\\end{minted}\n" "Following text." ) def test_format_src_latex_minted_pycon_indented(): # Nicer style to put the \begin and \end on new lines, # but not actually required for the begin line before = ( "Preceeding text\n" " \\begin{minted}{pycon}\n" " >>> print( 'Hello World' )\n" " Hello World\n" " \\end{minted}\n" "Following text." ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( "Preceeding text\n" " \\begin{minted}{pycon}\n" ' >>> print("Hello World")\n' " Hello World\n" " \\end{minted}\n" "Following text." ) def test_format_src_latex_minted_comments_off(): before = ( "% blacken-docs:off\n" "\\begin{minted}{python}\n" "'single quotes rock'\n" "\\end{minted}\n" "% blacken-docs:on\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == before def test_format_src_latex_minted_comments_off_pycon(): before = ( "% blacken-docs:off\n" "\\begin{minted}{pycon}\n" ">>> 'single quotes rock'\n" "\\end{minted}\n" "% blacken-docs:on\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == before def test_format_src_pythontex(): # fmt: off before = ( "hello\n" "\\begin{pyblock}\n" "f(1,2,3)\n" "\\end{pyblock}\n" "world!" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( "hello\n" "\\begin{pyblock}\n" "f(1, 2, 3)\n" "\\end{pyblock}\n" "world!" ) # fmt: on def test_format_src_pythontex_comments_off(): before = ( "% blacken-docs:off\n" "\\begin{pyblock}\n" "f(1,2,3)\n" "\\end{pyblock}\n" "% blacken-docs:on\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == before def test_format_src_rst(): before = ( "hello\n" "\n" ".. code-block:: python\n" "\n" " f(1,2,3)\n" "\n" "world\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( "hello\n" "\n" ".. code-block:: python\n" "\n" " f(1, 2, 3)\n" "\n" "world\n" ) def test_format_src_rst_empty(): before = "some text\n\n.. code-block:: python\n\n\nsome other text\n" after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == before def test_format_src_rst_literal_blocks(): before = dedent( """\ hello:: f(1,2,3) world """ ) after, _ = blacken_docs.format_str( before, BLACK_MODE, rst_literal_blocks=True, ) assert after == dedent( """\ hello:: f(1, 2, 3) world """ ) def test_format_src_rst_literal_block_empty(): before = dedent( """\ hello:: world """ ) after, _ = blacken_docs.format_str( before, BLACK_MODE, rst_literal_blocks=True, ) assert after == before def test_format_src_rst_literal_blocks_nested(): before = dedent( """ * hello .. warning:: don't hello too much """, ) after, errors = blacken_docs.format_str( before, BLACK_MODE, rst_literal_blocks=True, ) assert after == before assert errors == [] def test_format_src_rst_literal_blocks_empty(): before = dedent( """ Example:: .. warning:: There was no example. """, ) after, errors = blacken_docs.format_str( before, BLACK_MODE, rst_literal_blocks=True, ) assert after == before assert errors == [] def test_format_src_rst_literal_blocks_comments(): before = ( ".. blacken-docs:off\n" "Example::\n" "\n" " 'single quotes rock'\n" "\n" ".. blacken-docs:on\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE, rst_literal_blocks=True) assert after == before def test_format_src_rst_sphinx_doctest(): before = ( ".. testsetup:: group1\n" "\n" " import parrot \n" " mock = SomeMock( )\n" "\n" ".. testcleanup:: group1\n" "\n" " mock.stop( )\n" "\n" ".. doctest:: group1\n" "\n" " >>> parrot.voom( 3000 )\n" " This parrot wouldn't voom if you put 3000 volts through it!\n" "\n" ".. testcode::\n" "\n" " parrot.voom( 3000 )\n" "\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( ".. testsetup:: group1\n" "\n" " import parrot\n" "\n" " mock = SomeMock()\n" "\n" ".. testcleanup:: group1\n" "\n" " mock.stop()\n" "\n" ".. doctest:: group1\n" "\n" " >>> parrot.voom(3000)\n" " This parrot wouldn't voom if you put 3000 volts through it!\n" "\n" ".. testcode::\n" "\n" " parrot.voom(3000)\n" "\n" ) def test_format_src_rst_indented(): before = dedent( """\ .. versionadded:: 3.1 hello .. code-block:: python def hi(): f(1,2,3) world """ ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == dedent( """\ .. versionadded:: 3.1 hello .. code-block:: python def hi(): f(1, 2, 3) world """ ) def test_format_src_rst_code_block_indent(): before = "\n".join( [ ".. code-block:: python", " ", " f(1,2,3)\n", ] ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == "\n".join( [ ".. code-block:: python", " ", " f(1, 2, 3)\n", ] ) def test_format_src_rst_with_highlight_directives(): before = ( ".. code-block:: python\n" " :lineno-start: 10\n" " :emphasize-lines: 11\n" "\n" " def foo():\n" " bar(1,2,3)\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( ".. code-block:: python\n" " :lineno-start: 10\n" " :emphasize-lines: 11\n" "\n" " def foo():\n" " bar(1, 2, 3)\n" ) def test_format_src_rst_python_inside_non_python_code_block(): before = ( "blacken-docs does changes like:\n" "\n" ".. code-block:: diff\n" "\n" " .. code-block:: python\n" "\n" " - 'Hello World'\n" ' + "Hello World"\n' ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == before def test_format_src_rst_python_comments(): before = ( ".. blacken-docs:off\n" ".. code-block:: python\n" "\n" " 'single quotes rock'\n" "\n" ".. blacken-docs:on\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == before def test_integration_ok(tmp_path, capsys): f = tmp_path / "f.md" f.write_text( "```python\n" "f(1, 2, 3)\n" "```\n", ) result = blacken_docs.main((str(f),)) assert result == 0 assert not capsys.readouterr()[1] assert f.read_text() == ("```python\n" "f(1, 2, 3)\n" "```\n") def test_integration_modifies(tmp_path, capsys): f = tmp_path / "f.md" f.write_text( "```python\n" "f(1,2,3)\n" "```\n", ) result = blacken_docs.main((str(f),)) assert result == 1 out, _ = capsys.readouterr() assert out == f"{f}: Rewriting...\n" assert f.read_text() == ("```python\n" "f(1, 2, 3)\n" "```\n") def test_integration_line_length(tmp_path): f = tmp_path / "f.md" f.write_text( "```python\n" "foo(very_very_very_very_very_very_very, long_long_long_long_long)\n" "```\n", ) result = blacken_docs.main((str(f), "--line-length=80")) assert result == 0 result2 = blacken_docs.main((str(f), "--line-length=50")) assert result2 == 1 assert f.read_text() == ( "```python\n" "foo(\n" " very_very_very_very_very_very_very,\n" " long_long_long_long_long,\n" ")\n" "```\n" ) def test_integration_check(tmp_path): f = tmp_path / "f.md" text = dedent( """\ ```python x = 'a' 'b' ``` """ ) f.write_text(text) result = blacken_docs.main((str(f), "--check")) assert result == 1 assert f.read_text() == text def test_integration_preview(tmp_path): f = tmp_path / "f.md" f.write_text( dedent( """\ ```python x = 'a' 'b' ``` """ ) ) result = blacken_docs.main((str(f), "--preview")) assert result == 1 assert f.read_text() == dedent( """\ ```python x = "a" "b" ``` """ ) def test_integration_pyi(tmp_path): f = tmp_path / "f.md" f.write_text( dedent( """\ ```python class Foo: ... class Bar: ... ``` """ ) ) result = blacken_docs.main((str(f), "--pyi")) assert result == 1 assert f.read_text() == dedent( """\ ```python class Foo: ... class Bar: ... ``` """ ) def test_integration_py36(tmp_path): f = tmp_path / "f.md" f.write_text( "```python\n" "def very_very_long_function_name(\n" " very_very_very_very_very_very,\n" " very_very_very_very_very_very,\n" " *long_long_long_long_long_long\n" "):\n" " pass\n" "```\n", ) result = blacken_docs.main((str(f),)) assert result == 0 result2 = blacken_docs.main((str(f), "--target-version=py36")) assert result2 == 1 assert f.read_text() == ( "```python\n" "def very_very_long_function_name(\n" " very_very_very_very_very_very,\n" " very_very_very_very_very_very,\n" " *long_long_long_long_long_long,\n" "):\n" " pass\n" "```\n" ) def test_integration_filename_last(tmp_path): f = tmp_path / "f.md" f.write_text( "```python\n" "def very_very_long_function_name(\n" " very_very_very_very_very_very,\n" " very_very_very_very_very_very,\n" " *long_long_long_long_long_long\n" "):\n" " pass\n" "```\n", ) result = blacken_docs.main((str(f),)) assert result == 0 result2 = blacken_docs.main(("--target-version", "py36", str(f))) assert result2 == 1 assert f.read_text() == ( "```python\n" "def very_very_long_function_name(\n" " very_very_very_very_very_very,\n" " very_very_very_very_very_very,\n" " *long_long_long_long_long_long,\n" "):\n" " pass\n" "```\n" ) def test_integration_multiple_target_version(tmp_path): f = tmp_path / "f.md" f.write_text( "```python\n" "def very_very_long_function_name(\n" " very_very_very_very_very_very,\n" " very_very_very_very_very_very,\n" " *long_long_long_long_long_long\n" "):\n" " pass\n" "```\n", ) result = blacken_docs.main((str(f),)) assert result == 0 result2 = blacken_docs.main( ("--target-version", "py35", "--target-version", "py36", str(f)), ) assert result2 == 0 def test_integration_skip_string_normalization(tmp_path): f = tmp_path / "f.md" f.write_text( "```python\n" "f('hi')\n" "```\n", ) result = blacken_docs.main((str(f), "--skip-string-normalization")) assert result == 0 assert f.read_text() == ("```python\n" "f('hi')\n" "```\n") def test_integration_syntax_error(tmp_path, capsys): f = tmp_path / "f.md" f.write_text( "```python\n" "f(\n" "```\n", ) result = blacken_docs.main((str(f),)) assert result == 2 out, _ = capsys.readouterr() assert out.startswith(f"{f}:1: code block parse error") assert f.read_text() == ("```python\n" "f(\n" "```\n") def test_integration_ignored_syntax_error(tmp_path, capsys): f = tmp_path / "f.md" f.write_text( "```python\n" "f( )\n" "```\n" "\n" "```python\n" "f(\n" "```\n", ) result = blacken_docs.main((str(f), "--skip-errors")) assert result == 1 out, _ = capsys.readouterr() assert f.read_text() == ( "```python\n" "f()\n" "```\n" "\n" "```python\n" "f(\n" "```\n" ) def test_format_src_rst_jupyter_sphinx(): before = ( "hello\n" "\n" ".. jupyter-execute::\n" "\n" " f(1,2,3)\n" "\n" "world\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( "hello\n" "\n" ".. jupyter-execute::\n" "\n" " f(1, 2, 3)\n" "\n" "world\n" ) def test_format_src_rst_jupyter_sphinx_with_directive(): before = ( "hello\n" "\n" ".. jupyter-execute::\n" " :hide-code:\n" "\n" " f(1,2,3)\n" "\n" "world\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( "hello\n" "\n" ".. jupyter-execute::\n" " :hide-code:\n" "\n" " f(1, 2, 3)\n" "\n" "world\n" ) def test_format_src_python_docstring_markdown(): before = dedent( '''\ def f(): """ hello world ```python f(1,2,3) ``` """ pass ''' ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == dedent( '''\ def f(): """ hello world ```python f(1, 2, 3) ``` """ pass ''' ) def test_format_src_python_docstring_rst(): before = dedent( '''\ def f(): """ hello world .. code-block:: python f(1,2,3) """ pass ''' ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == dedent( '''\ def f(): """ hello world .. code-block:: python f(1, 2, 3) """ pass ''' ) def test_format_src_rst_pycon(): before = ( "hello\n" "\n" ".. code-block:: pycon\n" "\n" " >>> f(1,2,3)\n" " output\n" "\n" "world\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( "hello\n" "\n" ".. code-block:: pycon\n" "\n" " >>> f(1, 2, 3)\n" " output\n" "\n" "world\n" ) def test_format_src_rst_pycon_with_contiuation(): before = ( ".. code-block:: pycon\n" "\n" " >>> d = {\n" ' ... "a": 1,\n' ' ... "b": 2,\n' ' ... "c": 3,}\n' "\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( ".. code-block:: pycon\n" "\n" " >>> d = {\n" ' ... "a": 1,\n' ' ... "b": 2,\n' ' ... "c": 3,\n' " ... }\n" "\n" ) def test_format_src_rst_pycon_adds_contiuation(): before = ".. code-block:: pycon\n" "\n" ' >>> d = {"a": 1,"b": 2,"c": 3,}\n' "\n" after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( ".. code-block:: pycon\n" "\n" " >>> d = {\n" ' ... "a": 1,\n' ' ... "b": 2,\n' ' ... "c": 3,\n' " ... }\n" "\n" ) def test_format_src_rst_pycon_preserves_trailing_whitespace(): before = ( "hello\n" "\n" ".. code-block:: pycon\n" "\n" ' >>> d = {"a": 1, "b": 2, "c": 3}\n' "\n" "\n" "\n" "world\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == before def test_format_src_rst_pycon_indented(): before = ( ".. versionadded:: 3.1\n" "\n" " hello\n" "\n" " .. code-block:: pycon\n" "\n" " >>> def hi():\n" " ... f(1,2,3)\n" " ...\n" "\n" " world\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( ".. versionadded:: 3.1\n" "\n" " hello\n" "\n" " .. code-block:: pycon\n" "\n" " >>> def hi():\n" " ... f(1, 2, 3)\n" " ...\n" "\n" " world\n" ) def test_format_src_rst_pycon_code_block_is_final_line1(): before = ( ".. code-block:: pycon\n" "\n" " >>> if True:\n" " ... pass\n" " ...\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( ".. code-block:: pycon\n" "\n" " >>> if True:\n" " ... pass\n" " ...\n" ) def test_format_src_rst_pycon_code_block_is_final_line2(): before = ".. code-block:: pycon\n" "\n" " >>> if True:\n" " ... pass\n" after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( ".. code-block:: pycon\n" "\n" " >>> if True:\n" " ... pass\n" " ...\n" ) def test_format_src_rst_pycon_nested_def1(): before = ( ".. code-block:: pycon\n" "\n" " >>> if True:\n" " ... def f(): pass\n" " ...\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( ".. code-block:: pycon\n" "\n" " >>> if True:\n" " ... def f():\n" " ... pass\n" " ...\n" ) def test_format_src_rst_pycon_nested_def2(): before = ( ".. code-block:: pycon\n" "\n" " >>> if True:\n" " ... def f(): pass\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( ".. code-block:: pycon\n" "\n" " >>> if True:\n" " ... def f():\n" " ... pass\n" " ...\n" ) def test_format_src_rst_pycon_empty_line(): before = ( ".. code-block:: pycon\n" "\n" " >>> l = [\n" " ...\n" " ... 1,\n" " ... ]\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( ".. code-block:: pycon\n" "\n" " >>> l = [\n" " ... 1,\n" " ... ]\n" ) def test_format_src_rst_pycon_preserves_output_indentation(): before = ( ".. code-block:: pycon\n" "\n" " >>> 1 / 0\n" " Traceback (most recent call last):\n" ' File "", line 1, in \n' " ZeroDivisionError: division by zero\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == before def test_format_src_rst_pycon_elided_traceback(): before = ( ".. code-block:: pycon\n" "\n" " >>> 1 / 0\n" " Traceback (most recent call last):\n" " ...\n" " ZeroDivisionError: division by zero\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == before def test_format_src_rst_pycon_no_prompt(): before = ".. code-block:: pycon\n" "\n" " pass\n" after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == before def test_format_src_rst_pycon_no_trailing_newline(): before = ".. code-block:: pycon\n" "\n" " >>> pass" after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == (".. code-block:: pycon\n" "\n" " >>> pass\n") def test_format_src_rst_pycon_comment_before_promopt(): before = ( ".. code-block:: pycon\n" "\n" " # Comment about next line\n" " >>> pass\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == ( ".. code-block:: pycon\n" "\n" " # Comment about next line\n" " >>> pass\n" ) def test_format_src_rst_pycon_comments(): before = ( ".. blacken-docs:off\n" ".. code-block:: pycon\n" "\n" " >>> 'single quotes rock'\n" "\n" ".. blacken-docs:on\n" ) after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == before def test_format_src_rst_pycon_empty(): before = "some text\n\n.. code-block:: pycon\n\n\nsome other text\n" after, _ = blacken_docs.format_str(before, BLACK_MODE) assert after == before python-blacken-docs-1.19.1/tox.ini000066400000000000000000000007051470626533400167760ustar00rootroot00000000000000[tox] requires = tox>=4.2 env_list = py{313, 312, 311, 310, 39} [testenv] package = wheel wheel_build_env = .pkg deps = -r tests/requirements/{envname}.txt set_env = PYTHONDEVMODE = 1 commands = python \ -W error::ResourceWarning \ -W error::DeprecationWarning \ -W error::PendingDeprecationWarning \ -m coverage run \ -m pytest {posargs:tests} [flake8] max-line-length = 88 extend-ignore = E203,E501