Commit ae03bdcd by pre-commit-ci[bot] Committed by GitHub

[pre-commit.ci] pre-commit autoupdate (#5952)

* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 22.3.0 → 22.6.0](https://github.com/psf/black/compare/22.3.0...22.6.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
parent bf81d095
...@@ -75,7 +75,7 @@ repos: ...@@ -75,7 +75,7 @@ repos:
args: [--lines-after-imports, "-1"] args: [--lines-after-imports, "-1"]
- repo: https://github.com/psf/black - repo: https://github.com/psf/black
rev: 22.3.0 rev: 22.6.0
hooks: hooks:
- id: black - id: black
......
...@@ -309,7 +309,6 @@ environment variable. This has not been done automatically. ...@@ -309,7 +309,6 @@ environment variable. This has not been done automatically.
class Installer: class Installer:
CURRENT_PYTHON = sys.executable CURRENT_PYTHON = sys.executable
CURRENT_PYTHON_VERSION = sys.version_info[:2] CURRENT_PYTHON_VERSION = sys.version_info[:2]
METADATA_URL = "https://pypi.org/pypi/poetry/json" METADATA_URL = "https://pypi.org/pypi/poetry/json"
......
...@@ -105,7 +105,6 @@ _default_config: Config | None = None ...@@ -105,7 +105,6 @@ _default_config: Config | None = None
class Config: class Config:
default_config: dict[str, Any] = { default_config: dict[str, Any] = {
"cache-dir": str(DEFAULT_CACHE_DIR), "cache-dir": str(DEFAULT_CACHE_DIR),
"virtualenvs": { "virtualenvs": {
......
...@@ -10,7 +10,6 @@ if TYPE_CHECKING: ...@@ -10,7 +10,6 @@ if TYPE_CHECKING:
class AboutCommand(Command): class AboutCommand(Command):
name = "about" name = "about"
description = "Shows information about Poetry." description = "Shows information about Poetry."
......
...@@ -15,7 +15,6 @@ from poetry.utils.helpers import canonicalize_name ...@@ -15,7 +15,6 @@ from poetry.utils.helpers import canonicalize_name
class AddCommand(InstallerCommand, InitCommand): class AddCommand(InstallerCommand, InitCommand):
name = "add" name = "add"
description = "Adds a new dependency to <comment>pyproject.toml</>." description = "Adds a new dependency to <comment>pyproject.toml</>."
......
...@@ -7,7 +7,6 @@ from poetry.utils.env import build_environment ...@@ -7,7 +7,6 @@ from poetry.utils.env import build_environment
class BuildCommand(EnvCommand): class BuildCommand(EnvCommand):
name = "build" name = "build"
description = "Builds a package, as a tarball and a wheel by default." description = "Builds a package, as a tarball and a wheel by default."
......
...@@ -10,7 +10,6 @@ from poetry.console.commands.command import Command ...@@ -10,7 +10,6 @@ from poetry.console.commands.command import Command
class CacheClearCommand(Command): class CacheClearCommand(Command):
name = "cache clear" name = "cache clear"
description = "Clears Poetry's cache." description = "Clears Poetry's cache."
......
...@@ -5,7 +5,6 @@ from poetry.console.commands.command import Command ...@@ -5,7 +5,6 @@ from poetry.console.commands.command import Command
class CacheListCommand(Command): class CacheListCommand(Command):
name = "cache list" name = "cache list"
description = "List Poetry's caches." description = "List Poetry's caches."
......
...@@ -6,7 +6,6 @@ from poetry.console.commands.command import Command ...@@ -6,7 +6,6 @@ from poetry.console.commands.command import Command
class CheckCommand(Command): class CheckCommand(Command):
name = "check" name = "check"
description = "Checks the validity of the <comment>pyproject.toml</comment> file." description = "Checks the validity of the <comment>pyproject.toml</comment> file."
......
...@@ -24,7 +24,6 @@ if TYPE_CHECKING: ...@@ -24,7 +24,6 @@ if TYPE_CHECKING:
class ConfigCommand(Command): class ConfigCommand(Command):
name = "config" name = "config"
description = "Manages configuration settings." description = "Manages configuration settings."
......
...@@ -6,7 +6,6 @@ from poetry.console.commands.command import Command ...@@ -6,7 +6,6 @@ from poetry.console.commands.command import Command
class DebugInfoCommand(Command): class DebugInfoCommand(Command):
name = "debug info" name = "debug info"
description = "Shows debug information." description = "Shows debug information."
......
...@@ -14,7 +14,6 @@ if TYPE_CHECKING: ...@@ -14,7 +14,6 @@ if TYPE_CHECKING:
class DebugResolveCommand(InitCommand): class DebugResolveCommand(InitCommand):
name = "debug resolve" name = "debug resolve"
description = "Debugs dependency resolution." description = "Debugs dependency resolution."
......
...@@ -12,7 +12,6 @@ if TYPE_CHECKING: ...@@ -12,7 +12,6 @@ if TYPE_CHECKING:
class EnvInfoCommand(Command): class EnvInfoCommand(Command):
name = "env info" name = "env info"
description = "Displays information about the current environment." description = "Displays information about the current environment."
......
...@@ -6,7 +6,6 @@ from poetry.console.commands.command import Command ...@@ -6,7 +6,6 @@ from poetry.console.commands.command import Command
class EnvListCommand(Command): class EnvListCommand(Command):
name = "env list" name = "env list"
description = "Lists all virtualenvs associated with the current project." description = "Lists all virtualenvs associated with the current project."
......
...@@ -7,7 +7,6 @@ from poetry.console.commands.command import Command ...@@ -7,7 +7,6 @@ from poetry.console.commands.command import Command
class EnvRemoveCommand(Command): class EnvRemoveCommand(Command):
name = "env remove" name = "env remove"
description = "Remove virtual environments associated with the project." description = "Remove virtual environments associated with the project."
......
...@@ -6,7 +6,6 @@ from poetry.console.commands.command import Command ...@@ -6,7 +6,6 @@ from poetry.console.commands.command import Command
class EnvUseCommand(Command): class EnvUseCommand(Command):
name = "env use" name = "env use"
description = "Activates or creates a new virtualenv for the current project." description = "Activates or creates a new virtualenv for the current project."
......
...@@ -6,7 +6,6 @@ from poetry.console.commands.installer_command import InstallerCommand ...@@ -6,7 +6,6 @@ from poetry.console.commands.installer_command import InstallerCommand
class InstallCommand(InstallerCommand): class InstallCommand(InstallerCommand):
name = "install" name = "install"
description = "Installs the project dependencies." description = "Installs the project dependencies."
......
...@@ -6,7 +6,6 @@ from poetry.console.commands.installer_command import InstallerCommand ...@@ -6,7 +6,6 @@ from poetry.console.commands.installer_command import InstallerCommand
class LockCommand(InstallerCommand): class LockCommand(InstallerCommand):
name = "lock" name = "lock"
description = "Locks the project dependencies." description = "Locks the project dependencies."
......
...@@ -11,7 +11,6 @@ from poetry.console.commands.command import Command ...@@ -11,7 +11,6 @@ from poetry.console.commands.command import Command
class NewCommand(Command): class NewCommand(Command):
name = "new" name = "new"
description = "Creates a new Python project at <path>." description = "Creates a new Python project at <path>."
......
...@@ -10,7 +10,6 @@ from poetry.console.commands.self.add import SelfAddCommand ...@@ -10,7 +10,6 @@ from poetry.console.commands.self.add import SelfAddCommand
class PluginAddCommand(InitCommand): class PluginAddCommand(InitCommand):
name = "plugin add" name = "plugin add"
description = "Adds new plugins." description = "Adds new plugins."
......
...@@ -15,7 +15,6 @@ if TYPE_CHECKING: ...@@ -15,7 +15,6 @@ if TYPE_CHECKING:
class PluginRemoveCommand(Command): class PluginRemoveCommand(Command):
name = "plugin remove" name = "plugin remove"
description = "Removes installed plugins" description = "Removes installed plugins"
......
...@@ -13,7 +13,6 @@ if TYPE_CHECKING: ...@@ -13,7 +13,6 @@ if TYPE_CHECKING:
class PluginShowCommand(Command): class PluginShowCommand(Command):
name = "plugin show" name = "plugin show"
description = "Shows information about the currently installed plugins." description = "Shows information about the currently installed plugins."
......
...@@ -8,7 +8,6 @@ from poetry.console.commands.command import Command ...@@ -8,7 +8,6 @@ from poetry.console.commands.command import Command
class PublishCommand(Command): class PublishCommand(Command):
name = "publish" name = "publish"
description = "Publishes a package to a remote repository." description = "Publishes a package to a remote repository."
......
...@@ -12,7 +12,6 @@ from poetry.utils.helpers import canonicalize_name ...@@ -12,7 +12,6 @@ from poetry.utils.helpers import canonicalize_name
class RemoveCommand(InstallerCommand): class RemoveCommand(InstallerCommand):
name = "remove" name = "remove"
description = "Removes a package from the project dependencies." description = "Removes a package from the project dependencies."
......
...@@ -12,7 +12,6 @@ if TYPE_CHECKING: ...@@ -12,7 +12,6 @@ if TYPE_CHECKING:
class RunCommand(EnvCommand): class RunCommand(EnvCommand):
name = "run" name = "run"
description = "Runs a command in the appropriate environment." description = "Runs a command in the appropriate environment."
......
...@@ -6,7 +6,6 @@ from poetry.console.commands.command import Command ...@@ -6,7 +6,6 @@ from poetry.console.commands.command import Command
class SearchCommand(Command): class SearchCommand(Command):
name = "search" name = "search"
description = "Searches for packages on remote repositories." description = "Searches for packages on remote repositories."
......
...@@ -9,7 +9,6 @@ from poetry.console.commands.env_command import EnvCommand ...@@ -9,7 +9,6 @@ from poetry.console.commands.env_command import EnvCommand
class ShellCommand(EnvCommand): class ShellCommand(EnvCommand):
name = "shell" name = "shell"
description = "Spawns a shell within the virtual environment." description = "Spawns a shell within the virtual environment."
......
...@@ -31,7 +31,6 @@ def reverse_deps(pkg: Package, repo: Repository) -> dict[str, str]: ...@@ -31,7 +31,6 @@ def reverse_deps(pkg: Package, repo: Repository) -> dict[str, str]:
class ShowCommand(GroupCommand): class ShowCommand(GroupCommand):
name = "show" name = "show"
description = "Shows information about packages." description = "Shows information about packages."
......
...@@ -10,7 +10,6 @@ from poetry.console.commands.command import Command ...@@ -10,7 +10,6 @@ from poetry.console.commands.command import Command
class SourceAddCommand(Command): class SourceAddCommand(Command):
name = "source add" name = "source add"
description = "Add source configuration for project." description = "Add source configuration for project."
......
...@@ -7,7 +7,6 @@ from poetry.console.commands.command import Command ...@@ -7,7 +7,6 @@ from poetry.console.commands.command import Command
class SourceRemoveCommand(Command): class SourceRemoveCommand(Command):
name = "source remove" name = "source remove"
description = "Remove source configured for the project." description = "Remove source configured for the project."
......
...@@ -7,7 +7,6 @@ from poetry.console.commands.installer_command import InstallerCommand ...@@ -7,7 +7,6 @@ from poetry.console.commands.installer_command import InstallerCommand
class UpdateCommand(InstallerCommand): class UpdateCommand(InstallerCommand):
name = "update" name = "update"
description = ( description = (
"Update the dependencies as according to the <comment>pyproject.toml</> file." "Update the dependencies as according to the <comment>pyproject.toml</> file."
......
...@@ -15,7 +15,6 @@ if TYPE_CHECKING: ...@@ -15,7 +15,6 @@ if TYPE_CHECKING:
class VersionCommand(Command): class VersionCommand(Command):
name = "version" name = "version"
description = ( description = (
"Shows the version of the project or bumps it when a valid " "Shows the version of the project or bumps it when a valid "
......
...@@ -4,5 +4,4 @@ from cleo.exceptions import CleoSimpleException ...@@ -4,5 +4,4 @@ from cleo.exceptions import CleoSimpleException
class PoetrySimpleConsoleException(CleoSimpleException): # type: ignore[misc] class PoetrySimpleConsoleException(CleoSimpleException): # type: ignore[misc]
pass pass
...@@ -13,7 +13,6 @@ if TYPE_CHECKING: ...@@ -13,7 +13,6 @@ if TYPE_CHECKING:
class IOFormatter(logging.Formatter): class IOFormatter(logging.Formatter):
_colors = { _colors = {
"error": "fg=red", "error": "fg=red",
"warning": "fg=yellow", "warning": "fg=yellow",
......
...@@ -2,10 +2,8 @@ from __future__ import annotations ...@@ -2,10 +2,8 @@ from __future__ import annotations
class PoetryException(Exception): class PoetryException(Exception):
pass pass
class InvalidProjectFile(PoetryException): class InvalidProjectFile(PoetryException):
pass pass
...@@ -15,7 +15,6 @@ SCHEMA_DIR = os.path.join(os.path.dirname(__file__), "schemas") ...@@ -15,7 +15,6 @@ SCHEMA_DIR = os.path.join(os.path.dirname(__file__), "schemas")
class ValidationError(ValueError): class ValidationError(ValueError):
pass pass
......
...@@ -14,17 +14,14 @@ class IncompatibilityCause(Exception): ...@@ -14,17 +14,14 @@ class IncompatibilityCause(Exception):
class RootCause(IncompatibilityCause): class RootCause(IncompatibilityCause):
pass pass
class NoVersionsCause(IncompatibilityCause): class NoVersionsCause(IncompatibilityCause):
pass pass
class DependencyCause(IncompatibilityCause): class DependencyCause(IncompatibilityCause):
pass pass
......
...@@ -50,7 +50,6 @@ logger = logging.getLogger(__name__) ...@@ -50,7 +50,6 @@ logger = logging.getLogger(__name__)
class Locker: class Locker:
_VERSION = "1.1" _VERSION = "1.1"
_legacy_keys = ["dependencies", "source", "extras", "dev-dependencies"] _legacy_keys = ["dependencies", "source", "extras", "dev-dependencies"]
...@@ -180,7 +179,6 @@ class Locker: ...@@ -180,7 +179,6 @@ class Locker:
package.marker = parse_marker(split_dep[1].strip()) package.marker = parse_marker(split_dep[1].strip())
for dep_name, constraint in info.get("dependencies", {}).items(): for dep_name, constraint in info.get("dependencies", {}).items():
root_dir = self._lock.path.parent root_dir = self._lock.path.parent
if package.source_type == "directory": if package.source_type == "directory":
# root dir should be the source of the package relative to the lock # root dir should be the source of the package relative to the lock
......
...@@ -21,7 +21,6 @@ if TYPE_CHECKING: ...@@ -21,7 +21,6 @@ if TYPE_CHECKING:
class Poetry(BasePoetry): class Poetry(BasePoetry):
VERSION = __version__ VERSION = __version__
def __init__( def __init__(
......
...@@ -119,7 +119,6 @@ def _get_package_from_git( ...@@ -119,7 +119,6 @@ def _get_package_from_git(
class Provider: class Provider:
UNSAFE_PACKAGES: set[str] = set() UNSAFE_PACKAGES: set[str] = set()
def __init__( def __init__(
......
...@@ -96,7 +96,6 @@ class Solver: ...@@ -96,7 +96,6 @@ class Solver:
overrides: tuple[dict[DependencyPackage, dict[str, Dependency]], ...], overrides: tuple[dict[DependencyPackage, dict[str, Dependency]], ...],
use_latest: list[str] | None = None, use_latest: list[str] | None = None,
) -> tuple[list[Package], list[int]]: ) -> tuple[list[Package], list[int]]:
packages = [] packages = []
depths = [] depths = []
for override in overrides: for override in overrides:
......
...@@ -2,10 +2,8 @@ from __future__ import annotations ...@@ -2,10 +2,8 @@ from __future__ import annotations
class RepositoryError(Exception): class RepositoryError(Exception):
pass pass
class PackageNotFound(Exception): class PackageNotFound(Exception):
pass pass
...@@ -456,7 +456,6 @@ class SitePackages: ...@@ -456,7 +456,6 @@ class SitePackages:
class EnvError(Exception): class EnvError(Exception):
pass pass
......
...@@ -14,12 +14,10 @@ logger = logging.getLogger(__name__) ...@@ -14,12 +14,10 @@ logger = logging.getLogger(__name__)
class PasswordManagerError(Exception): class PasswordManagerError(Exception):
pass pass
class PoetryKeyringError(Exception): class PoetryKeyringError(Exception):
pass pass
......
...@@ -102,7 +102,6 @@ def entry_points( ...@@ -102,7 +102,6 @@ def entry_points(
entry_point_values_by_group: dict[str, list[str]], entry_point_values_by_group: dict[str, list[str]],
plugin_distro: metadata.Distribution, plugin_distro: metadata.Distribution,
) -> Callable[[...], list[metadata.EntryPoint]]: ) -> Callable[[...], list[metadata.EntryPoint]]:
by_group = { by_group = {
key: [ key: [
EntryPoint(name=entry_point_name, group=key, value=value)._for( EntryPoint(name=entry_point_name, group=key, value=value)._for(
......
...@@ -114,7 +114,6 @@ def test_publish_dry_run_skip_existing( ...@@ -114,7 +114,6 @@ def test_publish_dry_run_skip_existing(
def test_skip_existing_output( def test_skip_existing_output(
app_tester: ApplicationTester, http: type[httpretty.httpretty] app_tester: ApplicationTester, http: type[httpretty.httpretty]
): ):
http.register_uri( http.register_uri(
http.POST, "https://upload.pypi.org/legacy/", status=409, body="Conflict" http.POST, "https://upload.pypi.org/legacy/", status=409, body="Conflict"
) )
......
...@@ -38,7 +38,6 @@ def _use_simple_keyring(with_simple_keyring: None) -> None: ...@@ -38,7 +38,6 @@ def _use_simple_keyring(with_simple_keyring: None) -> None:
class MockRepository(LegacyRepository): class MockRepository(LegacyRepository):
FIXTURES = Path(__file__).parent / "fixtures" / "legacy" FIXTURES = Path(__file__).parent / "fixtures" / "legacy"
def __init__(self) -> None: def __init__(self) -> None:
......
...@@ -28,7 +28,6 @@ def _use_simple_keyring(with_simple_keyring: None) -> None: ...@@ -28,7 +28,6 @@ def _use_simple_keyring(with_simple_keyring: None) -> None:
class MockRepository(PyPiRepository): class MockRepository(PyPiRepository):
JSON_FIXTURES = Path(__file__).parent / "fixtures" / "pypi.org" / "json" JSON_FIXTURES = Path(__file__).parent / "fixtures" / "pypi.org" / "json"
DIST_FIXTURES = Path(__file__).parent / "fixtures" / "pypi.org" / "dists" DIST_FIXTURES = Path(__file__).parent / "fixtures" / "pypi.org" / "dists"
......
...@@ -11,7 +11,6 @@ from poetry.repositories.single_page_repository import SinglePageRepository ...@@ -11,7 +11,6 @@ from poetry.repositories.single_page_repository import SinglePageRepository
class MockSinglePageRepository(SinglePageRepository): class MockSinglePageRepository(SinglePageRepository):
FIXTURES = Path(__file__).parent / "fixtures" / "single-page" FIXTURES = Path(__file__).parent / "fixtures" / "single-page"
def __init__(self, page: str) -> None: def __init__(self, page: str) -> None:
......
...@@ -112,7 +112,6 @@ def test_authenticator_uses_empty_strings_as_default_password( ...@@ -112,7 +112,6 @@ def test_authenticator_uses_empty_strings_as_default_password(
http: type[httpretty.httpretty], http: type[httpretty.httpretty],
with_simple_keyring: None, with_simple_keyring: None,
): ):
config.merge( config.merge(
{ {
"repositories": repo, "repositories": repo,
......
...@@ -771,7 +771,6 @@ def test_run_with_input(tmp_dir: str, tmp_venv: VirtualEnv): ...@@ -771,7 +771,6 @@ def test_run_with_input(tmp_dir: str, tmp_venv: VirtualEnv):
def test_run_with_input_non_zero_return(tmp_dir: str, tmp_venv: VirtualEnv): def test_run_with_input_non_zero_return(tmp_dir: str, tmp_venv: VirtualEnv):
with pytest.raises(EnvCommandError) as process_error: with pytest.raises(EnvCommandError) as process_error:
# Test command that will return non-zero returncode. # Test command that will return non-zero returncode.
tmp_venv.run("python", "-", input_=ERRORING_SCRIPT) tmp_venv.run("python", "-", input_=ERRORING_SCRIPT)
......
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