* [gentoo-commits] proj/portage:master commit in: lib/portage/tests/util/, lib/portage/util/, lib/portage/tests/bin/, ...
@ 2023-01-10 15:12 Sam James
0 siblings, 0 replies; only message in thread
From: Sam James @ 2023-01-10 15:12 UTC (permalink / raw
To: gentoo-commits
commit: d88ee7e03f900a16904f3c428449d71710ecaebd
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 10 13:21:13 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jan 10 15:12:38 2023 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=d88ee7e0
*/*: run Black post-flynt
Signed-off-by: Sam James <sam <AT> gentoo.org>
bin/binhost-snapshot | 3 +-
bin/egencache | 24 ++------
bin/glsa-check | 16 ++----
bin/portageq | 8 +--
bin/quickpkg | 3 +-
bin/regenworld | 4 +-
lib/_emerge/AbstractEbuildProcess.py | 4 +-
lib/_emerge/AsynchronousTask.py | 4 +-
lib/_emerge/BlockerDB.py | 4 +-
lib/_emerge/EbuildPhase.py | 6 +-
lib/_emerge/Package.py | 2 +-
lib/_emerge/PackageUninstall.py | 4 +-
lib/_emerge/Scheduler.py | 6 +-
lib/_emerge/UseFlagDisplay.py | 4 +-
lib/_emerge/actions.py | 30 +++-------
lib/_emerge/depgraph.py | 64 ++++++----------------
lib/_emerge/resolver/circular_dependency.py | 10 +---
lib/_emerge/resolver/output.py | 4 +-
lib/_emerge/resolver/output_helpers.py | 4 +-
lib/_emerge/resolver/slot_collision.py | 4 +-
lib/_emerge/search.py | 5 +-
lib/portage/_emirrordist/DeletionTask.py | 12 +---
lib/portage/_emirrordist/FetchIterator.py | 4 +-
lib/portage/_emirrordist/FetchTask.py | 4 +-
lib/portage/_sets/files.py | 9 +--
lib/portage/cache/sqlite.py | 4 +-
lib/portage/cache/template.py | 3 +-
lib/portage/checksum.py | 4 +-
lib/portage/dbapi/porttree.py | 2 +-
lib/portage/dbapi/vartree.py | 22 ++------
lib/portage/dep/__init__.py | 3 +-
lib/portage/dep/dep_check.py | 6 +-
lib/portage/emaint/main.py | 4 +-
lib/portage/emaint/modules/move/move.py | 4 +-
lib/portage/emaint/modules/resume/resume.py | 4 +-
lib/portage/emaint/modules/world/world.py | 4 +-
lib/portage/locks.py | 4 +-
lib/portage/package/ebuild/config.py | 4 +-
lib/portage/package/ebuild/doebuild.py | 4 +-
lib/portage/package/ebuild/fetch.py | 8 +--
lib/portage/process.py | 4 +-
lib/portage/sync/modules/git/git.py | 4 +-
lib/portage/sync/modules/mercurial/mercurial.py | 4 +-
lib/portage/sync/modules/rsync/rsync.py | 8 +--
lib/portage/sync/modules/svn/svn.py | 6 +-
lib/portage/sync/modules/webrsync/webrsync.py | 4 +-
lib/portage/sync/syncbase.py | 4 +-
lib/portage/tests/bin/test_eapi7_ver_funcs.py | 16 ++----
lib/portage/tests/dep/testAtom.py | 8 +--
lib/portage/tests/ebuild/test_fetch.py | 4 +-
lib/portage/tests/process/test_unshare_net.py | 4 +-
lib/portage/tests/resolver/ResolverPlayground.py | 10 ++--
lib/portage/tests/sync/test_sync_local.py | 4 +-
lib/portage/tests/util/test_install_mask.py | 4 +-
lib/portage/update.py | 4 +-
lib/portage/util/__init__.py | 4 +-
lib/portage/util/_dyn_libs/LinkageMapELF.py | 4 +-
.../util/_dyn_libs/display_preserved_libs.py | 5 +-
lib/portage/util/digraph.py | 4 +-
lib/portage/util/futures/executor/fork.py | 2 +-
lib/portage/util/movefile.py | 8 +--
lib/portage/versions.py | 3 +-
runtests | 4 +-
setup.py | 2 +-
64 files changed, 122 insertions(+), 324 deletions(-)
diff --git a/bin/binhost-snapshot b/bin/binhost-snapshot
index 5fac0b46c..05d2f514b 100755
--- a/bin/binhost-snapshot
+++ b/bin/binhost-snapshot
@@ -82,8 +82,7 @@ def main(argv):
if not os.path.isfile(src_pkgs_index):
parser.error(
- "src_pkg_dir does not contain a "
- + f"'Packages' index: '{src_pkg_dir}'"
+ "src_pkg_dir does not contain a " + f"'Packages' index: '{src_pkg_dir}'"
)
parse_result = urlparse(snapshot_uri)
diff --git a/bin/egencache b/bin/egencache
index 090b9b1ed..0050ca32a 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -254,9 +254,7 @@ try:
load_average = 0.0
if load_average <= 0.0:
- parser.error(
- f"Invalid: --load-average='{options.load_average}'"
- )
+ parser.error(f"Invalid: --load-average='{options.load_average}'")
options.load_average = load_average
@@ -265,19 +263,13 @@ try:
options.config_root = options.portage_configroot
if options.config_root is not None and not os.path.isdir(options.config_root):
- parser.error(
- f"Not a directory: --config-root='{options.config_root}'"
- )
+ parser.error(f"Not a directory: --config-root='{options.config_root}'")
if options.cache_dir is not None:
if not os.path.isdir(options.cache_dir):
- parser.error(
- f"Not a directory: --cache-dir='{options.cache_dir}'"
- )
+ parser.error(f"Not a directory: --cache-dir='{options.cache_dir}'")
if not os.access(options.cache_dir, os.W_OK):
- parser.error(
- f"Write access denied: --cache-dir='{options.cache_dir}'"
- )
+ parser.error(f"Write access denied: --cache-dir='{options.cache_dir}'")
for atom in args:
try:
@@ -603,9 +595,7 @@ try:
masked = False
version = self._portdb.xmatch(
"bestmatch-visible",
- Atom(
- f"{pkg_desc.cp}{_repo_separator}{self._repo_config.name}"
- ),
+ Atom(f"{pkg_desc.cp}{_repo_separator}{self._repo_config.name}"),
)
if not version:
version = pkg_desc.cpv_list[-1]
@@ -1072,9 +1062,7 @@ try:
# don't break filenames on hyphens
self._wrapper.break_on_hyphens = False
output.write(
- self._wrapper.fill(
- f"{date}; {author} {', '.join(changed)}:"
- )
+ self._wrapper.fill(f"{date}; {author} {', '.join(changed)}:")
)
# but feel free to break commit messages there
self._wrapper.break_on_hyphens = True
diff --git a/bin/glsa-check b/bin/glsa-check
index 436038702..388651e68 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -210,9 +210,7 @@ if "affected" in params:
myglsa = Glsa(x, portage.settings, vardb, portdb)
except (GlsaTypeException, GlsaFormatException) as e:
if verbose:
- sys.stderr.write(
- f"invalid GLSA: {x} (error message was: {e})\n"
- )
+ sys.stderr.write(f"invalid GLSA: {x} (error message was: {e})\n")
continue
if myglsa.isVulnerable():
glsalist.append(x)
@@ -319,9 +317,7 @@ if mode in ["dump", "fix", "inject", "pretend"]:
myglsa = Glsa(myid, portage.settings, vardb, portdb)
except (GlsaTypeException, GlsaFormatException) as e:
if verbose:
- sys.stderr.write(
- f"invalid GLSA: {myid} (error message was: {e})\n"
- )
+ sys.stderr.write(f"invalid GLSA: {myid} (error message was: {e})\n")
continue
if mode == "dump":
myglsa.dump()
@@ -413,9 +409,7 @@ if mode == "test":
myglsa = Glsa(myid, portage.settings, vardb, portdb)
except (GlsaTypeException, GlsaFormatException) as e:
if verbose:
- sys.stderr.write(
- f"invalid GLSA: {myid} (error message was: {e})\n"
- )
+ sys.stderr.write(f"invalid GLSA: {myid} (error message was: {e})\n")
continue
if myglsa.isVulnerable():
outputlist.append(str(myglsa.nr))
@@ -468,9 +462,7 @@ if mode == "mail":
myglsa = Glsa(myid, portage.settings, vardb, portdb)
except (GlsaTypeException, GlsaFormatException) as e:
if verbose:
- sys.stderr.write(
- f"invalid GLSA: {myid} (error message was: {e})\n"
- )
+ sys.stderr.write(f"invalid GLSA: {myid} (error message was: {e})\n")
continue
myfd = BytesIO()
myglsa.dump(outstream=myfd)
diff --git a/bin/portageq b/bin/portageq
index 97eb849a5..e9bd146b9 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -685,9 +685,7 @@ try:
@uses_eroot
def expand_virtual(argv):
if len(argv) != 2:
- writemsg(
- f"ERROR: expected 2 parameters, got {len(argv)}!\n", noiselevel=-1
- )
+ writemsg(f"ERROR: expected 2 parameters, got {len(argv)}!\n", noiselevel=-1)
return 2
root, atom = argv
@@ -1442,9 +1440,7 @@ try:
eapi = os.environ.get("EAPI")
def elog(elog_funcname, lines):
- cmd = (
- f"source '{os.environ['PORTAGE_BIN_PATH']}/isolated-functions.sh' ; "
- )
+ cmd = f"source '{os.environ['PORTAGE_BIN_PATH']}/isolated-functions.sh' ; "
for line in lines:
cmd += f"{elog_funcname} {portage._shell_quote(line)} ; "
subprocess.call([portage.const.BASH_BINARY, "-c", cmd])
diff --git a/bin/quickpkg b/bin/quickpkg
index 247dee375..1ecc079fe 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -102,8 +102,7 @@ def quickpkg_atom(options, infos, arg, eout):
restrict = use_reduce(restrict, uselist=use, flat=True)
except InvalidDependString as e:
eout.eerror(
- "Invalid RESTRICT metadata "
- + f"for '{cpv}': {str(e)}; skipping"
+ "Invalid RESTRICT metadata " + f"for '{cpv}': {str(e)}; skipping"
)
del e
continue
diff --git a/bin/regenworld b/bin/regenworld
index 9b58fbe2e..42a425557 100755
--- a/bin/regenworld
+++ b/bin/regenworld
@@ -109,9 +109,7 @@ for mykey in biglist:
print(f"* ignoring broken log entry for {mykey} (likely injected)")
except ValueError as e:
try:
- print(
- f"* {mykey} is an ambiguous package name, candidates are:\n{e}"
- )
+ print(f"* {mykey} is an ambiguous package name, candidates are:\n{e}")
except AttributeError:
# FIXME: Find out what causes this (bug #344845).
print(f"* {mykey} is an ambiguous package name")
diff --git a/lib/_emerge/AbstractEbuildProcess.py b/lib/_emerge/AbstractEbuildProcess.py
index d74d8225b..a8f830d1c 100644
--- a/lib/_emerge/AbstractEbuildProcess.py
+++ b/lib/_emerge/AbstractEbuildProcess.py
@@ -451,9 +451,7 @@ class AbstractEbuildProcess(SpawnProcess):
SpawnProcess._async_wait(self)
elif self._build_dir_unlock is None:
if self.returncode is None:
- raise asyncio.InvalidStateError(
- f"Result is not ready for {self}"
- )
+ raise asyncio.InvalidStateError(f"Result is not ready for {self}")
self._async_unlock_builddir(returncode=self.returncode)
def _async_unlock_builddir(self, returncode=None):
diff --git a/lib/_emerge/AsynchronousTask.py b/lib/_emerge/AsynchronousTask.py
index fcc80fd0c..b987cbbdb 100644
--- a/lib/_emerge/AsynchronousTask.py
+++ b/lib/_emerge/AsynchronousTask.py
@@ -88,9 +88,7 @@ class AsynchronousTask(SlotObject):
"""
if self.returncode is None:
if self.scheduler.is_running():
- raise asyncio.InvalidStateError(
- f"Result is not ready for {self}"
- )
+ raise asyncio.InvalidStateError(f"Result is not ready for {self}")
self.scheduler.run_until_complete(self.async_wait())
self._wait_hook()
return self.returncode
diff --git a/lib/_emerge/BlockerDB.py b/lib/_emerge/BlockerDB.py
index e0dd3c8fe..fe81e4ad5 100644
--- a/lib/_emerge/BlockerDB.py
+++ b/lib/_emerge/BlockerDB.py
@@ -128,9 +128,7 @@ class BlockerDB:
def discardBlocker(self, pkg):
"""Discard a package from the list of potential blockers.
This will match any package(s) with identical cpv or cp:slot."""
- for cpv_match in self._fake_vartree.dbapi.match_pkgs(
- Atom(f"={pkg.cpv}")
- ):
+ for cpv_match in self._fake_vartree.dbapi.match_pkgs(Atom(f"={pkg.cpv}")):
if cpv_match.cp == pkg.cp:
self._fake_vartree.cpv_discard(cpv_match)
for slot_match in self._fake_vartree.dbapi.match_pkgs(pkg.slot_atom):
diff --git a/lib/_emerge/EbuildPhase.py b/lib/_emerge/EbuildPhase.py
index 8e408dfc2..3d0828593 100644
--- a/lib/_emerge/EbuildPhase.py
+++ b/lib/_emerge/EbuildPhase.py
@@ -135,9 +135,7 @@ class EbuildPhase(CompositeTask):
maint_str = "<invalid metadata.xml>"
msg = []
- msg.append(
- f"Package: {self.settings.mycpv}:{self.settings['SLOT']}"
- )
+ msg.append(f"Package: {self.settings.mycpv}:{self.settings['SLOT']}")
if self.settings.get("PORTAGE_REPO_NAME"):
msg.append(f"Repository: {self.settings['PORTAGE_REPO_NAME']}")
if maint_str:
@@ -570,7 +568,7 @@ class _PostPhaseCommands(CompositeTask):
phase=self.phase,
scheduler=self.scheduler,
settings=self.settings,
- **kwargs
+ **kwargs,
)
)
diff --git a/lib/_emerge/Package.py b/lib/_emerge/Package.py
index 599884b80..d824401fa 100644
--- a/lib/_emerge/Package.py
+++ b/lib/_emerge/Package.py
@@ -262,7 +262,7 @@ class Package(Task):
repo_name=None,
root_config=None,
type_name=None,
- **kwargs
+ **kwargs,
):
if operation is None:
diff --git a/lib/_emerge/PackageUninstall.py b/lib/_emerge/PackageUninstall.py
index 929e134f1..f792b5fed 100644
--- a/lib/_emerge/PackageUninstall.py
+++ b/lib/_emerge/PackageUninstall.py
@@ -93,9 +93,7 @@ class PackageUninstall(CompositeTask):
self._async_unlock_builddir(returncode=retval)
return
- self._writemsg_level(
- f">>> Unmerging {self.pkg.cpv}...\n", noiselevel=-1
- )
+ self._writemsg_level(f">>> Unmerging {self.pkg.cpv}...\n", noiselevel=-1)
self._emergelog(f"=== Unmerging... ({self.pkg.cpv})")
cat, pf = portage.catsplit(self.pkg.cpv)
diff --git a/lib/_emerge/Scheduler.py b/lib/_emerge/Scheduler.py
index 139022ac0..19bb815ae 100644
--- a/lib/_emerge/Scheduler.py
+++ b/lib/_emerge/Scheduler.py
@@ -1132,9 +1132,7 @@ class Scheduler(PollScheduler):
def sighandler(signum, frame):
signal.signal(signal.SIGINT, signal.SIG_IGN)
signal.signal(signal.SIGTERM, signal.SIG_IGN)
- portage.util.writemsg(
- f"\n\nExiting on signal {signum}\n"
- )
+ portage.util.writemsg(f"\n\nExiting on signal {signum}\n")
self.terminate()
received_signal.append(128 + signum)
@@ -2251,7 +2249,7 @@ class Scheduler(PollScheduler):
world_set.add(atom)
else:
writemsg_level(
- f'\n!!! Unable to record {atom} in "world\"\n',
+ f'\n!!! Unable to record {atom} in "world"\n',
level=logging.WARN,
noiselevel=-1,
)
diff --git a/lib/_emerge/UseFlagDisplay.py b/lib/_emerge/UseFlagDisplay.py
index 403df95a2..2cfc6f77e 100644
--- a/lib/_emerge/UseFlagDisplay.py
+++ b/lib/_emerge/UseFlagDisplay.py
@@ -110,8 +110,6 @@ def pkg_use_display(pkg, opts, modified_use=None):
flags.sort(key=UseFlagDisplay.sort_combined)
else:
flags.sort(key=UseFlagDisplay.sort_separated)
- flag_displays.append(
- f"{varname}=\"{' '.join('{}'.format(f) for f in flags)}\""
- )
+ flag_displays.append(f"{varname}=\"{' '.join('{}'.format(f) for f in flags)}\"")
return " ".join(flag_displays)
diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py
index ca1cafde2..b536e4a26 100644
--- a/lib/_emerge/actions.py
+++ b/lib/_emerge/actions.py
@@ -823,8 +823,7 @@ def action_depclean(
msg.append("unless *all* required dependencies have been resolved. As a\n")
msg.append("consequence of this, it often becomes necessary to run \n")
msg.append(
- f"{good('`emerge --update --newuse --deep @world`')}"
- + " prior to depclean.\n"
+ f"{good('`emerge --update --newuse --deep @world`')}" + " prior to depclean.\n"
)
if action == "depclean" and "--quiet" not in myopts and not myfiles:
@@ -1179,9 +1178,7 @@ def _calc_depclean(settings, trees, ldpath_mtimes, myopts, action, args_set, spi
and atom != atom.unevaluated_atom
and vardb.match(Atom(str(atom)))
):
- msg.append(
- f" {atom.unevaluated_atom} ({atom}) pulled in by:"
- )
+ msg.append(f" {atom.unevaluated_atom} ({atom}) pulled in by:")
else:
msg.append(f" {atom} pulled in by:")
msg.append(f" {parent}")
@@ -1339,9 +1336,7 @@ def _calc_depclean(settings, trees, ldpath_mtimes, myopts, action, args_set, spi
f">>> To see reverse dependencies, use {good('--verbose')}\n"
)
if action == "prune":
- writemsg_level(
- f">>> To ignore dependencies, use {good('--nodeps')}\n"
- )
+ writemsg_level(f">>> To ignore dependencies, use {good('--nodeps')}\n")
return pkgs_to_remove
@@ -1536,9 +1531,7 @@ def _calc_depclean(settings, trees, ldpath_mtimes, myopts, action, args_set, spi
msg.append(f" {pkg.cpv} pulled in by:")
for consumer in unique_consumers:
libs = consumer_libs[consumer]
- msg.append(
- f" {consumer} needs {', '.join(sorted(libs))}"
- )
+ msg.append(f" {consumer} needs {', '.join(sorted(libs))}")
msg.append("")
writemsg_level(
"".join(prefix + f"{line}\n" for line in msg),
@@ -2422,9 +2415,7 @@ def action_search(root_config, myopts, myfiles, spinner):
try:
searchinstance.execute(mysearch)
except re.error as comment:
- print(
- f'\n!!! Regular expression error in "{mysearch}": {comment}'
- )
+ print(f'\n!!! Regular expression error in "{mysearch}": {comment}')
sys.exit(1)
searchinstance.output()
@@ -2495,9 +2486,7 @@ def action_uninstall(settings, trees, ldpath_mtimes, opts, action, files, spinne
+ "fully-qualified ebuild names instead:"
)
for line in textwrap.wrap(msg, 70):
- writemsg_level(
- f"!!! {line}\n", level=logging.ERROR, noiselevel=-1
- )
+ writemsg_level(f"!!! {line}\n", level=logging.ERROR, noiselevel=-1)
for i in e.args[0]:
writemsg_level(
f" {colorize('INFORM', i)}\n",
@@ -3198,8 +3187,7 @@ def missing_sets_warning(root_config, missing_sets):
else:
missing_sets_str = f'"{missing_sets[-1]}"'
msg = [
- "emerge: incomplete set configuration, "
- + f"missing set(s): {missing_sets_str}"
+ "emerge: incomplete set configuration, " + f"missing set(s): {missing_sets_str}"
]
if root_config.sets:
msg.append(f" sets defined: {', '.join(root_config.sets)}")
@@ -3363,9 +3351,7 @@ def expand_set_arguments(myfiles, myaction, root_config):
else:
newargs.extend(set_atoms)
for error_msg in sets[s].errors:
- writemsg_level(
- f"{error_msg}\n", level=logging.ERROR, noiselevel=-1
- )
+ writemsg_level(f"{error_msg}\n", level=logging.ERROR, noiselevel=-1)
else:
newargs.append(a)
return (newargs, retval)
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index bdac29bb1..0f5e02941 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -800,9 +800,7 @@ class depgraph:
)
for root in atoms:
- writemsg_level(
- f" root: {root}\n", level=logging.DEBUG, noiselevel=-1
- )
+ writemsg_level(f" root: {root}\n", level=logging.DEBUG, noiselevel=-1)
for atom in atoms[root]:
writemsg_level(
f" atom: {atom}\n", level=logging.DEBUG, noiselevel=-1
@@ -983,9 +981,7 @@ class depgraph:
writemsg_level("forced rebuilds:\n", level=logging.DEBUG, noiselevel=-1)
for root in forced_rebuilds:
- writemsg_level(
- f" root: {root}\n", level=logging.DEBUG, noiselevel=-1
- )
+ writemsg_level(f" root: {root}\n", level=logging.DEBUG, noiselevel=-1)
for child in forced_rebuilds[root]:
writemsg_level(
f" child: {child}\n", level=logging.DEBUG, noiselevel=-1
@@ -1011,9 +1007,7 @@ class depgraph:
for root in self._forced_rebuilds:
for child in self._forced_rebuilds[root]:
- writemsg_stdout(
- f" {child} causes rebuilds for:\n", noiselevel=-1
- )
+ writemsg_stdout(f" {child} causes rebuilds for:\n", noiselevel=-1)
for parent in self._forced_rebuilds[root][child]:
writemsg_stdout(f" {parent}\n", noiselevel=-1)
@@ -1470,9 +1464,7 @@ class depgraph:
use_display = ""
msg.append(2 * indent)
- msg.append(
- f"{atom} required by {parent} {use_display}\n"
- )
+ msg.append(f"{atom} required by {parent} {use_display}\n")
msg.append(2 * indent)
msg.append(marker)
msg.append("\n")
@@ -2112,9 +2104,7 @@ class depgraph:
for unbuilt_child in chain(
matches,
- self._iter_match_pkgs(
- root_config, "ebuild", Atom(f"={dep.child.cpv}")
- ),
+ self._iter_match_pkgs(root_config, "ebuild", Atom(f"={dep.child.cpv}")),
):
if unbuilt_child in self._dynamic_config._runtime_pkg_mask:
continue
@@ -4029,9 +4019,7 @@ class depgraph:
strict = pkg.type_name != "installed"
if debug:
- writemsg_level(
- f"\nParent: {pkg}\n", noiselevel=-1, level=logging.DEBUG
- )
+ writemsg_level(f"\nParent: {pkg}\n", noiselevel=-1, level=logging.DEBUG)
dep_repr = portage.dep.paren_enclose(
dep_string, unevaluated_atom=True, opconvert=True
)
@@ -4283,9 +4271,7 @@ class depgraph:
traversed_virt_pkgs.add(dep.child)
if debug:
- writemsg_level(
- f"\nExiting... {pkg}\n", noiselevel=-1, level=logging.DEBUG
- )
+ writemsg_level(f"\nExiting... {pkg}\n", noiselevel=-1, level=logging.DEBUG)
return 1
@@ -5180,9 +5166,7 @@ class depgraph:
writemsg(
f"\n\n!!! Problem in '{atom}' dependencies.\n", noiselevel=-1
)
- writemsg(
- f"!!! {str(e)} {str(getattr(e, '__module__', None))}\n"
- )
+ writemsg(f"!!! {str(e)} {str(getattr(e, '__module__', None))}\n")
raise
try:
@@ -6903,9 +6887,7 @@ class depgraph:
return self._pkg(pkg.cpv, "ebuild", pkg.root_config, myrepo=pkg.repo)
except portage.exception.PackageNotFound:
return next(
- self._iter_match_pkgs(
- pkg.root_config, "ebuild", Atom(f"={pkg.cpv}")
- ),
+ self._iter_match_pkgs(pkg.root_config, "ebuild", Atom(f"={pkg.cpv}")),
None,
)
@@ -8524,9 +8506,7 @@ class depgraph:
self._dynamic_config._blocker_parents.add(blocker, pkg)
except portage.exception.InvalidAtom as e:
depstr = " ".join(vardb.aux_get(pkg.cpv, dep_keys))
- show_invalid_depstring_notice(
- pkg, f"Invalid Atom: {e}"
- )
+ show_invalid_depstring_notice(pkg, f"Invalid Atom: {e}")
return False
for cpv in stale_cache:
del blocker_cache[cpv]
@@ -9979,9 +9959,7 @@ class depgraph:
% (atom.unevaluated_atom, atom, parent, use_display)
)
else:
- msg.append(
- f"{atom} required by {parent} {use_display}"
- )
+ msg.append(f"{atom} required by {parent} {use_display}")
msg.append("\n")
msg.append("\n")
@@ -10102,9 +10080,7 @@ class depgraph:
f"={pkg.cpv} {keyword}\n"
)
else:
- unstable_keyword_msg[root].append(
- f"={pkg.cpv} {keyword}\n"
- )
+ unstable_keyword_msg[root].append(f"={pkg.cpv} {keyword}\n")
p_mask_change_msg = {}
for pkg in self._dynamic_config._needed_p_mask_changes:
@@ -10390,9 +10366,7 @@ class depgraph:
if e.errno == errno.ENOENT:
file_contents = []
else:
- problems.append(
- f"!!! Failed to read '{file_to_write_to}': {e}\n"
- )
+ problems.append(f"!!! Failed to read '{file_to_write_to}': {e}\n")
if file_contents is not None:
file_contents.extend(changes)
if not autounmask_continue and protect_obj[root].isprotected(
@@ -10535,9 +10509,7 @@ class depgraph:
for depgraph_sets in self._dynamic_config.sets.values():
for pset in depgraph_sets.sets.values():
for error_msg in pset.errors:
- writemsg_level(
- f"{error_msg}\n", level=logging.ERROR, noiselevel=-1
- )
+ writemsg_level(f"{error_msg}\n", level=logging.ERROR, noiselevel=-1)
# TODO: Add generic support for "set problem" handlers so that
# the below warnings aren't special cases for world only.
@@ -10774,9 +10746,7 @@ class depgraph:
if "--ask" in self._frozen_config.myopts:
writemsg_stdout("\n", noiselevel=-1)
for a in all_added:
- writemsg_stdout(
- f" {colorize('GOOD', '*')} {a}\n", noiselevel=-1
- )
+ writemsg_stdout(f" {colorize('GOOD', '*')} {a}\n", noiselevel=-1)
writemsg_stdout("\n", noiselevel=-1)
prompt = (
"Would you like to add these packages to your world " "favorites?"
@@ -11482,9 +11452,7 @@ def _spinner_start(spinner, myopts):
if "--unordered-display" in myopts:
portage.writemsg_stdout(
"\n"
- + darkgreen(
- "These are the packages that " + f"would be {action}:"
- )
+ + darkgreen("These are the packages that " + f"would be {action}:")
+ "\n\n"
)
else:
diff --git a/lib/_emerge/resolver/circular_dependency.py b/lib/_emerge/resolver/circular_dependency.py
index db599a94b..c43abc44c 100644
--- a/lib/_emerge/resolver/circular_dependency.py
+++ b/lib/_emerge/resolver/circular_dependency.py
@@ -88,10 +88,7 @@ class circular_dependency_handler:
parent = self.shortest_cycle[pos - 1]
priorities = self.graph.nodes[parent][0][pkg]
if pos > 0:
- msg.append(
- indent
- + f"{pkg} ({priorities[-1]})"
- )
+ msg.append(indent + f"{pkg} ({priorities[-1]})")
else:
msg.append(indent + f"{pkg} depends on")
indent += " "
@@ -99,10 +96,7 @@ class circular_dependency_handler:
pkg = self.shortest_cycle[0]
parent = self.shortest_cycle[-1]
priorities = self.graph.nodes[parent][0][pkg]
- msg.append(
- indent
- + f"{pkg} ({priorities[-1]})"
- )
+ msg.append(indent + f"{pkg} ({priorities[-1]})")
return "\n".join(msg)
diff --git a/lib/_emerge/resolver/output.py b/lib/_emerge/resolver/output.py
index 24517e548..4d4626c33 100644
--- a/lib/_emerge/resolver/output.py
+++ b/lib/_emerge/resolver/output.py
@@ -924,9 +924,7 @@ class Display:
if self.conf.verbosity == 3:
self.print_verbose(show_repos)
for pkg, pkg_info in self.restrict_fetch_list.items():
- writemsg_stdout(
- f"\nFetch instructions for {pkg.cpv}:\n", noiselevel=-1
- )
+ writemsg_stdout(f"\nFetch instructions for {pkg.cpv}:\n", noiselevel=-1)
spawn_nofetch(
self.conf.trees[pkg.root]["porttree"].dbapi, pkg_info.ebuild_path
)
diff --git a/lib/_emerge/resolver/output_helpers.py b/lib/_emerge/resolver/output_helpers.py
index f949eba8f..f27186181 100644
--- a/lib/_emerge/resolver/output_helpers.py
+++ b/lib/_emerge/resolver/output_helpers.py
@@ -139,9 +139,7 @@ class _PackageCounters:
if self.uninst > 1:
details[-1] += "s"
if self.interactive > 0:
- details.append(
- f"{self.interactive} {colorize('WARN', 'interactive')}"
- )
+ details.append(f"{self.interactive} {colorize('WARN', 'interactive')}")
myoutput.append(", ".join(details))
if total_installs != 0:
myoutput.append(")")
diff --git a/lib/_emerge/resolver/slot_collision.py b/lib/_emerge/resolver/slot_collision.py
index aad97014a..4ccd756b7 100644
--- a/lib/_emerge/resolver/slot_collision.py
+++ b/lib/_emerge/resolver/slot_collision.py
@@ -638,9 +638,7 @@ class slot_conflict_handler:
else:
use_display = ""
if atom.soname:
- msg.append(
- f"{atom} required by {parent} {use_display}\n"
- )
+ msg.append(f"{atom} required by {parent} {use_display}\n")
elif isinstance(parent, PackageArg):
# For PackageArg it's
# redundant to display the atom attribute.
diff --git a/lib/_emerge/search.py b/lib/_emerge/search.py
index 07b28ba94..6bdb4b739 100644
--- a/lib/_emerge/search.py
+++ b/lib/_emerge/search.py
@@ -481,10 +481,7 @@ class search:
try:
mysum[0] = mf.getDistfilesSize(uri_map)
except KeyError as e:
- file_size_str = (
- "Unknown (missing "
- + f"digest for {e})"
- )
+ file_size_str = "Unknown (missing " + f"digest for {e})"
del e
available = False
diff --git a/lib/portage/_emirrordist/DeletionTask.py b/lib/portage/_emirrordist/DeletionTask.py
index 88015ea4b..d01a6496c 100644
--- a/lib/portage/_emirrordist/DeletionTask.py
+++ b/lib/portage/_emirrordist/DeletionTask.py
@@ -59,9 +59,7 @@ class DeletionTask(CompositeTask):
os.unlink(self.distfile_path)
except OSError as e:
if e.errno not in (errno.ENOENT, errno.ESTALE):
- logger.error(
- f"{self.distfile} unlink failed in distfiles: {e}"
- )
+ logger.error(f"{self.distfile} unlink failed in distfiles: {e}")
success = False
if success:
@@ -85,9 +83,7 @@ class DeletionTask(CompositeTask):
os.unlink(copier.src_path)
except OSError as e:
if e.errno not in (errno.ENOENT, errno.ESTALE):
- logger.error(
- f"{self.distfile} unlink failed in distfiles: {e}"
- )
+ logger.error(f"{self.distfile} unlink failed in distfiles: {e}")
success = False
else:
@@ -118,9 +114,7 @@ class DeletionTask(CompositeTask):
os.unlink(distfile_path)
except OSError as e:
if e.errno not in (errno.ENOENT, errno.ESTALE):
- logger.error(
- f"{self.distfile} unlink failed in distfiles: {e}"
- )
+ logger.error(f"{self.distfile} unlink failed in distfiles: {e}")
success = False
if success:
diff --git a/lib/portage/_emirrordist/FetchIterator.py b/lib/portage/_emirrordist/FetchIterator.py
index 2d7945b0f..50e2f58e7 100644
--- a/lib/portage/_emirrordist/FetchIterator.py
+++ b/lib/portage/_emirrordist/FetchIterator.py
@@ -237,9 +237,7 @@ def _async_fetch_tasks(config, hash_filter, repo_config, digests_future, cpv, lo
except (OSError, PortageException) as e:
digests_future.done() or digests_future.set_exception(e)
for filename in new_uri_map:
- config.log_failure(
- f"{cpv}\t{filename}\tManifest exception {e}"
- )
+ config.log_failure(f"{cpv}\t{filename}\tManifest exception {e}")
config.file_failures[filename] = cpv
result.set_result(fetch_tasks)
return
diff --git a/lib/portage/_emirrordist/FetchTask.py b/lib/portage/_emirrordist/FetchTask.py
index 1521a25be..ebf418578 100644
--- a/lib/portage/_emirrordist/FetchTask.py
+++ b/lib/portage/_emirrordist/FetchTask.py
@@ -174,9 +174,7 @@ class FetchTask(CompositeTask):
if self.config.options.dry_run:
if os.path.exists(recycle_file):
- logger.info(
- f"dry-run: delete '{self.distfile}' from recycle"
- )
+ logger.info(f"dry-run: delete '{self.distfile}' from recycle")
else:
try:
os.unlink(recycle_file)
diff --git a/lib/portage/_sets/files.py b/lib/portage/_sets/files.py
index e76cd1e86..46c39b3c7 100644
--- a/lib/portage/_sets/files.py
+++ b/lib/portage/_sets/files.py
@@ -76,10 +76,7 @@ class StaticFileSet(EditablePackageSet):
def write(self):
write_atomic(
self._filename,
- "".join(
- f"{atom}\n"
- for atom in sorted(chain(self._atoms, self._nonatoms))
- ),
+ "".join(f"{atom}\n" for atom in sorted(chain(self._atoms, self._nonatoms))),
)
def load(self):
@@ -395,9 +392,7 @@ class WorldSelectedSetsSet(EditablePackageSet):
return setname.startswith(SETPREFIX)
def write(self):
- write_atomic(
- self._filename, "".join(sorted(f"{x}\n" for x in self._nonatoms))
- )
+ write_atomic(self._filename, "".join(sorted(f"{x}\n" for x in self._nonatoms)))
def load(self):
atoms_changed = False
diff --git a/lib/portage/cache/sqlite.py b/lib/portage/cache/sqlite.py
index 00b6807a4..26f6b811a 100644
--- a/lib/portage/cache/sqlite.py
+++ b/lib/portage/cache/sqlite.py
@@ -139,9 +139,7 @@ class database(fs_template.FsBased):
table_parameters.append(f"{self._db_table['packages']['package_key']} TEXT")
for k in self._allowed_keys:
table_parameters.append(f"{k} TEXT")
- table_parameters.append(
- f"UNIQUE({self._db_table['packages']['package_key']})"
- )
+ table_parameters.append(f"UNIQUE({self._db_table['packages']['package_key']})")
create_statement.append(",".join(table_parameters))
create_statement.append(")")
diff --git a/lib/portage/cache/template.py b/lib/portage/cache/template.py
index 7fc8946bb..90c3685b2 100644
--- a/lib/portage/cache/template.py
+++ b/lib/portage/cache/template.py
@@ -315,8 +315,7 @@ def serialize_eclasses(eclass_dict, chf_type="mtime", paths=True):
for k, v in sorted(eclass_dict.items(), key=_keysorter)
)
return "\t".join(
- f"{k}\t{getter(v)}"
- for k, v in sorted(eclass_dict.items(), key=_keysorter)
+ f"{k}\t{getter(v)}" for k, v in sorted(eclass_dict.items(), key=_keysorter)
)
diff --git a/lib/portage/checksum.py b/lib/portage/checksum.py
index f93d7fbd4..352b4429b 100644
--- a/lib/portage/checksum.py
+++ b/lib/portage/checksum.py
@@ -272,9 +272,7 @@ if "RMD160" not in hashfunc_map or "WHIRLPOOL" not in hashfunc_map:
("RMD160", "RIPEMD160"),
("WHIRLPOOL", "WHIRLPOOL"),
):
- if local_name not in hashfunc_map and hasattr(
- mhash, f"MHASH_{hash_name}"
- ):
+ if local_name not in hashfunc_map and hasattr(mhash, f"MHASH_{hash_name}"):
_generate_hash_function(
local_name,
functools.partial(
diff --git a/lib/portage/dbapi/porttree.py b/lib/portage/dbapi/porttree.py
index 51e197bb6..b2f07956d 100644
--- a/lib/portage/dbapi/porttree.py
+++ b/lib/portage/dbapi/porttree.py
@@ -312,7 +312,7 @@ class portdbapi(dbapi):
x,
self._known_keys,
readonly=True,
- **cache_kwargs
+ **cache_kwargs,
)
except CacheError:
pass
diff --git a/lib/portage/dbapi/vartree.py b/lib/portage/dbapi/vartree.py
index 78197b533..5b6a9ea83 100644
--- a/lib/portage/dbapi/vartree.py
+++ b/lib/portage/dbapi/vartree.py
@@ -703,7 +703,7 @@ class vardbapi(dbapi):
self._aux_cache_filename, encoding=_encodings["fs"], errors="strict"
),
mode="rb",
- **open_kwargs
+ **open_kwargs,
) as f:
mypickle = pickle.Unpickler(f)
try:
@@ -1080,9 +1080,7 @@ class vardbapi(dbapi):
# Method parameters may override QUICKPKG_DEFAULT_OPTS.
opts_list = portage.util.shlex_split(settings.get("QUICKPKG_DEFAULT_OPTS", ""))
if include_config is not None:
- opts_list.append(
- f"--include-config={'y' if include_config else 'n'}"
- )
+ opts_list.append(f"--include-config={'y' if include_config else 'n'}")
if include_unmodified_config is not None:
opts_list.append(
"--include-unmodified-config={}".format(
@@ -1329,9 +1327,7 @@ class vardbapi(dbapi):
try:
entry = NeededEntry.parse(needed_filename, l)
except InvalidData as e:
- writemsg_level(
- f"\n{e}\n\n", level=logging.ERROR, noiselevel=-1
- )
+ writemsg_level(f"\n{e}\n\n", level=logging.ERROR, noiselevel=-1)
continue
filename = os.path.join(root, entry.filename.lstrip(os.sep))
@@ -2450,9 +2446,7 @@ class dblink:
level=logging.ERROR,
noiselevel=-1,
)
- showMessage(
- f"{eapi_unsupported}\n", level=logging.ERROR, noiselevel=-1
- )
+ showMessage(f"{eapi_unsupported}\n", level=logging.ERROR, noiselevel=-1)
elif os.path.isfile(myebuildpath):
phase = EbuildPhase(
background=background,
@@ -2649,9 +2643,7 @@ class dblink:
)
def _show_unmerge(self, zing, desc, file_type, file_name):
- self._display_merge(
- f"{zing} {desc.ljust(8)} {file_type} {file_name}\n"
- )
+ self._display_merge(f"{zing} {desc.ljust(8)} {file_type} {file_name}\n")
def _unmerge_pkgfiles(self, pkgfiles, others_in_slot):
"""
@@ -4888,9 +4880,7 @@ class dblink:
msg = []
msg.append(pkg_info_strs[pkg.mycpv])
for f in sorted(owned_files):
- msg.append(
- f"\t{os.path.join(destroot, f.lstrip(os.path.sep))}"
- )
+ msg.append(f"\t{os.path.join(destroot, f.lstrip(os.path.sep))}")
msg.append("")
collision_message_type(msg)
diff --git a/lib/portage/dep/__init__.py b/lib/portage/dep/__init__.py
index d48d5653c..45ea6b571 100644
--- a/lib/portage/dep/__init__.py
+++ b/lib/portage/dep/__init__.py
@@ -1669,8 +1669,7 @@ class Atom(str):
if eapi is not None:
if not isinstance(eapi, str):
raise TypeError(
- "expected eapi argument of "
- + f"{str}, got {type(eapi)}: {eapi}"
+ "expected eapi argument of " + f"{str}, got {type(eapi)}: {eapi}"
)
if self.slot and not eapi_attrs.slot_deps:
raise InvalidAtom(
diff --git a/lib/portage/dep/dep_check.py b/lib/portage/dep/dep_check.py
index 2f674b38a..9730b893b 100644
--- a/lib/portage/dep/dep_check.py
+++ b/lib/portage/dep/dep_check.py
@@ -31,7 +31,7 @@ def _expand_new_virtuals(
trees=None,
use_mask=None,
use_force=None,
- **kwargs
+ **kwargs,
):
"""
In order to solve bug #141118, recursively expand new-style virtuals so
@@ -96,7 +96,7 @@ def _expand_new_virtuals(
trees=trees,
use_mask=use_mask,
use_force=use_force,
- **kwargs
+ **kwargs,
)
if is_disjunction:
if len(x_exp) == 1:
@@ -241,7 +241,7 @@ def _expand_new_virtuals(
mysettings,
myroot=myroot,
trees=trees,
- **pkg_kwargs
+ **pkg_kwargs,
)
finally:
# Restore previous EAPI after recursion.
diff --git a/lib/portage/emaint/main.py b/lib/portage/emaint/main.py
index 8f4743af9..805113b78 100644
--- a/lib/portage/emaint/main.py
+++ b/lib/portage/emaint/main.py
@@ -205,9 +205,7 @@ def emaint_main(myargv):
check_opt = opt
if opt.status and getattr(options, opt.target, False):
if long_action is not None:
- parser.error(
- f"--{long_action} and {opt.long} are exclusive options"
- )
+ parser.error(f"--{long_action} and {opt.long} are exclusive options")
status = opt.status
func = opt.func
long_action = opt.long.lstrip("-")
diff --git a/lib/portage/emaint/modules/move/move.py b/lib/portage/emaint/modules/move/move.py
index 328f3b36a..a77c4a50f 100644
--- a/lib/portage/emaint/modules/move/move.py
+++ b/lib/portage/emaint/modules/move/move.py
@@ -87,9 +87,7 @@ class MoveHandler:
if maybe_applied.build_time == build_time:
break
else:
- errors.append(
- f"'{cpv}' moved to '{newcp}'"
- )
+ errors.append(f"'{cpv}' moved to '{newcp}'")
elif update_cmd[0] == "slotmove":
pkg, origslot, newslot = update_cmd[1:]
atom = pkg.with_slot(origslot)
diff --git a/lib/portage/emaint/modules/resume/resume.py b/lib/portage/emaint/modules/resume/resume.py
index c80294f59..418513334 100644
--- a/lib/portage/emaint/modules/resume/resume.py
+++ b/lib/portage/emaint/modules/resume/resume.py
@@ -32,9 +32,7 @@ class CleanResume:
if mergelist is None or not hasattr(mergelist, "__len__"):
messages.append(f"unrecognized resume list: '{k}'")
continue
- messages.append(
- f"resume list '{k}' contains {len(mergelist)} packages"
- )
+ messages.append(f"resume list '{k}' contains {len(mergelist)} packages")
finally:
if onProgress:
onProgress(maxval, i + 1)
diff --git a/lib/portage/emaint/modules/world/world.py b/lib/portage/emaint/modules/world/world.py
index edb5a0f0a..4fd7bf8f4 100644
--- a/lib/portage/emaint/modules/world/world.py
+++ b/lib/portage/emaint/modules/world/world.py
@@ -86,9 +86,7 @@ class WorldHandler:
try:
world_set.replace(self.okay)
except portage.exception.PortageException:
- errors.append(
- f"{self.world_file} could not be opened for writing"
- )
+ errors.append(f"{self.world_file} could not be opened for writing")
if errors:
return (False, errors)
return (True, None)
diff --git a/lib/portage/locks.py b/lib/portage/locks.py
index 45840faac..67d436ff0 100644
--- a/lib/portage/locks.py
+++ b/lib/portage/locks.py
@@ -342,9 +342,7 @@ def _lockfile_iteration(
_("Error while waiting " "to lock '%s'")
% lockfilename
)
- writemsg(
- f"\n!!! {context_desc}: {e}\n", noiselevel=-1
- )
+ writemsg(f"\n!!! {context_desc}: {e}\n", noiselevel=-1)
time.sleep(_HARDLINK_POLL_LATENCY)
continue
diff --git a/lib/portage/package/ebuild/config.py b/lib/portage/package/ebuild/config.py
index b605b8e9a..23b524235 100644
--- a/lib/portage/package/ebuild/config.py
+++ b/lib/portage/package/ebuild/config.py
@@ -551,9 +551,7 @@ class config:
user_auxdbmodule is not None
and user_auxdbmodule in self._module_aliases
):
- warnings.warn(
- f"'{user_auxdbmodule}' is deprecated: {modules_file}"
- )
+ warnings.warn(f"'{user_auxdbmodule}' is deprecated: {modules_file}")
self.modules["default"] = {
"portdbapi.auxdbmodule": "portage.cache.flat_hash.mtime_md5_database",
diff --git a/lib/portage/package/ebuild/doebuild.py b/lib/portage/package/ebuild/doebuild.py
index 95a29505c..f03b273ea 100644
--- a/lib/portage/package/ebuild/doebuild.py
+++ b/lib/portage/package/ebuild/doebuild.py
@@ -883,9 +883,7 @@ def doebuild(
mydo = "fetch"
if mydo not in clean_phases and not os.path.exists(myebuild):
- writemsg(
- f"!!! doebuild: {myebuild} not found for {mydo}\n", noiselevel=-1
- )
+ writemsg(f"!!! doebuild: {myebuild} not found for {mydo}\n", noiselevel=-1)
return 1
global _doebuild_manifest_cache
diff --git a/lib/portage/package/ebuild/fetch.py b/lib/portage/package/ebuild/fetch.py
index ecc1acdd5..46e44ed34 100644
--- a/lib/portage/package/ebuild/fetch.py
+++ b/lib/portage/package/ebuild/fetch.py
@@ -370,9 +370,7 @@ def _check_distfile(filename, digests, eout, show_errors=1, hash_filter=None):
if hash_filter is not None:
digests = _apply_hash_filter(digests, hash_filter)
if _check_digests(filename, digests, show_errors=show_errors):
- eout.ebegin(
- f"{os.path.basename(filename)} {' '.join(sorted(digests))} ;-)"
- )
+ eout.ebegin(f"{os.path.basename(filename)} {' '.join(sorted(digests))} ;-)")
eout.eend(0)
else:
return (False, st)
@@ -1553,9 +1551,7 @@ def fetch(
if digests:
digests = list(digests)
digests.sort()
- eout.ebegin(
- f"{myfile} {' '.join(digests)} ;-)"
- )
+ eout.ebegin(f"{myfile} {' '.join(digests)} ;-)")
eout.eend(0)
continue # fetch any remaining files
diff --git a/lib/portage/process.py b/lib/portage/process.py
index ac270d99a..5ba6c7867 100644
--- a/lib/portage/process.py
+++ b/lib/portage/process.py
@@ -89,9 +89,7 @@ elif os.path.isdir(f"/proc/{portage.getpid()}/fd"):
# os.getpid() must be called from inside the function.
def get_open_fds():
return (
- int(fd)
- for fd in os.listdir(f"/proc/{portage.getpid()}/fd")
- if fd.isdigit()
+ int(fd) for fd in os.listdir(f"/proc/{portage.getpid()}/fd") if fd.isdigit()
)
else:
diff --git a/lib/portage/sync/modules/git/git.py b/lib/portage/sync/modules/git/git.py
index 5ad6e61eb..bd31f0445 100644
--- a/lib/portage/sync/modules/git/git.py
+++ b/lib/portage/sync/modules/git/git.py
@@ -418,9 +418,7 @@ class GitSync(NewBase):
env = None
if openpgp_env is not None and self.repo.sync_openpgp_key_path is not None:
try:
- out.einfo(
- f"Using keys from {self.repo.sync_openpgp_key_path}"
- )
+ out.einfo(f"Using keys from {self.repo.sync_openpgp_key_path}")
with open(self.repo.sync_openpgp_key_path, "rb") as f:
openpgp_env.import_key(f)
self._refresh_keys(openpgp_env)
diff --git a/lib/portage/sync/modules/mercurial/mercurial.py b/lib/portage/sync/modules/mercurial/mercurial.py
index 984a0ddde..6a3016a1f 100644
--- a/lib/portage/sync/modules/mercurial/mercurial.py
+++ b/lib/portage/sync/modules/mercurial/mercurial.py
@@ -84,7 +84,7 @@ class MercurialSync(NewBase):
exitcode = portage.process.spawn(
shlex_split(hg_cmd),
cwd=portage._unicode_encode(self.repo.location),
- **self.spawn_kwargs
+ **self.spawn_kwargs,
)
if exitcode != os.EX_OK:
msg = f"!!! hg clone error in {self.repo.location}"
@@ -141,7 +141,7 @@ class MercurialSync(NewBase):
exitcode = portage.process.spawn(
shlex_split(hg_cmd),
cwd=portage._unicode_encode(self.repo.location),
- **self.spawn_kwargs
+ **self.spawn_kwargs,
)
if exitcode != os.EX_OK:
msg = f"!!! hg pull error in {self.repo.location}"
diff --git a/lib/portage/sync/modules/rsync/rsync.py b/lib/portage/sync/modules/rsync/rsync.py
index 87aadd0e1..5f2482ea1 100644
--- a/lib/portage/sync/modules/rsync/rsync.py
+++ b/lib/portage/sync/modules/rsync/rsync.py
@@ -159,9 +159,7 @@ class RsyncSync(NewBase):
# so we may as well bail out before actual rsync happens.
if openpgp_env is not None and self.repo.sync_openpgp_key_path is not None:
try:
- out.einfo(
- f"Using keys from {self.repo.sync_openpgp_key_path}"
- )
+ out.einfo(f"Using keys from {self.repo.sync_openpgp_key_path}")
with open(self.repo.sync_openpgp_key_path, "rb") as f:
openpgp_env.import_key(f)
self._refresh_keys(openpgp_env)
@@ -458,9 +456,7 @@ class RsyncSync(NewBase):
% (m.openpgp_signature.primary_key_fingerprint)
)
out.einfo(f"- subkey: {m.openpgp_signature.fingerprint}")
- out.einfo(
- f"- timestamp: {m.openpgp_signature.timestamp} UTC"
- )
+ out.einfo(f"- timestamp: {m.openpgp_signature.timestamp} UTC")
# if nothing has changed, skip the actual Manifest
# verification
diff --git a/lib/portage/sync/modules/svn/svn.py b/lib/portage/sync/modules/svn/svn.py
index 0be9b5e8f..ec4bdb006 100644
--- a/lib/portage/sync/modules/svn/svn.py
+++ b/lib/portage/sync/modules/svn/svn.py
@@ -36,7 +36,7 @@ class SVNSync(NewBase):
portage._shell_quote(self.repo.location),
portage._shell_quote(svn_root),
),
- **self.spawn_kwargs
+ **self.spawn_kwargs,
)
if exitcode != os.EX_OK:
msg = "!!! svn checkout error; exiting."
@@ -60,7 +60,7 @@ class SVNSync(NewBase):
# svn update
exitcode = portage.process.spawn_bash(
f"cd {portage._shell_quote(self.repo.location)}; exec svn update",
- **self.spawn_kwargs
+ **self.spawn_kwargs,
)
if exitcode != os.EX_OK:
msg = "!!! svn update error; exiting."
@@ -78,7 +78,7 @@ class SVNSync(NewBase):
"""
exitcode = portage.process.spawn_bash(
f"cd {portage._shell_quote(self.repo.location)}; exec svn upgrade",
- **self.spawn_kwargs
+ **self.spawn_kwargs,
)
if exitcode != os.EX_OK:
msg = "!!! svn upgrade error; exiting."
diff --git a/lib/portage/sync/modules/webrsync/webrsync.py b/lib/portage/sync/modules/webrsync/webrsync.py
index c00378de4..183274b9c 100644
--- a/lib/portage/sync/modules/webrsync/webrsync.py
+++ b/lib/portage/sync/modules/webrsync/webrsync.py
@@ -96,9 +96,7 @@ class WebRsync(SyncBase):
out = portage.output.EOutput(quiet=quiet)
try:
- out.einfo(
- f"Using keys from {self.repo.sync_openpgp_key_path}"
- )
+ out.einfo(f"Using keys from {self.repo.sync_openpgp_key_path}")
with open(self.repo.sync_openpgp_key_path, "rb") as f:
openpgp_env.import_key(f)
self._refresh_keys(openpgp_env)
diff --git a/lib/portage/sync/syncbase.py b/lib/portage/sync/syncbase.py
index c8e261a49..44d94524a 100644
--- a/lib/portage/sync/syncbase.py
+++ b/lib/portage/sync/syncbase.py
@@ -190,9 +190,7 @@ class SyncBase:
self.repo.sync_openpgp_key_refresh_retry_overall_timeout
)
except Exception as e:
- errors.append(
- f"sync-openpgp-key-refresh-retry-overall-timeout: {e}"
- )
+ errors.append(f"sync-openpgp-key-refresh-retry-overall-timeout: {e}")
else:
if retry_overall_timeout < 0:
errors.append(
diff --git a/lib/portage/tests/bin/test_eapi7_ver_funcs.py b/lib/portage/tests/bin/test_eapi7_ver_funcs.py
index 6754344b7..0483a35b3 100644
--- a/lib/portage/tests/bin/test_eapi7_ver_funcs.py
+++ b/lib/portage/tests/bin/test_eapi7_ver_funcs.py
@@ -14,9 +14,7 @@ class TestEAPI7VerFuncs(TestCase):
Test that commands in test_cases produce expected output.
"""
with tempfile.NamedTemporaryFile("w") as test_script:
- test_script.write(
- f'source "{PORTAGE_BIN_PATH}"/eapi7-ver-funcs.sh\n'
- )
+ test_script.write(f'source "{PORTAGE_BIN_PATH}"/eapi7-ver-funcs.sh\n')
for cmd, exp in test_cases:
test_script.write(f"{cmd}\n")
test_script.flush()
@@ -31,18 +29,14 @@ class TestEAPI7VerFuncs(TestCase):
for test_case, result in zip(test_cases, sout.decode().splitlines()):
cmd, exp = test_case
- self.assertEqual(
- result, exp, f"{cmd} -> {result}; expected: {exp}"
- )
+ self.assertEqual(result, exp, f"{cmd} -> {result}; expected: {exp}")
def _test_return(self, test_cases):
"""
Test that commands in test_cases give appropriate exit codes.
"""
with tempfile.NamedTemporaryFile("w+") as test_script:
- test_script.write(
- f'source "{PORTAGE_BIN_PATH}"/eapi7-ver-funcs.sh\n'
- )
+ test_script.write(f'source "{PORTAGE_BIN_PATH}"/eapi7-ver-funcs.sh\n')
for cmd, exp in test_cases:
test_script.write(f"{cmd}; echo $?\n")
test_script.flush()
@@ -57,9 +51,7 @@ class TestEAPI7VerFuncs(TestCase):
for test_case, result in zip(test_cases, sout.decode().splitlines()):
cmd, exp = test_case
- self.assertEqual(
- result, exp, f"{cmd} -> {result}; expected: {exp}"
- )
+ self.assertEqual(result, exp, f"{cmd} -> {result}; expected: {exp}")
def _test_fail(self, test_cases):
"""
diff --git a/lib/portage/tests/dep/testAtom.py b/lib/portage/tests/dep/testAtom.py
index 447a72915..073680e9b 100644
--- a/lib/portage/tests/dep/testAtom.py
+++ b/lib/portage/tests/dep/testAtom.py
@@ -220,16 +220,12 @@ class TestAtom(TestCase):
a.operator,
msg=f"Atom('{atom}').operator = {a.operator} == '{op}'",
)
- self.assertEqual(
- cp, a.cp, msg=f"Atom('{atom}').cp = {a.cp} == '{cp}'"
- )
+ self.assertEqual(cp, a.cp, msg=f"Atom('{atom}').cp = {a.cp} == '{cp}'")
if ver is not None:
cpv = f"{cp}-{ver}"
else:
cpv = cp
- self.assertEqual(
- cpv, a.cpv, msg=f"Atom('{atom}').cpv = {a.cpv} == '{cpv}'"
- )
+ self.assertEqual(cpv, a.cpv, msg=f"Atom('{atom}').cpv = {a.cpv} == '{cpv}'")
self.assertEqual(
slot,
a.slot,
diff --git a/lib/portage/tests/ebuild/test_fetch.py b/lib/portage/tests/ebuild/test_fetch.py
index 47bc2a445..045aab786 100644
--- a/lib/portage/tests/ebuild/test_fetch.py
+++ b/lib/portage/tests/ebuild/test_fetch.py
@@ -201,9 +201,7 @@ class EbuildFetchTestCase(TestCase):
# Demonstrate that fetch preserves a stale file in DISTDIR when no digests are given.
foo_uri = {
- "foo": (
- f"{scheme}://{host}:{server.server_port}/distfiles/foo",
- )
+ "foo": (f"{scheme}://{host}:{server.server_port}/distfiles/foo",)
}
foo_path = os.path.join(settings["DISTDIR"], "foo")
foo_stale_content = b"stale content\n"
diff --git a/lib/portage/tests/process/test_unshare_net.py b/lib/portage/tests/process/test_unshare_net.py
index 1f96bb8b0..98bac69e0 100644
--- a/lib/portage/tests/process/test_unshare_net.py
+++ b/lib/portage/tests/process/test_unshare_net.py
@@ -30,9 +30,7 @@ class UnshareNetTestCase(TestCase):
errno_value = portage.process._unshare_validate(CLONE_NEWNET)
if errno_value != 0:
- self.skipTest(
- f"Unable to unshare: {errno.errorcode.get(errno_value, '?')}"
- )
+ self.skipTest(f"Unable to unshare: {errno.errorcode.get(errno_value, '?')}")
env = os.environ.copy()
env["IPV6"] = "1" if portage.process._has_ipv6() else ""
diff --git a/lib/portage/tests/resolver/ResolverPlayground.py b/lib/portage/tests/resolver/ResolverPlayground.py
index 5323bb01c..6d60a671e 100644
--- a/lib/portage/tests/resolver/ResolverPlayground.py
+++ b/lib/portage/tests/resolver/ResolverPlayground.py
@@ -310,9 +310,9 @@ class ResolverPlayground:
with open(ebuild_path, "w") as f:
if copyright_header is not None:
f.write(copyright_header)
- f.write(f'EAPI="{eapi}\"\n')
+ f.write(f'EAPI="{eapi}"\n')
for k, v in metadata.items():
- f.write(f'{k}="{v}\"\n')
+ f.write(f'{k}="{v}"\n')
if misc_content is not None:
f.write(misc_content)
@@ -439,7 +439,7 @@ class ResolverPlayground:
with open(ebuild_path, "w") as f:
f.write(f"EAPI=\"{metadata.pop('EAPI', '0')}\"\n")
for k, v in metadata.items():
- f.write(f'{k}="{v}\"\n')
+ f.write(f'{k}="{v}"\n')
env_path = os.path.join(vdb_pkg_dir, "environment.bz2")
with bz2.BZ2File(env_path, mode="w") as f:
@@ -518,9 +518,7 @@ class ResolverPlayground:
os.makedirs(eclass_dir)
for eclass_name, eclass_content in eclasses.items():
- with open(
- os.path.join(eclass_dir, f"{eclass_name}.eclass"), "w"
- ) as f:
+ with open(os.path.join(eclass_dir, f"{eclass_name}.eclass"), "w") as f:
if isinstance(eclass_content, str):
eclass_content = [eclass_content]
for line in eclass_content:
diff --git a/lib/portage/tests/sync/test_sync_local.py b/lib/portage/tests/sync/test_sync_local.py
index b83f88963..bb8c976b5 100644
--- a/lib/portage/tests/sync/test_sync_local.py
+++ b/lib/portage/tests/sync/test_sync_local.py
@@ -321,9 +321,7 @@ class SyncLocalTestCase(TestCase):
def hg_init_global_config():
with open(os.path.join(homedir, ".hgrc"), "w") as f:
- f.write(
- f"[ui]\nusername = {committer_name} <{committer_email}>\n"
- )
+ f.write(f"[ui]\nusername = {committer_name} <{committer_email}>\n")
hg_repo_create = (
(repo.location, hg_init_global_config),
diff --git a/lib/portage/tests/util/test_install_mask.py b/lib/portage/tests/util/test_install_mask.py
index 1bc4461d6..3927313a3 100644
--- a/lib/portage/tests/util/test_install_mask.py
+++ b/lib/portage/tests/util/test_install_mask.py
@@ -190,8 +190,6 @@ class InstallMaskTestCase(TestCase):
self.assertFalse(
os.path.lexists(link_name), f"failed to remove {link_name}"
)
- self.assertFalse(
- os.path.lexists(base_dir), f"failed to remove {base_dir}"
- )
+ self.assertFalse(os.path.lexists(base_dir), f"failed to remove {base_dir}")
finally:
shutil.rmtree(tmp_dir)
diff --git a/lib/portage/update.py b/lib/portage/update.py
index fe9f5a753..773166688 100644
--- a/lib/portage/update.py
+++ b/lib/portage/update.py
@@ -429,9 +429,7 @@ def update_config_files(
)
contents.insert(
pos + 1,
- line.replace(
- f"{atom}", f"{new_atom}", 1
- ),
+ line.replace(f"{atom}", f"{new_atom}", 1),
)
# we've inserted an additional line, so we need to
# skip it when it's reached in the next iteration
diff --git a/lib/portage/util/__init__.py b/lib/portage/util/__init__.py
index 4c3c3e44f..285bf6659 100644
--- a/lib/portage/util/__init__.py
+++ b/lib/portage/util/__init__.py
@@ -1460,7 +1460,7 @@ class atomic_ofstream(AbstractContextManager, ObjectProxy):
tmp_name, encoding=_encodings["fs"], errors="strict"
),
mode=mode,
- **kargs
+ **kargs,
),
)
return
@@ -1479,7 +1479,7 @@ class atomic_ofstream(AbstractContextManager, ObjectProxy):
open_func(
_unicode_encode(tmp_name, encoding=_encodings["fs"], errors="strict"),
mode=mode,
- **kargs
+ **kargs,
),
)
diff --git a/lib/portage/util/_dyn_libs/LinkageMapELF.py b/lib/portage/util/_dyn_libs/LinkageMapELF.py
index 197ebacea..12300281f 100644
--- a/lib/portage/util/_dyn_libs/LinkageMapELF.py
+++ b/lib/portage/util/_dyn_libs/LinkageMapELF.py
@@ -308,9 +308,7 @@ class LinkageMapELF:
try:
entry = NeededEntry.parse("scanelf", l)
except InvalidData as e:
- writemsg_level(
- f"\n{e}\n\n", level=logging.ERROR, noiselevel=-1
- )
+ writemsg_level(f"\n{e}\n\n", level=logging.ERROR, noiselevel=-1)
continue
try:
with open(
diff --git a/lib/portage/util/_dyn_libs/display_preserved_libs.py b/lib/portage/util/_dyn_libs/display_preserved_libs.py
index 0deda0f16..37772df4f 100644
--- a/lib/portage/util/_dyn_libs/display_preserved_libs.py
+++ b/lib/portage/util/_dyn_libs/display_preserved_libs.py
@@ -92,10 +92,7 @@ def display_preserved_libs(vardb, verbose=False):
owners_desc = "preserved"
else:
owners_desc = ", ".join(x.mycpv for x in owners.get(c, []))
- print(
- colorize("WARN", " * ")
- + f" used by {c} ({owners_desc})"
- )
+ print(colorize("WARN", " * ") + f" used by {c} ({owners_desc})")
if not verbose and len(consumers) > max_display:
print(
colorize("WARN", " * ")
diff --git a/lib/portage/util/digraph.py b/lib/portage/util/digraph.py
index 3e736792c..18a42158d 100644
--- a/lib/portage/util/digraph.py
+++ b/lib/portage/util/digraph.py
@@ -318,9 +318,7 @@ class digraph:
else:
output("(no children)\n")
for child, priorities in self.nodes[node][0].items():
- output(
- f" {child} ({priorities[-1]})\n"
- )
+ output(f" {child} ({priorities[-1]})\n")
def bfs(self, start, ignore_priority=None):
if start not in self:
diff --git a/lib/portage/util/futures/executor/fork.py b/lib/portage/util/futures/executor/fork.py
index 231931b2c..61ad6aecf 100644
--- a/lib/portage/util/futures/executor/fork.py
+++ b/lib/portage/util/futures/executor/fork.py
@@ -120,7 +120,7 @@ class _ExceptionWithTraceback:
tb = traceback.format_exception(type(exc), exc, exc.__traceback__)
tb = "".join(tb)
self.exc = exc
- self.tb = f'\n""\"\n{tb}"""'
+ self.tb = f'\n"""\n{tb}"""'
def __reduce__(self):
return _rebuild_exc, (self.exc, self.tb)
diff --git a/lib/portage/util/movefile.py b/lib/portage/util/movefile.py
index e9971c3fa..3eb0568e8 100644
--- a/lib/portage/util/movefile.py
+++ b/lib/portage/util/movefile.py
@@ -232,9 +232,7 @@ def movefile(
except SystemExit as e:
raise
except Exception as e:
- writemsg(
- f"!!! {_('failed to properly create symlink:')}\n", noiselevel=-1
- )
+ writemsg(f"!!! {_('failed to properly create symlink:')}\n", noiselevel=-1)
writemsg(f"!!! {dest} -> {target}\n", noiselevel=-1)
writemsg(f"!!! {e}\n", noiselevel=-1)
return None
@@ -246,9 +244,7 @@ def movefile(
# and them use os.rename() to replace the destination.
if hardlink_candidates:
head, tail = os.path.split(dest)
- hardlink_tmp = os.path.join(
- head, f".{tail}._portage_merge_.{portage.getpid()}"
- )
+ hardlink_tmp = os.path.join(head, f".{tail}._portage_merge_.{portage.getpid()}")
try:
os.unlink(hardlink_tmp)
except OSError as e:
diff --git a/lib/portage/versions.py b/lib/portage/versions.py
index 98f6489f8..787dc3442 100644
--- a/lib/portage/versions.py
+++ b/lib/portage/versions.py
@@ -520,8 +520,7 @@ def cpv_getkey(mycpv, eapi=None):
return mysplit[0] + "/" + mysplit[1]
warnings.warn(
- "portage.versions.cpv_getkey() "
- + f"called with invalid cpv: '{mycpv}'",
+ "portage.versions.cpv_getkey() " + f"called with invalid cpv: '{mycpv}'",
DeprecationWarning,
stacklevel=2,
)
diff --git a/runtests b/runtests
index 2fa948ae2..2b44079b8 100755
--- a/runtests
+++ b/runtests
@@ -137,9 +137,7 @@ def main(argv):
prog = get_python_executable(ver)
cmd = [prog, "-b", "-Wd", "lib/portage/tests/runTests.py"] + args
if os.access(prog, os.X_OK):
- print(
- f"{colors.GOOD}Testing with Python {ver}...{colors.NORMAL}"
- )
+ print(f"{colors.GOOD}Testing with Python {ver}...{colors.NORMAL}")
statuses.append((ver, subprocess.call(cmd)))
elif not ignore_missing:
print(
diff --git a/setup.py b/setup.py
index 1444d77b4..935a98571 100755
--- a/setup.py
+++ b/setup.py
@@ -563,7 +563,7 @@ class x_install_lib(install_lib):
),
(
r"^(EPREFIX\s*=\s*)(.*)",
- lambda m: f"{m.group(1)}__import__(\"sys\").prefix",
+ lambda m: f'{m.group(1)}__import__("sys").prefix',
),
),
)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-01-10 15:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-10 15:12 [gentoo-commits] proj/portage:master commit in: lib/portage/tests/util/, lib/portage/util/, lib/portage/tests/bin/, Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox