Skip to content

Commit 9b8ce87

Browse files
authored
chore: linting updates (#2585)
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 3a52416 commit 9b8ce87

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ repos:
1414
- id: trailing-whitespace
1515

1616
- repo: https://github.com/astral-sh/ruff-pre-commit
17-
rev: v0.12.12
17+
rev: v0.13.0
1818
hooks:
19-
- id: ruff
19+
- id: ruff-check
2020
args: ["--fix", "--show-fixes"]
2121
- id: ruff-format
2222

bin/projects.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import urllib.request
2424
import xml.dom.minidom
2525
from collections.abc import Iterable, Mapping, Sequence
26-
from datetime import datetime
26+
from datetime import UTC, datetime
2727
from io import StringIO
2828
from pathlib import Path
2929
from typing import Any, Self, TextIO
@@ -77,7 +77,7 @@ def __init__(self, config: Mapping[str, Any], github: Github | None = None):
7777
self.notes = notes
7878
else:
7979
self.num_stars = 0
80-
self.pushed_at = datetime.utcnow()
80+
self.pushed_at = datetime.now(UTC)
8181

8282
name_len = len(self.name) + 4
8383
self.__class__.NAME = max(self.__class__.NAME, name_len)
@@ -124,7 +124,7 @@ def links(self) -> str:
124124
return f"[{self.name}]: {self.url}"
125125

126126
def info(self) -> str:
127-
days = (datetime.utcnow() - self.pushed_at).days
127+
days = (datetime.now(UTC) - self.pushed_at).days
128128
return f"<!-- {self.name}: {self.num_stars}, last pushed {days} days ago -->"
129129

130130

test/test_ios.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def test_spam():
321321
)
322322
assert set(actual_wheels) == set(expected_wheels)
323323

324-
out, err = capfd.readouterr()
324+
_, err = capfd.readouterr()
325325

326326
assert "iOS tests configured with a test command which doesn't start with 'python -m'" in err
327327

@@ -345,5 +345,5 @@ def test_ios_test_command_invalid(tmp_path, capfd):
345345
"CIBW_XBUILD_TOOLS": "",
346346
},
347347
)
348-
out, err = capfd.readouterr()
348+
_, err = capfd.readouterr()
349349
assert "iOS tests configured with a test command which doesn't start with 'python -m'" in err

test/test_pyodide.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def test_pyodide_version_incompatible(tmp_path, capfd):
104104
},
105105
)
106106

107-
out, err = capfd.readouterr()
107+
_, err = capfd.readouterr()
108108

109109
assert "is not compatible with the pyodide-build version" in err
110110

unit_test/main_commands_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_clean_cache_when_cache_exists(tmp_path, monkeypatch, capfd):
3434

3535
assert e.value.code == 0
3636

37-
out, err = capfd.readouterr()
37+
out, _ = capfd.readouterr()
3838
assert f"Clearing cache directory: {fake_cache_dir}" in out
3939
assert "Cache cleared successfully." in out
4040
assert not fake_cache_dir.exists()
@@ -51,7 +51,7 @@ def test_clean_cache_when_cache_does_not_exist(tmp_path, monkeypatch, capfd):
5151

5252
assert e.value.code == 0
5353

54-
out, err = capfd.readouterr()
54+
out, _ = capfd.readouterr()
5555
assert f"Cache directory does not exist: {fake_cache_dir}" in out
5656

5757

@@ -101,7 +101,7 @@ def test_clean_cache_without_sentinel(tmp_path, monkeypatch, capfd):
101101

102102
assert e.value.code == 1
103103

104-
out, err = capfd.readouterr()
104+
_, err = capfd.readouterr()
105105
assert "does not appear to be a cibuildwheel cache directory" in err
106106
assert fake_cache_dir.exists()
107107

@@ -122,6 +122,6 @@ def test_clean_cache_with_invalid_signature(tmp_path, monkeypatch, capfd):
122122

123123
assert e.value.code == 1
124124

125-
out, err = capfd.readouterr()
125+
_, err = capfd.readouterr()
126126
assert "does not contain a valid cache directory signature" in err
127127
assert fake_cache_dir.exists()

0 commit comments

Comments
 (0)