Skip to content

Commit 70287f6

Browse files
chore(deps): update pre-commit hooks (#210)
<!--pre-commit.ci start--> updates: - [github.com/charliermarsh/ruff-pre-commit: v0.0.251 → v0.0.253](astral-sh/ruff-pre-commit@v0.0.251...v0.0.253) <!--pre-commit.ci end--> --------- Signed-off-by: Henry Schreiner <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Henry Schreiner <[email protected]>
1 parent d2fe04d commit 70287f6

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ repos:
5454
exclude: "^tests"
5555

5656
- repo: https://github.com/charliermarsh/ruff-pre-commit
57-
rev: v0.0.251
57+
rev: v0.0.253
5858
hooks:
5959
- id: ruff
6060
args: ["--fix", "--show-fixes"]

pyproject.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,13 @@ select = [
189189
"UP", # pyupgrade
190190
"YTT", # flake8-2020
191191
]
192-
extend-ignore = ["PLR0915", "PLR0912", "PLR2004", "E501"]
192+
extend-ignore = [
193+
"PLR0915",
194+
"PLR0912",
195+
"PLR2004",
196+
"PLE1205", # Format check doesn't work with our custom logger
197+
"E501", # Line too long
198+
]
193199
target-version = "py37"
194200
typing-modules = ["scikit_build_core._compat.typing"]
195201
src = ["src"]

src/scikit_build_core/cmake.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ def init_cache(
123123
with self.init_cache_file.open("w", encoding="utf-8") as f:
124124
for key, value in cache_settings.items():
125125
if isinstance(value, bool):
126-
value = "ON" if value else "OFF"
127-
f.write(f'set({key} {value} CACHE BOOL "" FORCE)\n')
126+
str_value = "ON" if value else "OFF"
127+
f.write(f'set({key} {str_value} CACHE BOOL "" FORCE)\n')
128128
elif isinstance(value, os.PathLike):
129129
# Convert to CMake's internal path format
130-
value = str(value).replace("\\", "/")
131-
f.write(f'set({key} [===[{value}]===] CACHE PATH "" FORCE)\n')
130+
str_value = str(value).replace("\\", "/")
131+
f.write(f'set({key} [===[{str_value}]===] CACHE PATH "" FORCE)\n')
132132
else:
133133
f.write(f'set({key} [===[{value}]===] CACHE STRING "" FORCE)\n')
134134
contents = self.init_cache_file.read_text(encoding="utf-8").strip()
@@ -152,11 +152,11 @@ def _compute_cmake_args(
152152

153153
for key, value in defines.items():
154154
if isinstance(value, bool):
155-
value = "ON" if value else "OFF"
156-
yield f"-D{key}:BOOL={value}"
155+
str_value = "ON" if value else "OFF"
156+
yield f"-D{key}:BOOL={str_value}"
157157
elif isinstance(value, os.PathLike):
158-
value = str(value).replace("\\", "/")
159-
yield f"-D{key}:PATH={value}"
158+
str_value = str(value).replace("\\", "/")
159+
yield f"-D{key}:PATH={str_value}"
160160
else:
161161
yield f"-D{key}={value}"
162162

0 commit comments

Comments
 (0)