Skip to content

Commit 75b5706

Browse files
committed
Misc. ruff updates to versioneer.py
1 parent ca0a1b6 commit 75b5706

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

versioneer.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@
316316
import subprocess
317317
import sys
318318
from pathlib import Path
319-
from typing import Callable
319+
from collections.abc import Callable
320320
import functools
321321

322322
have_tomllib = True
@@ -443,9 +443,9 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False,
443443

444444
for command in commands:
445445
try:
446-
dispcmd = str([command] + args)
446+
dispcmd = str([command, *args])
447447
# remember shell=False, so use git.cmd on windows, not just git
448-
process = subprocess.Popen([command] + args, cwd=cwd, env=env,
448+
process = subprocess.Popen([command, *args], cwd=cwd, env=env,
449449
stdout=subprocess.PIPE,
450450
stderr=(subprocess.PIPE if hide_stderr
451451
else None), **popen_kwargs)
@@ -1392,7 +1392,7 @@ def do_vcs_install(versionfile_source, ipy):
13921392
with open(".gitattributes", "a+") as fobj:
13931393
fobj.write(f"{versionfile_source} export-subst\n")
13941394
files.append(".gitattributes")
1395-
run_command(GITS, ["add", "--"] + files)
1395+
run_command(GITS, ["add", "--", *files])
13961396

13971397

13981398
def versions_from_parentdir(parentdir_prefix, root, verbose):
@@ -2106,7 +2106,7 @@ def do_setup():
21062106
cfg = get_config_from_root(root)
21072107
except (OSError, configparser.NoSectionError,
21082108
configparser.NoOptionError) as e:
2109-
if isinstance(e, (OSError, configparser.NoSectionError)):
2109+
if isinstance(e, OSError | configparser.NoSectionError):
21102110
print("Adding sample versioneer config to setup.cfg",
21112111
file=sys.stderr)
21122112
with open(os.path.join(root, "setup.cfg"), "a") as f:

0 commit comments

Comments
 (0)