]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
chore: add isort configuration
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 11 Feb 2025 21:23:50 +0000 (22:23 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 13 Feb 2025 10:30:38 +0000 (11:30 +0100)
.pre-commit-config.yaml
psycopg/pyproject.toml
pyproject.toml
tools/async_to_sync.py

index 082386b6786e9291b0ffaf70d2f6f30e5c673940..9c27ef8abdfaca457c0c8a53a316fa9db83fa4b9 100644 (file)
@@ -32,3 +32,9 @@ repos:
         language: system
         entry: mypy --pretty --follow-imports=silent
         files: \.py[i]?$
+
+      - id: isort
+        name: isort
+        language: system
+        entry: isort
+        files: \.(py[i]?|pxd|pyx)$
index a5df9b80bcbab2660e8984d44ac57f469198e7fa..f3a291f6b142b43917d61c622051889cf59a1d1c 100644 (file)
@@ -83,6 +83,8 @@ dev = [
     "codespell >= 2.2",
     "dnspython >= 2.1",
     "flake8 >= 4.0",
+    "isort >= 6.0",
+    "isort-psycopg",
     "mypy >= 1.14",
     "pre-commit >= 4.0.1",
     "types-setuptools >= 57.4",
index ce539c1d41757ccd6316a0e6ad5bd5e3f126d81b..f684b648997390e0b1216f4a47e24b1fcc130851 100644 (file)
@@ -64,3 +64,9 @@ disallow_untyped_calls = false
 [tool.codespell]
 ignore-words-list = "alot,ans,ba,fo,te,erro,varning"
 skip = "build,_build,.tox,.mypy_cache,.venv,pq.c,_psycopg.c,*.html"
+
+[tool.isort]
+profile = "black"
+length_sort = true
+multi_line_output = 9
+sort_order = "psycopg"  # requires the isort-psycopg module
index 563214444b2c47b040468d5f9c69bbaca08a4f11..ae4d755ccf0c4b1ce9b1cad3d11e8de0a9dad5d0 100755 (executable)
@@ -132,6 +132,7 @@ def convert(fpin: Path, fpout: Path) -> None:
         print(output, file=f)
 
     sp.check_call(["black", "-q", str(fpout)])
+    sp.check_call(["isort", "-q", str(fpout)])
 
 
 def check(outputs: list[str]) -> int: