Skip to content

Commit 1dfec53

Browse files
authored
chore: update to Ruff 0.9 (#967)
Update to Ruff 0.9. Fix a test. Signed-off-by: Henry Schreiner <[email protected]>
1 parent e0b9860 commit 1dfec53

File tree

6 files changed

+26
-24
lines changed

6 files changed

+26
-24
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ repos:
2525
exclude: "^tests"
2626

2727
- repo: https://github.com/astral-sh/ruff-pre-commit
28-
rev: v0.8.6
28+
rev: v0.9.1
2929
hooks:
3030
- id: ruff
3131
args: ["--fix", "--show-fixes"]
@@ -130,12 +130,12 @@ repos:
130130
additional_dependencies: [cogapp]
131131

132132
- repo: https://github.com/henryiii/validate-pyproject-schema-store
133-
rev: 2024.11.25
133+
rev: 2025.01.10
134134
hooks:
135135
- id: validate-pyproject
136136

137137
- repo: https://github.com/python-jsonschema/check-jsonschema
138-
rev: 0.30.0
138+
rev: 0.31.0
139139
hooks:
140140
- id: check-dependabot
141141
- id: check-github-workflows
@@ -144,7 +144,7 @@ repos:
144144
files: \.schema\.json
145145

146146
- repo: https://github.com/citation-file-format/cffconvert
147-
rev: 054bda51dbe278b3e86f27c890e3f3ac877d616c
147+
rev: b6045d78aac9e02b039703b030588d54d53262ac
148148
hooks:
149149
- id: validate-cff
150150

src/scikit_build_core/build/_wheelfile.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ def writestr(self, zinfo_or_arcname: str | ZipInfo, data: bytes) -> None:
216216
)
217217
zinfo.compress_type = zipfile.ZIP_DEFLATED
218218
zinfo.external_attr = (0o664 | stat.S_IFREG) << 16
219-
assert (
220-
"\\" not in zinfo.filename
221-
), f"\\ not supported in zip; got {zinfo.filename!r}"
219+
assert "\\" not in zinfo.filename, (
220+
f"\\ not supported in zip; got {zinfo.filename!r}"
221+
)
222222
self._zipfile.writestr(zinfo, data)
223223

224224
def __enter__(self) -> Self:
@@ -236,9 +236,9 @@ def __exit__(self, *args: object) -> None:
236236
data = io.StringIO()
237237
writer = csv.writer(data, delimiter=",", quotechar='"', lineterminator="\n")
238238
for member in self._zipfile.infolist():
239-
assert (
240-
"\\" not in member.filename
241-
), f"Invalid zip contents: {member.filename}"
239+
assert "\\" not in member.filename, (
240+
f"Invalid zip contents: {member.filename}"
241+
)
242242
with self._zipfile.open(member) as f:
243243
member_data = f.read()
244244
sha = _b64encode(hashlib.sha256(member_data).digest()).decode("ascii")

src/scikit_build_core/build/generate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ def generate_file_contents(gen: GenerateSettings, metadata: StandardMetadata) ->
2121
metadata. Metadata is available inside the template.
2222
"""
2323

24-
assert (
25-
gen.template_path or gen.template
26-
), f"One of template or template-path must be set for {gen.path}"
24+
assert gen.template_path or gen.template, (
25+
f"One of template or template-path must be set for {gen.path}"
26+
)
2727

2828
if gen.template_path:
2929
template = gen.template_path.read_text(encoding="utf-8")

src/scikit_build_core/setuptools/build_cmake.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ def __dir__() -> list[str]:
3434

3535

3636
def _validate_settings(settings: ScikitBuildSettings) -> None:
37-
assert (
38-
not settings.wheel.expand_macos_universal_tags
39-
), "wheel.expand_macos_universal_tags is not supported in setuptools mode"
40-
assert (
41-
settings.logging.level == "WARNING"
42-
), "Logging is not adjustable in setuptools mode yet"
43-
assert not settings.wheel.py_api, "wheel.py_api is not supported in setuptools mode, use bdist_wheel options instead"
37+
assert not settings.wheel.expand_macos_universal_tags, (
38+
"wheel.expand_macos_universal_tags is not supported in setuptools mode"
39+
)
40+
assert settings.logging.level == "WARNING", (
41+
"Logging is not adjustable in setuptools mode yet"
42+
)
43+
assert not settings.wheel.py_api, (
44+
"wheel.py_api is not supported in setuptools mode, use bdist_wheel options instead"
45+
)
4446

4547

4648
class BuildCMake(setuptools.Command):

src/scikit_build_core/setuptools/wrapper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ def setup(
2929
) -> setuptools.Distribution:
3030
assert not cmake_install_dir, "cmake_install_dir not supported yet"
3131
assert not cmake_with_sdist, "cmake_with_sdist not supported yet"
32-
assert (
33-
cmake_process_manifest_hook is None
34-
), "cmake_process_manifest_hook not supported yet"
32+
assert cmake_process_manifest_hook is None, (
33+
"cmake_process_manifest_hook not supported yet"
34+
)
3535
assert cmake_install_target == "install", "cmake_install_target not supported yet"
3636

3737
if cmake_languages is not None:

tests/test_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def test_wheel_tag(monkeypatch, minver, archs, answer):
172172
assert plat == answer
173173

174174

175-
@pytest.mark.parametrize("archs", ["x86_64" "arm64" "universal2"])
175+
@pytest.mark.parametrize("archs", ["x86_64", "arm64", "universal2"])
176176
def test_wheel_build_tag(monkeypatch, archs):
177177
get_config_var = sysconfig.get_config_var
178178
monkeypatch.setattr(

0 commit comments

Comments
 (0)