From d3f869bb3159d18669fb6f00cbe514307118eea7 Mon Sep 17 00:00:00 2001 From: James Addison Date: Mon, 10 Apr 2023 15:40:38 -0400 Subject: tooling: write_pyi.py: filter usage of raw-strings (rstrings) ### Description While reading the diff between [`rel_1_10_2...rel_1_10_3`](https://github.com/sqlalchemy/alembic/compare/rel_1_10_2...rel_1_10_3), the introduction of r-strings drew my attention, and that resulted in some [discussion on the relevant commit](https://github.com/sqlalchemy/alembic/commit/bc0c305b7c2cc0401e250fcd6a725aacecdd6e33). This changeset filters the production of r-strings during stub-generation to cases where docstrings contain escape (backslash, `\`) characters. I'll admit that I didn't realize until today that these stubs are primarily for typechecking. Since that's the case, I have doubts about whether the change is worthwhile (consistency and simplicity -- using r-strings for all docstrings in the stubs -- even if it's redundant, seems fine to me). ### Checklist This pull request is: - [x] A documentation / typographical error fix - [x] A short code fix - Relates to discussion at https://github.com/sqlalchemy/alembic/commit/bc0c305b7c2cc0401e250fcd6a725aacecdd6e33 Closes: #1218 Pull-request: https://github.com/sqlalchemy/alembic/pull/1218 Pull-request-sha: 352ab8829525435f78838687e12156a3fa3a3d86 Closes: #1219 Pull-request: https://github.com/sqlalchemy/alembic/pull/1219 Change-Id: I2808a592681dabc093d538f589e673fcc5e05822 --- setup.cfg | 2 ++ 1 file changed, 2 insertions(+) (limited to 'setup.cfg') diff --git a/setup.cfg b/setup.cfg index 39c1540..a7666ce 100644 --- a/setup.cfg +++ b/setup.cfg @@ -89,10 +89,12 @@ ignore = RST304,RST303,RST299,RST399, W503,W504 exclude = .venv,.git,.tox,dist,doc,*egg,build +filename = *.py,*.pyi import-order-style = google application-import-names = alembic,tests per-file-ignores = **/__init__.py:F401 + **/*.pyi:E302,E704,E266 max-line-length = 79 [sqla_testing] -- cgit v1.2.1