Skip to content

Commit

Permalink
Reapply ruff/isort rules (I)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos committed Sep 28, 2024
1 parent 00198cd commit 5c55f53
Show file tree
Hide file tree
Showing 85 changed files with 97 additions and 121 deletions.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
from installer import install
from installer.destinations import SchemeDictionaryDestination
from installer.sources import WheelFile

from pip import __file__ as pip_location
from pip._internal.locations import _USE_SYSCONFIG
from pip._internal.utils.temp_dir import global_tempdir_manager

from tests.lib import (
DATA_DIR,
SRC_DIR,
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_build_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from typing import Optional

import pytest

from pip._internal.build_env import BuildEnvironment, _get_system_sitepackages

from tests.lib import (
PipTestEnvironment,
TestPipResult,
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from textwrap import dedent

import pytest

from pip._internal.commands import commands_dict

from tests.lib import PipTestEnvironment


Expand Down
1 change: 1 addition & 0 deletions tests/functional/test_config_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from zipfile import ZipFile

from pip._internal.utils.urls import path_to_url

from tests.lib import PipTestEnvironment, create_basic_sdist_for_package

PYPROJECT_TOML = """\
Expand Down
1 change: 1 addition & 0 deletions tests/functional/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from pip._internal.cli.status_codes import ERROR
from pip._internal.configuration import CONFIG_BASENAME, get_configuration_files

from tests.lib import PipTestEnvironment
from tests.lib.configuration_helpers import ConfigurationMixin, kinds
from tests.lib.venv import VirtualEnvironment
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
from typing import List

import pytest
from pip._vendor.packaging.version import Version

from pip._internal.commands.debug import create_vendor_txt_map
from pip._internal.utils import compatibility_tags
from pip._vendor.packaging.version import Version

from tests.lib import PipTestEnvironment


Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
from typing import Callable, List, Tuple

import pytest

from pip._internal.cli.status_codes import ERROR
from pip._internal.utils.urls import path_to_url

from tests.lib import (
PipTestEnvironment,
ScriptFactory,
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_fast_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from typing import Iterable

import pytest
from pip._internal.utils.misc import hash_file
from pip._vendor.packaging.utils import canonicalize_name

from pip._internal.utils.misc import hash_file
from tests.lib import PipTestEnvironment, TestData, TestPipResult


Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from pathlib import Path

import pytest
from pip._internal.models.direct_url import DirectUrl, DirInfo
from pip._vendor.packaging.utils import canonicalize_name

from pip._internal.models.direct_url import DirectUrl, DirInfo
from tests.lib import (
PipTestEnvironment,
TestData,
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_help.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from unittest.mock import Mock

import pytest

from pip._internal.cli.status_codes import ERROR, SUCCESS
from pip._internal.commands import commands_dict, create_command
from pip._internal.exceptions import CommandError

from tests.lib import InMemoryPip, PipTestEnvironment


Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_index.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

from pip._internal.cli.status_codes import ERROR, SUCCESS
from pip._internal.commands import create_command

from tests.lib import PipTestEnvironment


Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
from typing import Dict, Iterable, List, Optional, Tuple

import pytest

from pip._internal.cli.status_codes import ERROR, SUCCESS
from pip._internal.models.index import PyPI, TestPyPI
from pip._internal.utils.misc import rmtree
from pip._internal.utils.urls import path_to_url

from tests.lib import (
CertFactory,
PipTestEnvironment,
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_install_direct_url.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from pip._internal.models.direct_url import VcsInfo

from tests.lib import PipTestEnvironment, TestData, _create_test_package
from tests.lib.direct_url import get_created_direct_url

Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_invalid_versions_and_specifiers.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import zipfile

import pytest

from pip._internal.metadata import select_backend

from tests.lib import PipTestEnvironment, TestData


Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from pathlib import Path

import pytest

from pip._internal.models.direct_url import DirectUrl, DirInfo

from tests.lib import (
PipTestEnvironment,
ScriptFactory,
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_new_resolver_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from typing import Callable, Optional

import pytest

from pip._internal.cli.status_codes import ERROR, SUCCESS

from tests.lib import PipTestEnvironment
from tests.lib.wheel import make_wheel

Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_pep517.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import pytest
import tomli_w

from pip._internal.build_env import BuildEnvironment
from pip._internal.req import InstallRequirement

from tests.lib import (
PipTestEnvironment,
TestData,
Expand Down
1 change: 1 addition & 0 deletions tests/functional/test_pip_runner_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from pathlib import Path

from pip import __version__

from tests.lib import PipTestEnvironment


Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from unittest import mock

import pytest

from pip._internal.cli.status_codes import NO_MATCHES_FOUND, SUCCESS
from pip._internal.commands import create_command
from pip._internal.commands.search import highest_version, print_results, transform_hits

from tests.lib import PipTestEnvironment

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import textwrap

import pytest

from pip import __version__
from pip._internal.commands.show import search_packages_info
from pip._internal.utils.unpacking import untar_file

from tests.lib import (
PipTestEnvironment,
TestData,
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_uninstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
from unittest.mock import Mock

import pytest

from pip._internal.req.constructors import install_req_from_line
from pip._internal.utils.misc import rmtree

from tests.lib import (
PipTestEnvironment,
TestData,
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_vcs_bazaar.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from pathlib import Path

import pytest

from pip._internal.vcs.bazaar import Bazaar
from pip._internal.vcs.versioncontrol import RemoteNotFoundError

from tests.lib import PipTestEnvironment, is_bzr_installed, need_bzr


Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_vcs_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
from unittest.mock import Mock, patch

import pytest

from pip._internal.utils.misc import HiddenText
from pip._internal.vcs import vcs
from pip._internal.vcs.git import Git, RemoteNotFoundError

from tests.lib import PipTestEnvironment, _create_test_package, _git_commit


Expand Down
1 change: 1 addition & 0 deletions tests/functional/test_vcs_mercurial.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os

from pip._internal.vcs.mercurial import Mercurial

from tests.lib import PipTestEnvironment, _create_test_package, need_mercurial


Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_vcs_subversion.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from pathlib import Path

import pytest

from pip._internal.vcs.subversion import Subversion
from pip._internal.vcs.versioncontrol import RemoteNotFoundError

from tests.lib import PipTestEnvironment, _create_svn_repo, need_svn


Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from pathlib import Path

import pytest

from pip._internal.cli.status_codes import ERROR

from tests.lib import (
PipTestEnvironment,
TestData,
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
from zipfile import ZipFile

import pytest
from pip._vendor.packaging.utils import canonicalize_name
from scripttest import FoundDir, FoundFile, ProcResult, TestFileEnvironment

from pip._internal.cli.main import main as pip_entry_point
from pip._internal.index.collector import LinkCollector
from pip._internal.index.package_finder import PackageFinder
Expand All @@ -44,6 +41,9 @@
from pip._internal.models.target_python import TargetPython
from pip._internal.network.session import PipSession
from pip._internal.utils.egg_link import _egg_link_names
from pip._vendor.packaging.utils import canonicalize_name
from scripttest import FoundDir, FoundFile, ProcResult, TestFileEnvironment

from tests.lib.venv import VirtualEnvironment
from tests.lib.wheel import make_wheel

Expand Down
1 change: 1 addition & 0 deletions tests/lib/direct_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import Optional

from pip._internal.models.direct_url import DIRECT_URL_METADATA_NAME, DirectUrl

from tests.lib import TestPipResult


Expand Down
3 changes: 1 addition & 2 deletions tests/lib/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
)
from zipfile import ZipFile

from pip._vendor.requests.structures import CaseInsensitiveDict

from pip._internal.metadata import BaseDistribution, MemoryWheel, get_wheel_distribution
from pip._vendor.requests.structures import CaseInsensitiveDict

# As would be used in metadata
HeaderValue = Union[str, List[str]]
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/metadata/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
from unittest import mock

import pytest
from pip._vendor.packaging.utils import NormalizedName

from pip._internal.metadata import (
BaseDistribution,
get_directory_distribution,
Expand All @@ -15,6 +13,8 @@
)
from pip._internal.metadata.base import FilesystemWheel
from pip._internal.models.direct_url import DIRECT_URL_METADATA_NAME, ArchiveInfo
from pip._vendor.packaging.utils import NormalizedName

from tests.lib.wheel import make_wheel


Expand Down
9 changes: 4 additions & 5 deletions tests/unit/metadata/test_metadata_pkg_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
from unittest import mock

import pytest
from pip._vendor.packaging.requirements import Requirement
from pip._vendor.packaging.specifiers import SpecifierSet
from pip._vendor.packaging.utils import canonicalize_name
from pip._vendor.packaging.version import parse as parse_version

from pip._internal.exceptions import UnsupportedWheel
from pip._internal.metadata.pkg_resources import (
Distribution,
Environment,
InMemoryMetadata,
)
from pip._vendor.packaging.requirements import Requirement
from pip._vendor.packaging.specifiers import SpecifierSet
from pip._vendor.packaging.utils import canonicalize_name
from pip._vendor.packaging.version import parse as parse_version

pkg_resources = pytest.importorskip("pip._vendor.pkg_resources")

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/resolution_resolvelib/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from typing import Iterator

import pytest

from pip._internal.cli.req_command import RequirementCommand
from pip._internal.commands.install import InstallCommand
from pip._internal.index.collector import LinkCollector
Expand All @@ -17,6 +16,7 @@
from pip._internal.resolution.resolvelib.factory import Factory
from pip._internal.resolution.resolvelib.provider import PipProvider
from pip._internal.utils.temp_dir import TempDirectory, global_tempdir_manager

from tests.lib import TestData


Expand Down
3 changes: 1 addition & 2 deletions tests/unit/resolution_resolvelib/test_provider.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
from typing import TYPE_CHECKING, List, Optional

from pip._vendor.resolvelib.resolvers import RequirementInformation

from pip._internal.models.candidate import InstallationCandidate
from pip._internal.models.link import Link
from pip._internal.req.constructors import install_req_from_req_string
from pip._internal.resolution.resolvelib.factory import Factory
from pip._internal.resolution.resolvelib.provider import PipProvider
from pip._internal.resolution.resolvelib.requirements import SpecifierRequirement
from pip._vendor.resolvelib.resolvers import RequirementInformation

if TYPE_CHECKING:
from pip._internal.resolution.resolvelib.provider import PreferenceInformation
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/resolution_resolvelib/test_requirement.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from typing import List, Tuple

import pytest
from pip._vendor.resolvelib import BaseReporter, Resolver

from pip._internal.resolution.resolvelib.base import Candidate, Constraint, Requirement
from pip._internal.resolution.resolvelib.factory import Factory
from pip._internal.resolution.resolvelib.provider import PipProvider
from pip._vendor.resolvelib import BaseReporter, Resolver

from tests.lib import TestData

# NOTE: All tests are prefixed `test_rlr` (for "test resolvelib resolver").
Expand Down
Loading

0 comments on commit 5c55f53

Please sign in to comment.