Skip to content

Commit c2b0932

Browse files
committed
chore: add isort configuration
1 parent 981685b commit c2b0932

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

.pre-commit-config.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,9 @@ repos:
3232
language: system
3333
entry: mypy --pretty --follow-imports=silent
3434
files: \.py[i]?$
35+
36+
- id: isort
37+
name: isort
38+
language: system
39+
entry: isort
40+
files: \.(py[i]?|pxd|pyx)$

psycopg/pyproject.toml

+2
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ dev = [
8383
"codespell >= 2.2",
8484
"dnspython >= 2.1",
8585
"flake8 >= 4.0",
86+
"isort >= 6.0",
87+
"isort-psycopg",
8688
"mypy >= 1.14",
8789
"pre-commit >= 4.0.1",
8890
"types-setuptools >= 57.4",

pyproject.toml

+6
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,9 @@ disallow_untyped_calls = false
6464
[tool.codespell]
6565
ignore-words-list = "alot,ans,ba,fo,te,erro,varning"
6666
skip = "build,_build,.tox,.mypy_cache,.venv,pq.c,_psycopg.c,*.html"
67+
68+
[tool.isort]
69+
profile = "black"
70+
length_sort = true
71+
multi_line_output = 9
72+
sort_order = "psycopg" # requires the isort-psycopg module

tools/async_to_sync.py

+1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ def convert(fpin: Path, fpout: Path) -> None:
132132
print(output, file=f)
133133

134134
sp.check_call(["black", "-q", str(fpout)])
135+
sp.check_call(["isort", "-q", str(fpout)])
135136

136137

137138
def check(outputs: list[str]) -> int:

0 commit comments

Comments
 (0)