Updated pre-commit modules and applied ruff fixes · pypa/wheel@0b7771e (original) (raw)
7 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -2,7 +2,7 @@ exclude: ^src/wheel/vendored | ||
2 | 2 | |
3 | 3 | repos: |
4 | 4 | - repo: https://github.com/pre-commit/pre-commit-hooks |
5 | -rev: v4.5.0 | |
5 | +rev: v4.6.0 | |
6 | 6 | hooks: |
7 | 7 | - id: check-added-large-files |
8 | 8 | - id: check-case-conflict |
@@ -18,7 +18,7 @@ repos: | ||
18 | 18 | - id: trailing-whitespace |
19 | 19 | |
20 | 20 | - repo: https://github.com/astral-sh/ruff-pre-commit |
21 | -rev: v0.3.5 | |
21 | +rev: v0.4.3 | |
22 | 22 | hooks: |
23 | 23 | - id: ruff |
24 | 24 | args: [--fix, --show-fixes] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -179,7 +179,7 @@ class bdist_wheel(Command): | ||
179 | 179 | "plat-name=", |
180 | 180 | "p", |
181 | 181 | "platform name to embed in generated filenames " |
182 | -"(default: %s)" % get_platform(None), | |
182 | +f"(default: {get_platform(None)})", | |
183 | 183 | ), |
184 | 184 | ( |
185 | 185 | "keep-temp", |
@@ -215,8 +215,7 @@ class bdist_wheel(Command): | ||
215 | 215 | ( |
216 | 216 | "python-tag=", |
217 | 217 | None, |
218 | -"Python implementation compatibility tag" | |
219 | -" (default: '%s')" % (python_tag()), | |
218 | +f"Python implementation compatibility tag (default: '{python_tag()}')", | |
220 | 219 | ), |
221 | 220 | ( |
222 | 221 | "build-number=", |
@@ -282,7 +281,7 @@ def finalize_options(self): | ||
282 | 281 | if self.py_limited_api and not re.match( |
283 | 282 | PY_LIMITED_API_PATTERN, self.py_limited_api |
284 | 283 | ): |
285 | -raise ValueError("py-limited-api must match '%s'" % PY_LIMITED_API_PATTERN) | |
284 | +raise ValueError(f"py-limited-api must match '{PY_LIMITED_API_PATTERN}'") | |
286 | 285 | |
287 | 286 | # Support legacy [wheel] section for setting universal |
288 | 287 | wheel = self.distribution.get_option_dict("wheel") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -54,7 +54,7 @@ def tags_f(args: argparse.Namespace) -> None: | ||
54 | 54 | def version_f(args: argparse.Namespace) -> None: |
55 | 55 | from .. import __version__ |
56 | 56 | |
57 | -print("wheel %s" % __version__) | |
57 | +print(f"wheel {__version__}") | |
58 | 58 | |
59 | 59 | |
60 | 60 | def parse_build_tag(build_tag: str) -> str: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -189,7 +189,7 @@ def wininst2wheel(path: str, dest_dir: str) -> None: | ||
189 | 189 | paths = {"platlib": ""} |
190 | 190 | |
191 | 191 | dist_info = "{name}-{ver}".format(**info) |
192 | -datadir = "%s.data/" % dist_info | |
192 | +datadir = f"{dist_info}.data/" | |
193 | 193 | |
194 | 194 | # rewrite paths to trick ZipFile into extracting an egg |
195 | 195 | # XXX grab wininst .ini - between .exe, padding, and first zip file. |
@@ -246,7 +246,7 @@ def wininst2wheel(path: str, dest_dir: str) -> None: | ||
246 | 246 | bw.full_tag_supplied = True |
247 | 247 | bw.full_tag = (pyver, abi, arch) |
248 | 248 | |
249 | -dist_info_dir = os.path.join(dir, "%s.dist-info" % dist_info) | |
249 | +dist_info_dir = os.path.join(dir, f"{dist_info}.dist-info") | |
250 | 250 | bw.egg2dist(os.path.join(dir, egginfo_name), dist_info_dir) |
251 | 251 | bw.write_wheelfile(dist_info_dir, generator="wininst2wheel") |
252 | 252 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -133,7 +133,7 @@ def generate_requirements( | ||
133 | 133 | yield "Provides-Extra", extra |
134 | 134 | if condition: |
135 | 135 | condition = "(" + condition + ") and " |
136 | -condition += "extra == '%s'" % extra | |
136 | +condition += f"extra == '{extra}'" | |
137 | 137 | |
138 | 138 | if condition: |
139 | 139 | condition = " ; " + condition |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -427,7 +427,7 @@ def test_platform_linux32(reported, expected, monkeypatch): | ||
427 | 427 | def test_no_ctypes(monkeypatch) -> None: |
428 | 428 | def _fake_import(name: str, *args, **kwargs): |
429 | 429 | if name == "ctypes": |
430 | -raise ModuleNotFoundError("No module named %s" % name) | |
430 | +raise ModuleNotFoundError(f"No module named {name}") | |
431 | 431 | |
432 | 432 | return importlib.__import__(name, *args, **kwargs) |
433 | 433 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -33,7 +33,7 @@ def temp_pkg(request, tmp_path): | ||
33 | 33 | if ext[0]: |
34 | 34 | # if ext[1] is not '', it will write a bad header and fail to compile |
35 | 35 | tmp_path.joinpath("test.c").write_text( |
36 | -"#include <std%sio.h>" % ext[1], encoding="utf-8" | |
36 | +f"#include <std{ext[1]}io.h>", encoding="utf-8" | |
37 | 37 | ) |
38 | 38 | setup_py = SETUP_PY.format(ext_modules=EXT_MODULES) |
39 | 39 | else: |