Skip to content

Commit c0d4360

Browse files
Apply latest formatter and pin version (#1214)
## What changes are proposed in this pull request? The formatter dependencies (`black`, `autoflake`, `isort`) were unpinned, causing CI failures when new versions were released with different formatting behavior. The infra checks that `make fmt` causes no changes, and unpinned versions led to inconsistent results across environments. ### Solution Pinned all formatter dependencies to their latest Python 3.8-compatible versions: - `black==24.8.0` (last version supporting Python 3.8) - `autoflake==2.3.1` (supports Python 3.8+) - `isort==5.13.2` (last 5.x version supporting Python 3.8) This ensures: - Consistent formatting behavior across all environments - Compatibility with Python 3.8 as specified in project requirements - No CI failures due to formatter updates ## How is this tested? - Verified current installed versions - Pinned to matching versions in `pyproject.toml` - Future `make fmt` runs will produce consistent results NO_CHANGELOG=true
1 parent 8bfb49d commit c0d4360

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ dev = [
4141
"pytest-cov",
4242
"pytest-xdist>=3.6.1,<4.0",
4343
"pytest-mock",
44-
"black",
44+
"black==24.8.0",
4545
"pycodestyle",
46-
"autoflake",
47-
"isort",
46+
"autoflake==2.3.1",
47+
"isort==5.13.2",
4848
"wheel",
4949
"ipython",
5050
"ipywidgets",
@@ -85,4 +85,4 @@ include = ["."]
8585
exclude = ["**/node_modules", "**/__pycache__"]
8686
reportMissingImports = true
8787
reportMissingTypeStubs = false
88-
pythonVersion = "3.7"
88+
pythonVersion = "3.7"

tests/integration/test_auth.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,13 @@ def _test_runtime_auth_from_jobs_inner(w, env_or_skip, random, dbr_versions, lib
138138

139139
my_name = w.current_user.me().user_name
140140
notebook_path = f"/Users/{my_name}/notebook-native-auth"
141-
notebook_content = io.BytesIO(b"""
141+
notebook_content = io.BytesIO(
142+
b"""
142143
from databricks.sdk import WorkspaceClient
143144
w = WorkspaceClient()
144145
me = w.current_user.me()
145-
print(me.user_name)""")
146+
print(me.user_name)"""
147+
)
146148

147149
from databricks.sdk.service.workspace import Language
148150

tests/test_config.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ def write_large_dummy_executable(path: pathlib.Path):
136136

137137
# Generate a long random string to inflate the file size.
138138
random_string = "".join(random.choice(string.ascii_letters) for i in range(1024 * 1024))
139-
cli.write_text("""#!/bin/sh
139+
cli.write_text(
140+
"""#!/bin/sh
140141
cat <<EOF
141142
{
142143
"access_token": "...",
@@ -145,7 +146,9 @@ def write_large_dummy_executable(path: pathlib.Path):
145146
}
146147
EOF
147148
exit 0
148-
""" + random_string)
149+
"""
150+
+ random_string
151+
)
149152
cli.chmod(0o755)
150153
assert cli.stat().st_size >= (1024 * 1024)
151154
return cli

tests/test_core.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ def write_large_dummy_executable(path: pathlib.Path):
8383

8484
# Generate a long random string to inflate the file size.
8585
random_string = "".join(random.choice(string.ascii_letters) for i in range(1024 * 1024))
86-
cli.write_text("""#!/bin/sh
86+
cli.write_text(
87+
"""#!/bin/sh
8788
cat <<EOF
8889
{
8990
"access_token": "token",
@@ -92,7 +93,9 @@ def write_large_dummy_executable(path: pathlib.Path):
9293
}
9394
EOF
9495
exit 0
95-
""" + random_string)
96+
"""
97+
+ random_string
98+
)
9699
cli.chmod(0o755)
97100
assert cli.stat().st_size >= (1024 * 1024)
98101
return cli

0 commit comments

Comments
 (0)