Skip to content

Commit 2f526ce

Browse files
committed
Move Black to pre-commit
1 parent 58f8164 commit 2f526ce

28 files changed

+1862
-2040
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ repos:
1818
name: "Python: imports"
1919
args: ["--py39-plus"]
2020

21+
- repo: "https://github.com/psf/black-pre-commit-mirror"
22+
rev: "24.10.0"
23+
hooks:
24+
- id: "black"
25+
name: "Python: format"
26+
args: ["--target-version", "py39", "--line-length", "120"]
27+
2128
- repo: "https://github.com/pre-commit/pre-commit-hooks"
2229
rev: "v5.0.0"
2330
hooks:

setup.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ max-line-length = 120
88
#
99
# https://www.flake8rules.com/rules/W503.html
1010
# https://www.python.org/dev/peps/pep-0008/#should-a-line-break-before-or-after-a-binary-operator
11-
ignore = W503
11+
#
12+
# E203 and E701 are Black-specific exclusions.
13+
ignore = E203,E701,W503
1214

1315
[mypy]
1416
check_untyped_defs = true

setup.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,30 @@
2727
readme = f.read()
2828

2929
kerberos_require = ["requests_kerberos"]
30-
gssapi_require = [""
31-
"requests_gssapi",
32-
# PyPy compatibility issue https://github.com/jborean93/pykrb5/issues/49
33-
"krb5 == 0.5.1"]
30+
gssapi_require = [
31+
"" "requests_gssapi",
32+
# PyPy compatibility issue https://github.com/jborean93/pykrb5/issues/49
33+
"krb5 == 0.5.1",
34+
]
3435
sqlalchemy_require = ["sqlalchemy >= 1.3"]
3536
external_authentication_token_cache_require = ["keyring"]
3637

3738
# We don't add localstorage_require to all_require as users must explicitly opt in to use keyring.
3839
all_require = kerberos_require + sqlalchemy_require
3940

40-
tests_require = all_require + gssapi_require + [
41-
# httpretty >= 1.1 duplicates requests in `httpretty.latest_requests`
42-
# https://github.com/gabrielfalcao/HTTPretty/issues/425
43-
"httpretty < 1.1",
44-
"pytest",
45-
"pytest-runner",
46-
"pre-commit",
47-
"black",
48-
"isort",
49-
"keyring"
50-
]
41+
tests_require = (
42+
all_require
43+
+ gssapi_require
44+
+ [
45+
# httpretty >= 1.1 duplicates requests in `httpretty.latest_requests`
46+
# https://github.com/gabrielfalcao/HTTPretty/issues/425
47+
"httpretty < 1.1",
48+
"pytest",
49+
"pytest-runner",
50+
"pre-commit",
51+
"keyring",
52+
]
53+
)
5154

5255
setup(
5356
name=about["__title__"],

tests/integration/conftest.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,7 @@ def start_trino(image_tag=None):
7272

7373

7474
def wait_for_trino_workers(host, port, timeout=180):
75-
request = TrinoRequest(
76-
host=host,
77-
port=port,
78-
client_session=ClientSession(
79-
user="test_fixture"
80-
)
81-
)
75+
request = TrinoRequest(host=host, port=port, client_session=ClientSession(user="test_fixture"))
8276
sql = "SELECT state FROM system.runtime.nodes"
8377
t0 = time.time()
8478
while True:
@@ -124,9 +118,7 @@ def start_trino_and_wait(image_tag=None):
124118
if host:
125119
port = os.environ.get("TRINO_RUNNING_PORT", DEFAULT_PORT)
126120
else:
127-
container_id, proc, host, port = start_local_trino_server(
128-
image_tag
129-
)
121+
container_id, proc, host, port = start_local_trino_server(image_tag)
130122

131123
print("trino.server.hostname {}".format(host))
132124
print("trino.server.port {}".format(port))

0 commit comments

Comments
 (0)