summaryrefslogtreecommitdiff
path: root/tools/format_docs_code.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2023-01-18 12:45:42 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2023-01-18 15:07:55 -0500
commitcd96ffe287e26651f8dce4f688bf87af1e423f06 (patch)
tree123197d983714caa9ae225d330fcf3743ba11b52 /tools/format_docs_code.py
parentf91a25cd8191f026dd43c0a2475cda8a56d65c19 (diff)
downloadsqlalchemy-cd96ffe287e26651f8dce4f688bf87af1e423f06.tar.gz
refactor code generation tools , include --check command
in particular it looks like CI was not picking up on the "git diff" oriented commands, which were failing to run due to pathing issues. As we were setting cwd for black/zimports relative to sqlalchemy library, and tox installs it in the venv, black/zimports would fail to run from tox, and since these are subprocess.run we didn't pick up the failure. This overall locks down how zimports/black are run so that we are definitely from the source root, by using the location of tools/ to determine the root. Fixes: #8892 Change-Id: I7c54b747edd5a80e0c699b8456febf66d8b62375
Diffstat (limited to 'tools/format_docs_code.py')
-rw-r--r--tools/format_docs_code.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/format_docs_code.py b/tools/format_docs_code.py
index 3b11c24a8..fcb844291 100644
--- a/tools/format_docs_code.py
+++ b/tools/format_docs_code.py
@@ -4,7 +4,10 @@ this script parses the documentation files and runs black on the code blocks
that it extracts from the documentation.
.. versionadded:: 2.0
+
"""
+# mypy: ignore-errors
+
from argparse import ArgumentParser
from argparse import RawDescriptionHelpFormatter
from collections.abc import Iterator