commit: e2cedd66fc38163e6dc5a773fc6305692da942b1
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 3 14:56:56 2026 +0000
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat Jan 3 14:56:56 2026 +0000
URL:
https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=e2cedd66
sort imports (using ruff)
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
Makefile | 1 +
doc/conf.py | 3 ++-
examples/destable_arch_bugs.py | 1 -
examples/set_maintainers.py | 3 +--
pyproject.toml | 3 +++
src/pkgcore/config/__init__.py | 2 +-
src/pkgcore/ebuild/const.py | 1 -
src/pkgcore/ebuild/domain.py | 2 +-
src/pkgcore/ebuild/ebd.py | 3 ++-
src/pkgcore/ebuild/eclass.py | 2 +-
src/pkgcore/ebuild/eclass_cache.py | 3 ++-
src/pkgcore/ebuild/misc.py | 2 +-
src/pkgcore/ebuild/portageq.py | 3 ++-
src/pkgcore/ebuild/profiles.py | 6 +++---
src/pkgcore/ebuild/triggers.py | 3 ++-
src/pkgcore/fs/_tar.py | 1 -
src/pkgcore/fs/contents.py | 5 +++--
src/pkgcore/fs/fs.py | 3 ++-
src/pkgcore/fs/livefs.py | 3 ++-
src/pkgcore/merge/triggers.py | 3 ++-
src/pkgcore/pytest/plugin.py | 7 +++----
src/pkgcore/repository/filtered.py | 5 ++---
src/pkgcore/restrictions/required_use.py | 3 ++-
src/pkgcore/scripts/__init__.py | 2 +-
src/pkgcore/scripts/pconfig.py | 3 +--
src/pkgcore/util/commandline.py | 3 ++-
src/pkgcore/util/rst2devbook.py | 3 +--
src/pkgcore/vdb/repo_ops.py | 3 ++-
tests/cache/test_base.py | 2 +-
tests/cache/test_flat_hash.py | 2 +-
tests/ebuild/test_conditionals.py | 4 ++--
tests/ebuild/test_digest.py | 3 ++-
tests/ebuild/test_eclass_cache.py | 4 ++--
tests/ebuild/test_filter_env.py | 1 +
tests/ebuild/test_formatter.py | 3 ++-
tests/ebuild/test_misc.py | 1 +
tests/ebuild/test_profiles.py | 1 +
tests/ebuild/test_repo_objs.py | 5 +++--
tests/ebuild/test_repository.py | 3 +--
tests/fetch/test_base.py | 3 ++-
tests/fetch/test_init.py | 2 +-
tests/fs/fs_util.py | 4 ++--
tests/fs/test_contents.py | 1 +
tests/fs/test_fs.py | 7 ++++---
tests/fs/test_ops.py | 2 +-
tests/merge/test_triggers.py | 9 +++++----
tests/package/test_base.py | 1 +
tests/package/test_mutated.py | 1 +
tests/pkgsets/test_filelist.py | 1 +
tests/repository/test_filtered.py | 2 +-
tests/repository/test_prototype.py | 3 ++-
tests/resolver/test_choice_point.py | 1 +
tests/resolver/test_pigeonholes.py | 1 +
tests/resolver/test_plan.py | 1 +
tests/restrictions/test_delegated.py | 1 +
tests/restrictions/test_packages.py | 3 ++-
tests/scripts/test_pmerge.py | 1 +
tests/sync/test_base.py | 3 ++-
tests/sync/test_bzr.py | 3 ++-
tests/sync/test_cvs.py | 3 ++-
tests/sync/test_darcs.py | 3 ++-
tests/sync/test_git.py | 3 ++-
tests/sync/test_git_svn.py | 3 ++-
tests/sync/test_hg.py | 3 ++-
tests/sync/test_rsync.py | 3 ++-
tests/sync/test_sqfs.py | 1 +
tests/sync/test_svn.py | 3 ++-
tests/sync/test_tar.py | 1 +
tests/util/test_parserestrict.py | 1 +
69 files changed, 112 insertions(+), 73 deletions(-)
diff --git a/Makefile b/Makefile
index b3b6ae05..0dafadce 100644
--- a/Makefile
+++ b/Makefile
@@ -25,6 +25,7 @@ clean:
.PHONY: format
format:
+ $(PYTHON) -m ruff check --select I --fix . && \
$(PYTHON) -m ruff format
.PHONY: dev-environment
diff --git a/doc/conf.py b/doc/conf.py
index eb496323..29a06b93 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -11,7 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
-import sys, os
+import os
+import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../src"))
diff --git a/examples/destable_arch_bugs.py b/examples/destable_arch_bugs.py
index de17eb1f..00ca0290 100755
--- a/examples/destable_arch_bugs.py
+++ b/examples/destable_arch_bugs.py
@@ -10,7 +10,6 @@ from urllib.parse import urlencode
from pkgcore.util import commandline
-
argparser = commandline.ArgumentParser(version=False, description=__doc__)
argparser.add_argument(
"--api-key",
diff --git a/examples/set_maintainers.py b/examples/set_maintainers.py
index 8bfa38af..ce531704 100755
--- a/examples/set_maintainers.py
+++ b/examples/set_maintainers.py
@@ -5,10 +5,9 @@ import sys
import urllib.request as urllib
from urllib.parse import urlencode
-from pkgcore.util import commandline
from pkgcore.ebuild.atom import atom
from pkgcore.ebuild.errors import MalformedAtom
-
+from pkgcore.util import commandline
argparser = commandline.ArgumentParser(color=False, version=False)
argparser.add_argument(
diff --git a/pyproject.toml b/pyproject.toml
index 32c09b02..4cae5d7c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -89,3 +89,6 @@ testpaths = ["tests"]
markers = [
"net: tests that require network access (must enable --network option
to run)",
]
+
+[tool.ruff.lint]
+extend-select = ["I"]
diff --git a/src/pkgcore/config/__init__.py b/src/pkgcore/config/__init__.py
index 0fa88182..e0fed72c 100644
--- a/src/pkgcore/config/__init__.py
+++ b/src/pkgcore/config/__init__.py
@@ -46,7 +46,7 @@ def load_config(
# otherwise load the portage config
else:
# delay importing to avoid circular imports
- from pkgcore.ebuild.portage_conf import PortageConfig
+ from ..ebuild.portage_conf import PortageConfig
configs.append(
PortageConfig(
diff --git a/src/pkgcore/ebuild/const.py b/src/pkgcore/ebuild/const.py
index 95a4e5d6..b9b0e073 100644
--- a/src/pkgcore/ebuild/const.py
+++ b/src/pkgcore/ebuild/const.py
@@ -6,7 +6,6 @@ from os.path import join as pjoin
from ..const import EBD_PATH
-
incrementals_unfinalized = ("USE",)
metadata_keys = (
diff --git a/src/pkgcore/ebuild/domain.py b/src/pkgcore/ebuild/domain.py
index 4e7a2fe8..426ac0ec 100644
--- a/src/pkgcore/ebuild/domain.py
+++ b/src/pkgcore/ebuild/domain.py
@@ -42,7 +42,6 @@ from ..restrictions import packages, values
from ..restrictions.delegated import delegate
from ..util.parserestrict import ParseError, parse_match
from . import const
-from .profiles import INCREMENTALS
from . import repository as ebuild_repo
from .atom import atom as _atom
from .eapi import get_latest_PMS_eapi
@@ -56,6 +55,7 @@ from .misc import (
optimize_incrementals,
)
from .portage_conf import PortageConfig
+from .profiles import INCREMENTALS
from .repo_objs import Licenses, RepoConfig
from .triggers import GenerateTriggers
diff --git a/src/pkgcore/ebuild/ebd.py b/src/pkgcore/ebuild/ebd.py
index bec59b9a..6fb4fc83 100644
--- a/src/pkgcore/ebuild/ebd.py
+++ b/src/pkgcore/ebuild/ebd.py
@@ -25,7 +25,8 @@ from collections import defaultdict
from contextlib import chdir
from functools import partial
from itertools import chain
-from os.path import join as pjoin, normpath
+from os.path import join as pjoin
+from os.path import normpath
from tempfile import TemporaryFile
from snakeoil import data_source, klass
diff --git a/src/pkgcore/ebuild/eclass.py b/src/pkgcore/ebuild/eclass.py
index f03a70d2..7ac8ce5f 100644
--- a/src/pkgcore/ebuild/eclass.py
+++ b/src/pkgcore/ebuild/eclass.py
@@ -738,6 +738,6 @@ class EclassDoc(AttrDict):
def to_devbook(self):
"""Convert eclassdoc object to an HTML 5 document."""
- from pkgcore.util.rst2devbook import DevBookWriter
+ from ..util.rst2devbook import DevBookWriter
return self._to_docutils(DevBookWriter(self.name))
diff --git a/src/pkgcore/ebuild/eclass_cache.py
b/src/pkgcore/ebuild/eclass_cache.py
index f682bde7..39eb7fd3 100644
--- a/src/pkgcore/ebuild/eclass_cache.py
+++ b/src/pkgcore/ebuild/eclass_cache.py
@@ -5,7 +5,8 @@ in memory representation of on disk eclass stacking order
__all__ = ("base", "cache", "StackedCaches")
import os
-from os.path import join as pjoin, normpath
+from os.path import join as pjoin
+from os.path import normpath
from sys import intern
from weakref import WeakValueDictionary
diff --git a/src/pkgcore/ebuild/misc.py b/src/pkgcore/ebuild/misc.py
index e5df8be6..84a8a547 100644
--- a/src/pkgcore/ebuild/misc.py
+++ b/src/pkgcore/ebuild/misc.py
@@ -23,7 +23,7 @@ from functools import partial
from itertools import chain
from snakeoil import mappings
-from snakeoil.klass import alias_method, GenericEquality
+from snakeoil.klass import GenericEquality, alias_method
from snakeoil.sequences import iflatten_instance
from ..restrictions import boolean, packages, restriction
diff --git a/src/pkgcore/ebuild/portageq.py b/src/pkgcore/ebuild/portageq.py
index 653789fb..1016af8a 100644
--- a/src/pkgcore/ebuild/portageq.py
+++ b/src/pkgcore/ebuild/portageq.py
@@ -1,6 +1,7 @@
import os
from functools import partial
-from os.path import join as pjoin, normpath
+from os.path import join as pjoin
+from os.path import normpath
from snakeoil.cli import arghparse
diff --git a/src/pkgcore/ebuild/profiles.py b/src/pkgcore/ebuild/profiles.py
index f7ce6f10..26196ff7 100644
--- a/src/pkgcore/ebuild/profiles.py
+++ b/src/pkgcore/ebuild/profiles.py
@@ -10,7 +10,8 @@ import os
from collections import defaultdict, namedtuple
from functools import partial
from itertools import chain
-from os.path import abspath, join as pjoin
+from os.path import abspath
+from os.path import join as pjoin
from snakeoil import caching, klass
from snakeoil.bash import read_bash, read_bash_dict
@@ -23,9 +24,8 @@ from ..config import errors
from ..config.hint import ConfigHint
from ..fs.livefs import sorted_scan
from ..log import logger
-from . import const, cpv
+from . import const, cpv, misc, repo_objs
from . import errors as ebuild_errors
-from . import misc, repo_objs
from .atom import atom
from .eapi import EAPI, get_eapi
diff --git a/src/pkgcore/ebuild/triggers.py b/src/pkgcore/ebuild/triggers.py
index 0e9c10f9..5a56ef66 100644
--- a/src/pkgcore/ebuild/triggers.py
+++ b/src/pkgcore/ebuild/triggers.py
@@ -18,7 +18,8 @@ __all__ = (
import fnmatch
import os
-from os.path import join as pjoin, normpath
+from os.path import join as pjoin
+from os.path import normpath
from snakeoil.bash import read_bash_dict
from snakeoil.fileutils import AtomicWriteFile
diff --git a/src/pkgcore/fs/_tar.py b/src/pkgcore/fs/_tar.py
index 92c53bd8..8a5ce032 100644
--- a/src/pkgcore/fs/_tar.py
+++ b/src/pkgcore/fs/_tar.py
@@ -7,7 +7,6 @@ This is will be removed once pkgcore and snakeoil data_source
usage is removed.
from snakeoil.python_namespaces import protect_imports
-
# force a fresh module import of tarfile that is ours to monkey patch.
with protect_imports() as (_paths, modules):
modules.pop("tarfile", None)
diff --git a/src/pkgcore/fs/contents.py b/src/pkgcore/fs/contents.py
index 5c139671..47879564 100644
--- a/src/pkgcore/fs/contents.py
+++ b/src/pkgcore/fs/contents.py
@@ -7,9 +7,10 @@ import time
from collections import OrderedDict, defaultdict
from functools import partial
from operator import attrgetter
-from os.path import join as pjoin, normpath
+from os.path import join as pjoin
+from os.path import normpath
-from snakeoil.klass import alias_method, GenericEquality
+from snakeoil.klass import GenericEquality, alias_method
from . import fs
diff --git a/src/pkgcore/fs/fs.py b/src/pkgcore/fs/fs.py
index 1abec12d..3faa3ec1 100644
--- a/src/pkgcore/fs/fs.py
+++ b/src/pkgcore/fs/fs.py
@@ -5,7 +5,8 @@ filesystem entry abstractions
import fnmatch
import stat
from functools import total_ordering
-from os.path import abspath, basename, dirname, join as pjoin, normpath,
realpath
+from os.path import abspath, basename, dirname, normpath, realpath
+from os.path import join as pjoin
from os.path import sep as path_seperator
from snakeoil import klass
diff --git a/src/pkgcore/fs/livefs.py b/src/pkgcore/fs/livefs.py
index 199fbdf7..a0930a4b 100644
--- a/src/pkgcore/fs/livefs.py
+++ b/src/pkgcore/fs/livefs.py
@@ -5,7 +5,8 @@ interaction with the livefs: generating fs objects to represent
the livefs.
import collections
import errno
import os
-from os.path import join as pjoin, normpath
+from os.path import join as pjoin
+from os.path import normpath
from stat import S_IMODE, S_ISDIR, S_ISFIFO, S_ISLNK, S_ISREG
from snakeoil.chksum import get_handlers
diff --git a/src/pkgcore/merge/triggers.py b/src/pkgcore/merge/triggers.py
index cd6351af..97f97311 100644
--- a/src/pkgcore/merge/triggers.py
+++ b/src/pkgcore/merge/triggers.py
@@ -27,7 +27,8 @@ import platform
import re
import time
from math import floor
-from os.path import join as pjoin, normpath
+from os.path import join as pjoin
+from os.path import normpath
from snakeoil import process
from snakeoil.bash import read_bash
diff --git a/src/pkgcore/pytest/plugin.py b/src/pkgcore/pytest/plugin.py
index 47942167..a0298129 100644
--- a/src/pkgcore/pytest/plugin.py
+++ b/src/pkgcore/pytest/plugin.py
@@ -5,11 +5,10 @@ from collections.abc import MutableSet
from datetime import datetime
from os.path import join as pjoin
+import pytest
from snakeoil import klass
from snakeoil.fileutils import touch
-import pytest
-
class GitRepo:
"""Class for creating/manipulating git repos.
@@ -213,7 +212,7 @@ class EbuildRepo:
def sync(self):
"""Forcibly create underlying repo object avoiding cache usage."""
# avoid issues loading modules that set signal handlers
- from pkgcore.ebuild import repo_objs, repository
+ from ..ebuild import repo_objs, repository
repo_config = repo_objs.RepoConfig(
location=self.path, disable_inst_caching=True
@@ -238,7 +237,7 @@ class EbuildRepo:
f.write(f"{p.eapi}\n")
def create_ebuild(self, cpvstr: str, data=None, **kwargs):
- from pkgcore.ebuild.cpv import VersionedCPV
+ from ..ebuild.cpv import VersionedCPV
cpv = VersionedCPV(cpvstr)
self._repo.notify_add_package(cpv)
diff --git a/src/pkgcore/repository/filtered.py
b/src/pkgcore/repository/filtered.py
index 4ecbce95..898eb657 100644
--- a/src/pkgcore/repository/filtered.py
+++ b/src/pkgcore/repository/filtered.py
@@ -4,16 +4,15 @@ filtering repository
__all__ = ("tree",)
-from itertools import filterfalse
import typing
+from itertools import filterfalse
from snakeoil.klass import DirProxy, GetAttrProxy, alias_method
+from ..ebuild.atom import atom
from ..operations.repo import operations_proxy
from ..restrictions import restriction
from . import errors, prototype
-from pkgcore.ebuild.restricts import CategoryDep
-from pkgcore.ebuild.atom import atom
class tree(prototype.tree):
diff --git a/src/pkgcore/restrictions/required_use.py
b/src/pkgcore/restrictions/required_use.py
index a2dee31c..122c65c4 100644
--- a/src/pkgcore/restrictions/required_use.py
+++ b/src/pkgcore/restrictions/required_use.py
@@ -1,7 +1,8 @@
from typing import Iterator, Protocol
from snakeoil.constraints import Constraint, Problem
-from . import restriction, boolean, packages, values
+
+from . import boolean, packages, restriction, values
class _use_constraint(Protocol):
diff --git a/src/pkgcore/scripts/__init__.py b/src/pkgcore/scripts/__init__.py
index a80285b7..d89648b4 100755
--- a/src/pkgcore/scripts/__init__.py
+++ b/src/pkgcore/scripts/__init__.py
@@ -10,7 +10,7 @@ from importlib import import_module
def run(script_name):
"""Run a given script module."""
try:
- from pkgcore.util.commandline import Tool
+ from ..util.commandline import Tool
script_module = ".".join(
os.path.realpath(__file__).split(os.path.sep)[-3:-1]
diff --git a/src/pkgcore/scripts/pconfig.py b/src/pkgcore/scripts/pconfig.py
index 2703eeb0..4554df0f 100644
--- a/src/pkgcore/scripts/pconfig.py
+++ b/src/pkgcore/scripts/pconfig.py
@@ -9,9 +9,8 @@ from snakeoil.errors import dump_error
from snakeoil.klass import get_subclasses_of
from snakeoil.python_namespaces import import_submodules_of
-from pkgcore.config.hint import ConfigHint
-
from ..config import basics, errors
+from ..config.hint import ConfigHint
from ..ebuild import atom
from ..util import commandline
diff --git a/src/pkgcore/util/commandline.py b/src/pkgcore/util/commandline.py
index 9b468486..ab34fb5d 100644
--- a/src/pkgcore/util/commandline.py
+++ b/src/pkgcore/util/commandline.py
@@ -14,7 +14,8 @@ import os
import sys
from functools import partial
from importlib import import_module
-from os.path import abspath, join as pjoin, normpath
+from os.path import abspath, normpath
+from os.path import join as pjoin
from snakeoil import modules
from snakeoil.cli import arghparse, tool
diff --git a/src/pkgcore/util/rst2devbook.py b/src/pkgcore/util/rst2devbook.py
index f08041cc..d9b18d4d 100644
--- a/src/pkgcore/util/rst2devbook.py
+++ b/src/pkgcore/util/rst2devbook.py
@@ -3,9 +3,8 @@
.. [#] https://devmanual.gentoo.org/appendices/devbook-guide/index.html
"""
-from docutils import nodes, writers
-
import lxml.etree as etree
+from docutils import nodes, writers
class DevBookWriter(writers.Writer):
diff --git a/src/pkgcore/vdb/repo_ops.py b/src/pkgcore/vdb/repo_ops.py
index b000f477..8ec6bf8d 100644
--- a/src/pkgcore/vdb/repo_ops.py
+++ b/src/pkgcore/vdb/repo_ops.py
@@ -4,7 +4,8 @@ import os
import shutil
import time
from itertools import chain
-from os.path import join as pjoin, normpath
+from os.path import join as pjoin
+from os.path import normpath
from snakeoil import compression
from snakeoil.data_source import local_source
diff --git a/tests/cache/test_base.py b/tests/cache/test_base.py
index dc6b1fa0..e6bedc1d 100644
--- a/tests/cache/test_base.py
+++ b/tests/cache/test_base.py
@@ -1,7 +1,7 @@
import pytest
+from snakeoil.chksum import LazilyHashedPath
from pkgcore.cache import base, bulk, errors
-from snakeoil.chksum import LazilyHashedPath
def _mk_chf_obj(**kwargs):
diff --git a/tests/cache/test_flat_hash.py b/tests/cache/test_flat_hash.py
index b71b87fb..db072cf3 100644
--- a/tests/cache/test_flat_hash.py
+++ b/tests/cache/test_flat_hash.py
@@ -1,7 +1,7 @@
import pytest
+from snakeoil.chksum import LazilyHashedPath
from pkgcore.cache import errors, flat_hash
-from snakeoil.chksum import LazilyHashedPath
from . import test_base
diff --git a/tests/ebuild/test_conditionals.py
b/tests/ebuild/test_conditionals.py
index fe7eb331..79c1d181 100644
--- a/tests/ebuild/test_conditionals.py
+++ b/tests/ebuild/test_conditionals.py
@@ -1,11 +1,11 @@
import pytest
+from snakeoil.iterables import expandable_chain
+from snakeoil.sequences import iflatten_instance
from pkgcore.ebuild import conditionals
from pkgcore.ebuild.atom import atom
from pkgcore.ebuild.errors import DepsetParseError
from pkgcore.restrictions import boolean, packages
-from snakeoil.iterables import expandable_chain
-from snakeoil.sequences import iflatten_instance
class base:
diff --git a/tests/ebuild/test_digest.py b/tests/ebuild/test_digest.py
index 4bb9ae1e..86f2e364 100644
--- a/tests/ebuild/test_digest.py
+++ b/tests/ebuild/test_digest.py
@@ -1,9 +1,10 @@
import os
import tempfile
+from snakeoil.data_source import local_source
+
from pkgcore import gpg
from pkgcore.ebuild import digest
-from snakeoil.data_source import local_source
# "Line too long" (and our custom more aggressive version of that)
# pylint: disable-msg=C0301,CPC01
diff --git a/tests/ebuild/test_eclass_cache.py
b/tests/ebuild/test_eclass_cache.py
index 1b81b5f9..41f8e4b7 100644
--- a/tests/ebuild/test_eclass_cache.py
+++ b/tests/ebuild/test_eclass_cache.py
@@ -2,11 +2,11 @@ import os
from os.path import join as pjoin
import pytest
-
-from pkgcore.ebuild import eclass_cache
from snakeoil import data_source
from snakeoil.chksum import LazilyHashedPath
+from pkgcore.ebuild import eclass_cache
+
class FakeEclassCache(eclass_cache.base):
def __init__(self, path):
diff --git a/tests/ebuild/test_filter_env.py b/tests/ebuild/test_filter_env.py
index c79223e7..c34a6984 100644
--- a/tests/ebuild/test_filter_env.py
+++ b/tests/ebuild/test_filter_env.py
@@ -2,6 +2,7 @@ import io
import textwrap
import pytest
+
from pkgcore.ebuild.filter_env import main_run
diff --git a/tests/ebuild/test_formatter.py b/tests/ebuild/test_formatter.py
index c84de67a..cedb9eff 100644
--- a/tests/ebuild/test_formatter.py
+++ b/tests/ebuild/test_formatter.py
@@ -1,7 +1,8 @@
+from snakeoil.test.argparse_helpers import Bold, Color, FakeStreamFormatter,
Reset
+
from pkgcore.ebuild.atom import atom
from pkgcore.ebuild.formatter import BasicFormatter, PkgcoreFormatter,
PortageFormatter
from pkgcore.test.misc import FakePkg, FakeRepo
-from snakeoil.test.argparse_helpers import Bold, Color, FakeStreamFormatter,
Reset
# These two are probably unnecessary with ferringb's changes to
diff --git a/tests/ebuild/test_misc.py b/tests/ebuild/test_misc.py
index 056271cd..3c656a20 100644
--- a/tests/ebuild/test_misc.py
+++ b/tests/ebuild/test_misc.py
@@ -1,4 +1,5 @@
import pytest
+
from pkgcore.ebuild import misc
from pkgcore.restrictions import packages
diff --git a/tests/ebuild/test_profiles.py b/tests/ebuild/test_profiles.py
index 52db3c3a..c5686de8 100644
--- a/tests/ebuild/test_profiles.py
+++ b/tests/ebuild/test_profiles.py
@@ -6,6 +6,7 @@ from os.path import normpath
from unittest import mock
import pytest
+
from pkgcore.config import central
from pkgcore.ebuild import const, profiles, repo_objs
from pkgcore.ebuild.atom import atom
diff --git a/tests/ebuild/test_repo_objs.py b/tests/ebuild/test_repo_objs.py
index f86f8fe0..cd4335a7 100644
--- a/tests/ebuild/test_repo_objs.py
+++ b/tests/ebuild/test_repo_objs.py
@@ -3,12 +3,13 @@ import os
import re
import pytest
-from pkgcore.ebuild import atom, repo_objs
-from pkgcore.repository import errors as repo_errors
from snakeoil.data_source import data_source
from snakeoil.fileutils import touch
from snakeoil.mappings import ImmutableDict
+from pkgcore.ebuild import atom, repo_objs
+from pkgcore.repository import errors as repo_errors
+
class TestMetadataXml:
@staticmethod
diff --git a/tests/ebuild/test_repository.py b/tests/ebuild/test_repository.py
index c94cffbf..af66fd51 100644
--- a/tests/ebuild/test_repository.py
+++ b/tests/ebuild/test_repository.py
@@ -4,8 +4,7 @@ from pathlib import Path
import pytest
-from pkgcore.ebuild import eclass_cache
-from pkgcore.ebuild import repository, restricts
+from pkgcore.ebuild import eclass_cache, repository, restricts
from pkgcore.ebuild.atom import atom
from pkgcore.repository import errors
diff --git a/tests/fetch/test_base.py b/tests/fetch/test_base.py
index d5ec2436..f7de8298 100644
--- a/tests/fetch/test_base.py
+++ b/tests/fetch/test_base.py
@@ -2,10 +2,11 @@ import os
from functools import partial
import pytest
-from pkgcore.fetch import base, errors, fetchable
from snakeoil import data_source
from snakeoil.chksum import get_handlers
+from pkgcore.fetch import base, errors, fetchable
+
repeating_str = "asdf"
data = repeating_str * 4000
handlers = get_handlers()
diff --git a/tests/fetch/test_init.py b/tests/fetch/test_init.py
index 9c5d21e3..c9f4c7b3 100644
--- a/tests/fetch/test_init.py
+++ b/tests/fetch/test_init.py
@@ -1,7 +1,7 @@
import pytest
+from snakeoil.sequences import iflatten_instance
from pkgcore import fetch
-from snakeoil.sequences import iflatten_instance
def assert_uri(obj, uri):
diff --git a/tests/fs/fs_util.py b/tests/fs/fs_util.py
index c453a43f..c5872486 100644
--- a/tests/fs/fs_util.py
+++ b/tests/fs/fs_util.py
@@ -4,11 +4,11 @@ the default strictness tests that fsBase.* derivatives have
to ease
testing. Do not use it in non-test code.
"""
-from pkgcore.fs import fs
-
# we use pre_curry to preserve the docs for the wrapped target
from snakeoil.currying import pre_curry
+from pkgcore.fs import fs
+
# we're anal about del'ing here to prevent the vars from lingering around,
# showing up when folks are poking around
diff --git a/tests/fs/test_contents.py b/tests/fs/test_contents.py
index dbee4945..32734af4 100644
--- a/tests/fs/test_contents.py
+++ b/tests/fs/test_contents.py
@@ -2,6 +2,7 @@ import os
from functools import partial
import pytest
+
from pkgcore.fs import contents, fs
mk_file = partial(fs.fsFile, strict=False)
diff --git a/tests/fs/test_fs.py b/tests/fs/test_fs.py
index b4e44823..9549a09d 100644
--- a/tests/fs/test_fs.py
+++ b/tests/fs/test_fs.py
@@ -1,11 +1,12 @@
-from os.path import join as pjoin, normpath
+from os.path import join as pjoin
+from os.path import normpath
import pytest
-
-from pkgcore.fs import fs
from snakeoil.chksum import get_chksums
from snakeoil.data_source import data_source
+from pkgcore.fs import fs
+
class base:
kls = None
diff --git a/tests/fs/test_ops.py b/tests/fs/test_ops.py
index fd0f12cc..bc80527d 100644
--- a/tests/fs/test_ops.py
+++ b/tests/fs/test_ops.py
@@ -2,9 +2,9 @@ import os
from pathlib import Path
import pytest
+from snakeoil.data_source import local_source
from pkgcore.fs import contents, fs, livefs, ops
-from snakeoil.data_source import local_source
def verify(obj, kwds):
diff --git a/tests/merge/test_triggers.py b/tests/merge/test_triggers.py
index 9e5e0ded..c3c7b493 100644
--- a/tests/merge/test_triggers.py
+++ b/tests/merge/test_triggers.py
@@ -7,15 +7,16 @@ from math import ceil, floor
from os.path import normpath
import pytest
-from pkgcore.fs import fs
-from pkgcore.fs.contents import contentsSet
-from pkgcore.fs.livefs import gen_obj
-from pkgcore.merge import const, triggers
from snakeoil import process
from snakeoil.contexts import os_environ
from snakeoil.currying import post_curry
from snakeoil.osutils import ensure_dirs
+from pkgcore.fs import fs
+from pkgcore.fs.contents import contentsSet
+from pkgcore.fs.livefs import gen_obj
+from pkgcore.merge import const, triggers
+
from .util import fake_engine, fake_reporter, fake_trigger
diff --git a/tests/package/test_base.py b/tests/package/test_base.py
index f189c8a2..f366d522 100644
--- a/tests/package/test_base.py
+++ b/tests/package/test_base.py
@@ -2,6 +2,7 @@ from functools import partial
from types import SimpleNamespace
import pytest
+
from pkgcore.package import base
diff --git a/tests/package/test_mutated.py b/tests/package/test_mutated.py
index 50b71885..45f7c810 100644
--- a/tests/package/test_mutated.py
+++ b/tests/package/test_mutated.py
@@ -1,6 +1,7 @@
from functools import partial, total_ordering
import pytest
+
from pkgcore.package.base import base, dynamic_getattr_dict
from pkgcore.package.mutated import MutatedPkg
diff --git a/tests/pkgsets/test_filelist.py b/tests/pkgsets/test_filelist.py
index e3a00057..87ae6586 100644
--- a/tests/pkgsets/test_filelist.py
+++ b/tests/pkgsets/test_filelist.py
@@ -1,6 +1,7 @@
import os
import pytest
+
from pkgcore import os_data
from pkgcore.ebuild.atom import atom
from pkgcore.pkgsets import filelist
diff --git a/tests/repository/test_filtered.py
b/tests/repository/test_filtered.py
index 4585072e..3563bec3 100644
--- a/tests/repository/test_filtered.py
+++ b/tests/repository/test_filtered.py
@@ -1,6 +1,6 @@
from pkgcore.ebuild.atom import atom
-from pkgcore.ebuild.restricts import CategoryDep
from pkgcore.ebuild.cpv import VersionedCPV
+from pkgcore.ebuild.restricts import CategoryDep
from pkgcore.repository import filtered
from pkgcore.repository.util import SimpleTree
from pkgcore.restrictions import packages, values
diff --git a/tests/repository/test_prototype.py
b/tests/repository/test_prototype.py
index fb846eb2..0c95dfdc 100644
--- a/tests/repository/test_prototype.py
+++ b/tests/repository/test_prototype.py
@@ -3,13 +3,14 @@ from functools import partial
from types import SimpleNamespace
import pytest
+from snakeoil.currying import post_curry
+
from pkgcore.ebuild.atom import atom
from pkgcore.ebuild.cpv import VersionedCPV
from pkgcore.operations.repo import operations
from pkgcore.package.mutated import MutatedPkg
from pkgcore.repository.util import SimpleTree
from pkgcore.restrictions import boolean, packages, values
-from snakeoil.currying import post_curry
class TestPrototype:
diff --git a/tests/resolver/test_choice_point.py
b/tests/resolver/test_choice_point.py
index 49e82052..83b5e064 100644
--- a/tests/resolver/test_choice_point.py
+++ b/tests/resolver/test_choice_point.py
@@ -1,4 +1,5 @@
import pytest
+
from pkgcore.resolver.choice_point import choice_point
from pkgcore.restrictions.boolean import AndRestriction, OrRestriction
diff --git a/tests/resolver/test_pigeonholes.py
b/tests/resolver/test_pigeonholes.py
index c847c0f4..71ee494d 100644
--- a/tests/resolver/test_pigeonholes.py
+++ b/tests/resolver/test_pigeonholes.py
@@ -1,4 +1,5 @@
import pytest
+
from pkgcore.resolver.pigeonholes import PigeonHoledSlots
from pkgcore.restrictions import restriction
diff --git a/tests/resolver/test_plan.py b/tests/resolver/test_plan.py
index b7c7c2e8..44e83ae2 100644
--- a/tests/resolver/test_plan.py
+++ b/tests/resolver/test_plan.py
@@ -1,4 +1,5 @@
import pytest
+
from pkgcore.resolver import plan
from pkgcore.test.misc import FakePkg
diff --git a/tests/restrictions/test_delegated.py
b/tests/restrictions/test_delegated.py
index 3ff764d8..c91e4f9b 100644
--- a/tests/restrictions/test_delegated.py
+++ b/tests/restrictions/test_delegated.py
@@ -1,6 +1,7 @@
import pytest
from pkgcore.restrictions.delegated import delegate
+
from .utils import TestRestriction
diff --git a/tests/restrictions/test_packages.py
b/tests/restrictions/test_packages.py
index 4288b3e6..eee52b63 100644
--- a/tests/restrictions/test_packages.py
+++ b/tests/restrictions/test_packages.py
@@ -1,9 +1,10 @@
from types import SimpleNamespace
import pytest
-from pkgcore.restrictions import packages, values
from snakeoil.mappings import AttrAccessible
+from pkgcore.restrictions import packages, values
+
from .utils import TestRestriction
diff --git a/tests/scripts/test_pmerge.py b/tests/scripts/test_pmerge.py
index b4cea591..ff0b537c 100644
--- a/tests/scripts/test_pmerge.py
+++ b/tests/scripts/test_pmerge.py
@@ -1,4 +1,5 @@
import pytest
+
from pkgcore.ebuild.atom import atom
from pkgcore.repository.util import SimpleTree
from pkgcore.scripts import pmerge
diff --git a/tests/sync/test_base.py b/tests/sync/test_base.py
index 22fb6e82..443720fd 100644
--- a/tests/sync/test_base.py
+++ b/tests/sync/test_base.py
@@ -3,9 +3,10 @@ import pwd
from unittest import mock
import pytest
+from snakeoil.process import CommandNotFound
+
from pkgcore import os_data
from pkgcore.sync import base, git, tar
-from snakeoil.process import CommandNotFound
existing_user = pwd.getpwall()[0].pw_name
existing_uid = pwd.getpwnam(existing_user).pw_uid
diff --git a/tests/sync/test_bzr.py b/tests/sync/test_bzr.py
index f036c647..e9299659 100644
--- a/tests/sync/test_bzr.py
+++ b/tests/sync/test_bzr.py
@@ -1,9 +1,10 @@
from unittest import mock
import pytest
-from pkgcore.sync import base, bzr
from snakeoil.process import CommandNotFound
+from pkgcore.sync import base, bzr
+
class TestBzrSyncer:
@pytest.fixture(autouse=True)
diff --git a/tests/sync/test_cvs.py b/tests/sync/test_cvs.py
index 7c02619f..8bbafbbd 100644
--- a/tests/sync/test_cvs.py
+++ b/tests/sync/test_cvs.py
@@ -1,9 +1,10 @@
from unittest import mock
import pytest
-from pkgcore.sync import base, cvs
from snakeoil.process import CommandNotFound
+from pkgcore.sync import base, cvs
+
class TestCVSSyncer:
@pytest.fixture(autouse=True)
diff --git a/tests/sync/test_darcs.py b/tests/sync/test_darcs.py
index 4abdaa10..90dde7c5 100644
--- a/tests/sync/test_darcs.py
+++ b/tests/sync/test_darcs.py
@@ -1,9 +1,10 @@
from unittest import mock
import pytest
-from pkgcore.sync import base, darcs
from snakeoil.process import CommandNotFound
+from pkgcore.sync import base, darcs
+
class TestDarcsSyncer:
@pytest.fixture(autouse=True)
diff --git a/tests/sync/test_git.py b/tests/sync/test_git.py
index 16a12b6e..793c5347 100644
--- a/tests/sync/test_git.py
+++ b/tests/sync/test_git.py
@@ -2,9 +2,10 @@ import os
from unittest import mock
import pytest
-from pkgcore.sync import base, git
from snakeoil.process import CommandNotFound
+from pkgcore.sync import base, git
+
class TestGitSyncer:
@pytest.fixture(autouse=True)
diff --git a/tests/sync/test_git_svn.py b/tests/sync/test_git_svn.py
index a79c15cc..50e8a2be 100644
--- a/tests/sync/test_git_svn.py
+++ b/tests/sync/test_git_svn.py
@@ -3,9 +3,10 @@
from unittest import mock
import pytest
-from pkgcore.sync import base, git_svn
from snakeoil.process import CommandNotFound
+from pkgcore.sync import base, git_svn
+
class TestGitSVNSyncer:
@pytest.fixture(autouse=True)
diff --git a/tests/sync/test_hg.py b/tests/sync/test_hg.py
index 490eac05..d749b04b 100644
--- a/tests/sync/test_hg.py
+++ b/tests/sync/test_hg.py
@@ -2,9 +2,10 @@ import os
from unittest import mock
import pytest
-from pkgcore.sync import base, hg
from snakeoil.process import CommandNotFound
+from pkgcore.sync import base, hg
+
class TestHgSyncer:
@pytest.fixture(autouse=True)
diff --git a/tests/sync/test_rsync.py b/tests/sync/test_rsync.py
index b6f73f3c..ffa1fec9 100644
--- a/tests/sync/test_rsync.py
+++ b/tests/sync/test_rsync.py
@@ -3,9 +3,10 @@ import os
from unittest import mock
import pytest
+from snakeoil.process import CommandNotFound
+
from pkgcore.sync import base, rsync
from pkgcore.sync.tar import tar_syncer
-from snakeoil.process import CommandNotFound
def fake_ips(num):
diff --git a/tests/sync/test_sqfs.py b/tests/sync/test_sqfs.py
index 88e23da2..501fa385 100644
--- a/tests/sync/test_sqfs.py
+++ b/tests/sync/test_sqfs.py
@@ -1,6 +1,7 @@
import os
import pytest
+
from pkgcore.sync import base
from pkgcore.sync.sqfs import sqfs_syncer
diff --git a/tests/sync/test_svn.py b/tests/sync/test_svn.py
index 1edeffc2..d69099a7 100644
--- a/tests/sync/test_svn.py
+++ b/tests/sync/test_svn.py
@@ -1,9 +1,10 @@
from unittest import mock
import pytest
-from pkgcore.sync import base, svn
from snakeoil.process import CommandNotFound
+from pkgcore.sync import base, svn
+
class TestSVNSyncer:
@pytest.fixture(autouse=True)
diff --git a/tests/sync/test_tar.py b/tests/sync/test_tar.py
index 0e65ea56..b866308a 100644
--- a/tests/sync/test_tar.py
+++ b/tests/sync/test_tar.py
@@ -1,6 +1,7 @@
import os
import pytest
+
from pkgcore.sync import base
from pkgcore.sync.tar import tar_syncer
diff --git a/tests/util/test_parserestrict.py b/tests/util/test_parserestrict.py
index 4299441c..6e20bebb 100644
--- a/tests/util/test_parserestrict.py
+++ b/tests/util/test_parserestrict.py
@@ -1,4 +1,5 @@
import pytest
+
from pkgcore.ebuild import restricts
from pkgcore.ebuild.atom import atom
from pkgcore.repository import util