commit: 2a05c9d6575e298160605b56ca6e1555fbee3f07
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 19 13:48:40 2025 +0000
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Dec 19 13:48:40 2025 +0000
URL:
https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=2a05c9d6
random changes
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
src/pkgcore/binpkg/repo_ops.py | 2 +-
src/pkgcore/pytest/plugin.py | 10 +++++-----
src/pkgcore/repository/configured.py | 8 +-------
src/pkgcore/repository/filtered.py | 8 +-------
src/pkgcore/repository/multiplex.py | 2 +-
src/pkgcore/repository/virtual.py | 2 +-
src/pkgcore/system/libtool.py | 4 ++--
7 files changed, 12 insertions(+), 24 deletions(-)
diff --git a/src/pkgcore/binpkg/repo_ops.py b/src/pkgcore/binpkg/repo_ops.py
index 4c1a547a..3b02bb56 100644
--- a/src/pkgcore/binpkg/repo_ops.py
+++ b/src/pkgcore/binpkg/repo_ops.py
@@ -75,7 +75,7 @@ class install(repo_interfaces.install):
final_path = discern_loc(self.repo.base, pkg, self.repo.extension)
tmp_path = pjoin(
os.path.dirname(final_path),
- ".tmp.%i.%s" % (os.getpid(), os.path.basename(final_path)),
+ f".tmp.{os.getpid()}.{os.path.basename(final_path)}",
)
self.tmp_path, self.final_path = tmp_path, final_path
diff --git a/src/pkgcore/pytest/plugin.py b/src/pkgcore/pytest/plugin.py
index 244e0d59..47942167 100644
--- a/src/pkgcore/pytest/plugin.py
+++ b/src/pkgcore/pytest/plugin.py
@@ -54,7 +54,7 @@ class GitRepo:
**kwargs,
)
- def log(self, args):
+ def log(self, args: list[str]):
"""Run ``git log`` with given args and return a list of outputted
lines."""
p = self.run(["git", "log"] + args, stdout=subprocess.PIPE)
return p.stdout.strip().splitlines()
@@ -75,7 +75,7 @@ class GitRepo:
def __str__(self):
return self.path
- def commit(self, msg, signoff=False):
+ def commit(self, msg: str | list[str], signoff=False):
"""Make a commit to the repo."""
if isinstance(msg, str):
msg = msg.splitlines()
@@ -237,10 +237,10 @@ class EbuildRepo:
with open(pjoin(self.path, "profiles", p.path, "eapi"), "w")
as f:
f.write(f"{p.eapi}\n")
- def create_ebuild(self, cpvstr, data=None, **kwargs):
- from pkgcore.ebuild import cpv as cpv_mod
+ def create_ebuild(self, cpvstr: str, data=None, **kwargs):
+ from pkgcore.ebuild.cpv import VersionedCPV
- cpv = cpv_mod.VersionedCPV(cpvstr)
+ cpv = VersionedCPV(cpvstr)
self._repo.notify_add_package(cpv)
ebuild_dir = pjoin(self.path, cpv.category, cpv.package)
os.makedirs(ebuild_dir, exist_ok=True)
diff --git a/src/pkgcore/repository/configured.py
b/src/pkgcore/repository/configured.py
index 81f62286..7cad55f5 100644
--- a/src/pkgcore/repository/configured.py
+++ b/src/pkgcore/repository/configured.py
@@ -77,10 +77,4 @@ class tree(prototype.tree):
return obj
def __repr__(self):
- return "<%s.%s raw_repo=%r wrapped=%r @%#8x>" % (
- self.__class__.__module__,
- self.__class__.__name__,
- getattr(self, "raw_repo", "unset"),
- list(getattr(self, "wrapped_attrs", {}).keys()),
- id(self),
- )
+ return f"<{self.__class__.__module__}.{self.__class__.__name__}
raw_repo={getattr(self, 'raw_repo', 'unset')!r} wrapped={list(getattr(self,
'wrapped_attrs', {}).keys())!r} @{id(self):#8x}>"
diff --git a/src/pkgcore/repository/filtered.py
b/src/pkgcore/repository/filtered.py
index 81f5b7e7..4ecbce95 100644
--- a/src/pkgcore/repository/filtered.py
+++ b/src/pkgcore/repository/filtered.py
@@ -84,10 +84,4 @@ class tree(prototype.tree):
return v
def __repr__(self):
- return "<%s raw_repo=%r restrict=%r sentinel=%r @%#8x>" % (
- self.__class__.__name__,
- getattr(self, "raw_repo", "unset"),
- getattr(self, "restrict", "unset"),
- getattr(self, "sentinel_val", "unset"),
- id(self),
- )
+ return f"<{self.__class__.__name__} raw_repo={getattr(self,
'raw_repo', 'unset')!r} restrict={getattr(self, 'restrict', 'unset')!r}
sentinel={getattr(self, 'sentinel_val', 'unset')!r} @{id(self):#8x}>"
diff --git a/src/pkgcore/repository/multiplex.py
b/src/pkgcore/repository/multiplex.py
index d7b218cc..58e06f0a 100644
--- a/src/pkgcore/repository/multiplex.py
+++ b/src/pkgcore/repository/multiplex.py
@@ -20,7 +20,7 @@ from . import errors, prototype
class operations(repo_interface.operations_proxy):
- ops_stop_after_first_supported = frozenset(["install", "uninstall",
"replace"])
+ ops_stop_after_first_supported = frozenset({"install", "uninstall",
"replace"})
@klass.cached_property
def raw_operations(self):
diff --git a/src/pkgcore/repository/virtual.py
b/src/pkgcore/repository/virtual.py
index a77ef4a7..b3a85f1d 100644
--- a/src/pkgcore/repository/virtual.py
+++ b/src/pkgcore/repository/virtual.py
@@ -120,7 +120,7 @@ class InjectedPkg(pkg_base.wrapper):
return f"injected restriction pkg: {self._raw_pkg}"
def __repr__(self):
- return "<%s cpv=%r @%#8x>" % (self.__class__, self.cpvstr, id(self))
+ return f"<{self.__class__} cpv={self.cpvstr!r} @{id(self):#8x}>"
def __hash__(self):
return hash(self._raw_pkg)
diff --git a/src/pkgcore/system/libtool.py b/src/pkgcore/system/libtool.py
index 08e20bde..24807941 100644
--- a/src/pkgcore/system/libtool.py
+++ b/src/pkgcore/system/libtool.py
@@ -19,7 +19,7 @@ pkgconfig2_sub = post_curry(
partial(re.compile(r"usr/+lib[^/]*/+pkgconfig/+\.\.").sub, "usr"), 1
)
flags_match = re.compile(
- r"-(?:mt|mthreads|kthread|Kthread|pthread"
r"|pthreads|-thread-safe|threads)"
+ r"-(?:mt|mthreads|kthread|Kthread|pthread|pthreads|-thread-safe|threads)"
).match
template = """# %(file)s - a libtool library file
@@ -35,7 +35,7 @@ class UnknownData(PkgcoreException):
def __str__(self):
s = f"we don't know how to parse line {self.line!r}"
if self.token:
- s += f"specifically token {self.token!r}"
+ s += f" specifically token {self.token!r}"
return s