Commit 34c55fa2 by Edwin Yllanes Committed by Bjorn Neergaard

Change typing.Callable to collections.abc.Callable

parent 2ae46fa5
from __future__ import annotations
from typing import Callable
from typing import TYPE_CHECKING
from poetry.utils._compat import metadata
if TYPE_CHECKING:
from collections.abc import Callable
# The metadata.version that we import for Python 3.7 is untyped, work around
# that.
version: Callable[[str], str] = metadata.version
......
......@@ -9,7 +9,6 @@ from copy import deepcopy
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
from typing import Callable
from poetry.core.toml import TOMLFile
from poetry.core.utils.helpers import canonicalize_name
......@@ -21,6 +20,8 @@ from poetry.locations import CONFIG_DIR
if TYPE_CHECKING:
from collections.abc import Callable
from poetry.config.config_source import ConfigSource
......
......@@ -7,7 +7,6 @@ from contextlib import suppress
from importlib import import_module
from typing import TYPE_CHECKING
from typing import Any
from typing import Callable
from typing import cast
from cleo.application import Application as BaseApplication
......@@ -24,6 +23,8 @@ from poetry.console.commands.command import Command
if TYPE_CHECKING:
from collections.abc import Callable
from cleo.events.console_command_event import ConsoleCommandEvent
from cleo.io.inputs.definition import Definition
from cleo.io.inputs.input import Input
......
from __future__ import annotations
from typing import TYPE_CHECKING
from typing import Callable
from cleo.exceptions import LogicException
from cleo.loaders.factory_command_loader import FactoryCommandLoader
if TYPE_CHECKING:
from collections.abc import Callable
from poetry.console.commands.command import Command
......
from __future__ import annotations
from typing import Callable
from typing import TYPE_CHECKING
from poetry.console.commands.command import Command
if TYPE_CHECKING:
from collections.abc import Callable
class AboutCommand(Command):
name = "about"
......
......@@ -10,7 +10,6 @@ import zipfile
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
from typing import Callable
from typing import ContextManager
from typing import Iterator
from typing import cast
......@@ -31,6 +30,8 @@ from poetry.utils.setup_reader import SetupReader
if TYPE_CHECKING:
from collections.abc import Callable
from poetry.core.packages.project_package import ProjectPackage
......
from __future__ import annotations
from typing import TYPE_CHECKING
from typing import Callable
from typing import Iterator
from poetry.mixology.incompatibility_cause import ConflictCause
......@@ -14,6 +13,8 @@ from poetry.mixology.incompatibility_cause import RootCause
if TYPE_CHECKING:
from collections.abc import Callable
from poetry.mixology.incompatibility_cause import IncompatibilityCause
from poetry.mixology.term import Term
......
......@@ -13,7 +13,6 @@ from contextlib import contextmanager
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
from typing import Callable
from typing import Iterable
from typing import Iterator
from typing import cast
......@@ -43,6 +42,8 @@ from poetry.vcs.git import Git
if TYPE_CHECKING:
from collections.abc import Callable
from poetry.core.packages.dependency import Dependency
from poetry.core.packages.package import Package
from poetry.core.semver.version_constraint import VersionConstraint
......
......@@ -10,10 +10,11 @@ from collections.abc import Mapping
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
from typing import Callable
if TYPE_CHECKING:
from collections.abc import Callable
from poetry.core.packages.package import Package
from requests import Session
......
......@@ -4,7 +4,6 @@ import os
import re
from typing import TYPE_CHECKING
from typing import Callable
from typing import Iterator
import pytest
......@@ -17,6 +16,7 @@ from poetry.config.config import int_normalizer
if TYPE_CHECKING:
from collections.abc import Callable
from pathlib import Path
......
......@@ -3,12 +3,13 @@ from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
from typing import Callable
from poetry.core.semver.version import Version
if TYPE_CHECKING:
from collections.abc import Callable
from poetry.core.version.pep440.version import PEP440Version
VERSION_3_7_1 = Version.parse("3.7.1")
......
......@@ -7,7 +7,6 @@ import sys
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
from typing import Callable
from typing import Iterator
import pytest
......@@ -34,6 +33,8 @@ from poetry.utils.helpers import remove_directory
if TYPE_CHECKING:
from collections.abc import Callable
from pytest_mock import MockerFixture
from poetry.poetry import Poetry
......
......@@ -2,7 +2,7 @@ from __future__ import annotations
import os
from typing import Callable
from typing import TYPE_CHECKING
import pytest
......@@ -11,6 +11,10 @@ from poetry.core.version.exceptions import InvalidVersion
from poetry.utils.setup_reader import SetupReader
if TYPE_CHECKING:
from collections.abc import Callable
@pytest.fixture()
def setup() -> Callable[[str], str]:
def _setup(name: str) -> str:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment