Commit 7b40c844 by pre-commit-ci[bot] Committed by GitHub

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

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
parent 6e84663d
...@@ -3,7 +3,7 @@ ci: ...@@ -3,7 +3,7 @@ ci:
repos: repos:
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0 rev: v4.4.0
hooks: hooks:
- id: trailing-whitespace - id: trailing-whitespace
- id: end-of-file-fixer - id: end-of-file-fixer
...@@ -47,7 +47,7 @@ repos: ...@@ -47,7 +47,7 @@ repos:
- flake8-pie==0.16.0 - flake8-pie==0.16.0
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v3.2.2 rev: v3.3.1
hooks: hooks:
- id: pyupgrade - id: pyupgrade
args: [--py37-plus] args: [--py37-plus]
...@@ -60,7 +60,7 @@ repos: ...@@ -60,7 +60,7 @@ repos:
args: [--all] args: [--all]
- repo: https://github.com/pycqa/isort - repo: https://github.com/pycqa/isort
rev: 5.10.1 rev: 5.11.4
hooks: hooks:
- id: isort - id: isort
name: "isort (python)" name: "isort (python)"
...@@ -77,17 +77,18 @@ repos: ...@@ -77,17 +77,18 @@ 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.10.0 rev: 22.12.0
hooks: hooks:
- id: black - id: black
- repo: https://github.com/pycqa/flake8 - repo: https://github.com/pycqa/flake8
rev: 5.0.4 # freeze to commit rev to prevent automatic updates, since newer versions of flake8 are not compatible with plugins
rev: 6027577d325b0dd8bf1e465ebd29b71b5f0d005b
hooks: hooks:
- id: flake8 - id: flake8
additional_dependencies: *flake8_deps additional_dependencies: *flake8_deps
- repo: https://github.com/pre-commit/pre-commit - repo: https://github.com/pre-commit/pre-commit
rev: v2.20.0 rev: v2.21.0
hooks: hooks:
- id: validate_manifest - id: validate_manifest
...@@ -446,13 +446,16 @@ class Installer: ...@@ -446,13 +446,16 @@ class Installer:
print( print(
colorize( colorize(
"deprecation", "deprecation",
"This installer is deprecated, and scheduled for removal from the" (
" Poetry repository on or after January 1, 2023.\nSee" "This installer is deprecated, and scheduled for removal from the"
" https://github.com/python-poetry/poetry/issues/6377 for" " Poetry repository on or after January 1, 2023.\nSee"
" details.\n\nYou should migrate to https://install.python-poetry.org" " https://github.com/python-poetry/poetry/issues/6377 for"
" instead, which supports all versions of Poetry, and allows for `self" " details.\n\nYou should migrate to"
" update` of versions 1.1.7 or newer.\nInstructions are available at" " https://install.python-poetry.org instead, which supports all"
" https://python-poetry.org/docs/#installation.\n", " versions of Poetry, and allows for `self update` of versions"
" 1.1.7 or newer.\nInstructions are available at"
" https://python-poetry.org/docs/#installation.\n"
),
) )
) )
...@@ -460,14 +463,17 @@ class Installer: ...@@ -460,14 +463,17 @@ class Installer:
print( print(
colorize( colorize(
"deprecation", "deprecation",
"Without an explicit version, this installer will attempt to" (
" install the latest version of Poetry.\nThis installer cannot" "Without an explicit version, this installer will attempt to"
" install Poetry 1.2.0a1 or newer (and installs will be unable to" " install the latest version of Poetry.\nThis installer cannot"
" `self update` to 1.2.0a1 or newer).\n\nTo continue to use this" " install Poetry 1.2.0a1 or newer (and installs will be unable"
" deprecated installer, you must specify an explicit version with" " to `self update` to 1.2.0a1 or newer).\n\nTo continue to use"
" --version <version> or POETRY_VERSION=<version>.\nAlternatively," " this deprecated installer, you must specify an explicit"
" if you wish to force this deprecated installer to use the latest" " version with --version <version> or"
" installable release, set GET_POETRY_IGNORE_DEPRECATION=1.\n", " POETRY_VERSION=<version>.\nAlternatively, if you wish to"
" force this deprecated installer to use the latest installable"
" release, set GET_POETRY_IGNORE_DEPRECATION=1.\n"
),
) )
) )
...@@ -817,8 +823,10 @@ class Installer: ...@@ -817,8 +823,10 @@ class Installer:
print( print(
colorize( colorize(
"warning", "warning",
"\nUnable to get the PATH value. It will not be updated" (
" automatically.", "\nUnable to get the PATH value. It will not be updated"
" automatically."
),
) )
) )
self._modify_path = False self._modify_path = False
...@@ -853,8 +861,10 @@ class Installer: ...@@ -853,8 +861,10 @@ class Installer:
print( print(
colorize( colorize(
"warning", "warning",
"Unable to get the PATH value. It will not be updated" (
" automatically", "Unable to get the PATH value. It will not be updated"
" automatically"
),
) )
) )
self._modify_path = False self._modify_path = False
......
...@@ -493,9 +493,11 @@ class Installer: ...@@ -493,9 +493,11 @@ class Installer:
self._write( self._write(
colorize( colorize(
"warning", "warning",
f"You are installing {version}. When using the current installer," (
" this version does not support updating using the 'self update'" f"You are installing {version}. When using the current"
" command. Please use 1.1.7 or later.", " installer, this version does not support updating using the"
" 'self update' command. Please use 1.1.7 or later."
),
) )
) )
if not self._accept_all: if not self._accept_all:
...@@ -900,9 +902,11 @@ if __name__ == "__main__": ...@@ -900,9 +902,11 @@ if __name__ == "__main__":
sys.stdout.write( sys.stdout.write(
colorize( colorize(
"warning", "warning",
"The canonical source for Poetry's installation script is now" (
" https://install.python-poetry.org. Please update your usage to reflect" "The canonical source for Poetry's installation script is now"
" this.\n", " https://install.python-poetry.org. Please update your usage to"
" reflect this.\n"
),
) )
) )
sys.exit(main()) sys.exit(main())
...@@ -63,8 +63,10 @@ class AddCommand(InstallerCommand, InitCommand): ...@@ -63,8 +63,10 @@ class AddCommand(InstallerCommand, InitCommand):
option( option(
"dry-run", "dry-run",
None, None,
"Output the operations but do not execute anything (implicitly enables" (
" --verbose).", "Output the operations but do not execute anything (implicitly enables"
" --verbose)."
),
), ),
option("lock", None, "Do not perform operations (only update the lockfile)."), option("lock", None, "Do not perform operations (only update the lockfile)."),
] ]
......
...@@ -13,8 +13,10 @@ class EnvRemoveCommand(Command): ...@@ -13,8 +13,10 @@ class EnvRemoveCommand(Command):
arguments = [ arguments = [
argument( argument(
"python", "python",
"The python executables associated with, or names of the virtual" (
" environments which are to be removed.", "The python executables associated with, or names of the virtual"
" environments which are to be removed."
),
optional=True, optional=True,
multiple=True, multiple=True,
) )
......
...@@ -42,16 +42,20 @@ class InitCommand(Command): ...@@ -42,16 +42,20 @@ class InitCommand(Command):
option( option(
"dependency", "dependency",
None, None,
"Package to require, with an optional version constraint, " (
"e.g. requests:^2.10.0 or requests=2.11.1.", "Package to require, with an optional version constraint, "
"e.g. requests:^2.10.0 or requests=2.11.1."
),
flag=False, flag=False,
multiple=True, multiple=True,
), ),
option( option(
"dev-dependency", "dev-dependency",
None, None,
"Package to require for development, with an optional version constraint, " (
"e.g. requests:^2.10.0 or requests=2.11.1.", "Package to require for development, with an optional version"
" constraint, e.g. requests:^2.10.0 or requests=2.11.1."
),
flag=False, flag=False,
multiple=True, multiple=True,
), ),
...@@ -318,8 +322,10 @@ You can specify a package in the following forms: ...@@ -318,8 +322,10 @@ You can specify a package in the following forms:
choices.append("") choices.append("")
package = self.choice( package = self.choice(
"\nEnter package # to add, or the complete package name if it" (
" is not listed", "\nEnter package # to add, or the complete package name if"
" it is not listed"
),
choices, choices,
attempts=3, attempts=3,
default=len(choices) - 1, default=len(choices) - 1,
......
...@@ -14,14 +14,18 @@ class InstallCommand(InstallerCommand): ...@@ -14,14 +14,18 @@ class InstallCommand(InstallerCommand):
option( option(
"no-dev", "no-dev",
None, None,
"Do not install the development dependencies." (
" (<warning>Deprecated</warning>)", "Do not install the development dependencies."
" (<warning>Deprecated</warning>)"
),
), ),
option( option(
"sync", "sync",
None, None,
"Synchronize the environment with the locked packages and the specified" (
" groups.", "Synchronize the environment with the locked packages and the specified"
" groups."
),
), ),
option( option(
"no-root", None, "Do not install the root package (the current project)." "no-root", None, "Do not install the root package (the current project)."
...@@ -29,14 +33,18 @@ class InstallCommand(InstallerCommand): ...@@ -29,14 +33,18 @@ class InstallCommand(InstallerCommand):
option( option(
"dry-run", "dry-run",
None, None,
"Output the operations but do not execute anything " (
"(implicitly enables --verbose).", "Output the operations but do not execute anything "
"(implicitly enables --verbose)."
),
), ),
option( option(
"remove-untracked", "remove-untracked",
None, None,
"Removes packages not present in the lock file." (
" (<warning>Deprecated</warning>)", "Removes packages not present in the lock file."
" (<warning>Deprecated</warning>)"
),
), ),
option( option(
"extras", "extras",
......
...@@ -16,8 +16,10 @@ class LockCommand(InstallerCommand): ...@@ -16,8 +16,10 @@ class LockCommand(InstallerCommand):
option( option(
"check", "check",
None, None,
"Check that the <comment>poetry.lock</> file corresponds to the current" (
" version of <comment>pyproject.toml</>.", "Check that the <comment>poetry.lock</> file corresponds to the current"
" version of <comment>pyproject.toml</>."
),
), ),
] ]
......
...@@ -21,14 +21,18 @@ class RemoveCommand(InstallerCommand): ...@@ -21,14 +21,18 @@ class RemoveCommand(InstallerCommand):
option( option(
"dev", "dev",
"D", "D",
"Remove a package from the development dependencies." (
" (<warning>Deprecated</warning>)", "Remove a package from the development dependencies."
" (<warning>Deprecated</warning>)"
),
), ),
option( option(
"dry-run", "dry-run",
None, None,
"Output the operations but do not execute anything " (
"(implicitly enables --verbose).", "Output the operations but do not execute anything "
"(implicitly enables --verbose)."
),
), ),
] ]
......
...@@ -23,8 +23,10 @@ class SelfUpdateCommand(SelfCommand): ...@@ -23,8 +23,10 @@ class SelfUpdateCommand(SelfCommand):
option( option(
"dry-run", "dry-run",
None, None,
"Output the operations but do not execute anything " (
"(implicitly enables --verbose).", "Output the operations but do not execute anything "
"(implicitly enables --verbose)."
),
), ),
] ]
help = """\ help = """\
......
...@@ -48,8 +48,10 @@ class ShowCommand(GroupCommand, EnvCommand): ...@@ -48,8 +48,10 @@ class ShowCommand(GroupCommand, EnvCommand):
option( option(
"why", "why",
None, None,
"When showing the full list, or a <info>--tree</info> for a single package," (
" also display why it's included.", "When showing the full list, or a <info>--tree</info> for a single"
" package, also display why it's included."
),
), ),
option("latest", "l", "Show the latest version."), option("latest", "l", "Show the latest version."),
option( option(
......
...@@ -25,9 +25,11 @@ class SourceAddCommand(Command): ...@@ -25,9 +25,11 @@ class SourceAddCommand(Command):
option( option(
"default", "default",
"d", "d",
"Set this source as the default (disable PyPI). A " (
"default source will also be the fallback source if " "Set this source as the default (disable PyPI). A "
"you add other sources.", "default source will also be the fallback source if "
"you add other sources."
),
), ),
option("secondary", "s", "Set this source as secondary."), option("secondary", "s", "Set this source as secondary."),
] ]
......
...@@ -20,14 +20,18 @@ class UpdateCommand(InstallerCommand): ...@@ -20,14 +20,18 @@ class UpdateCommand(InstallerCommand):
option( option(
"no-dev", "no-dev",
None, None,
"Do not update the development dependencies." (
" (<warning>Deprecated</warning>)", "Do not update the development dependencies."
" (<warning>Deprecated</warning>)"
),
), ),
option( option(
"dry-run", "dry-run",
None, None,
"Output the operations but do not execute anything " (
"(implicitly enables --verbose).", "Output the operations but do not execute anything "
"(implicitly enables --verbose)."
),
), ),
option("lock", None, "Do not perform operations (only update the lockfile)."), option("lock", None, "Do not perform operations (only update the lockfile)."),
] ]
......
...@@ -80,8 +80,10 @@ class Chooser: ...@@ -80,8 +80,10 @@ class Chooser:
if link.is_wheel: if link.is_wheel:
if not self._no_binary_policy.allows(package.name): if not self._no_binary_policy.allows(package.name):
logger.debug( logger.debug(
"Skipping wheel for %s as requested in no binary policy for" (
" package (%s)", "Skipping wheel for %s as requested in no binary policy for"
" package (%s)"
),
link.filename, link.filename,
package.name, package.name,
) )
...@@ -89,8 +91,10 @@ class Chooser: ...@@ -89,8 +91,10 @@ class Chooser:
if not Wheel(link.filename).is_supported_by_environment(self._env): if not Wheel(link.filename).is_supported_by_environment(self._env):
logger.debug( logger.debug(
"Skipping wheel %s as this is not supported by the current" (
" environment", "Skipping wheel %s as this is not supported by the current"
" environment"
),
link.filename, link.filename,
) )
continue continue
......
...@@ -318,10 +318,12 @@ class Executor: ...@@ -318,10 +318,12 @@ class Executor:
if self.supports_fancy_output(): if self.supports_fancy_output():
self._write( self._write(
operation, operation,
f" <fg=default;options=bold,dark>•</> {operation_message}: " (
"<fg=default;options=bold,dark>Skipped</> " f" <fg=default;options=bold,dark>•</> {operation_message}: "
"<fg=default;options=dark>for the following reason:</> " "<fg=default;options=bold,dark>Skipped</> "
f"<fg=default;options=bold,dark>{operation.skip_reason}</>", "<fg=default;options=dark>for the following reason:</> "
f"<fg=default;options=bold,dark>{operation.skip_reason}</>"
),
) )
self._skipped[operation.job_type] += 1 self._skipped[operation.job_type] += 1
......
...@@ -33,9 +33,11 @@ if sys.platform == "darwin": ...@@ -33,9 +33,11 @@ if sys.platform == "darwin":
if any(file.exists() for file in (auth_toml, config_toml)): if any(file.exists() for file in (auth_toml, config_toml)):
logger.warning( logger.warning(
"Configuration file exists at %s, reusing this directory.\n\nConsider" (
" moving configuration to %s, as support for the legacy directory will be" "Configuration file exists at %s, reusing this directory.\n\nConsider"
" removed in an upcoming release.", " moving configuration to %s, as support for the legacy directory will"
" be removed in an upcoming release."
),
_LEGACY_CONFIG_DIR, _LEGACY_CONFIG_DIR,
CONFIG_DIR, CONFIG_DIR,
) )
......
...@@ -144,8 +144,10 @@ class _Writer: ...@@ -144,8 +144,10 @@ class _Writer:
self._visit(without_line) self._visit(without_line)
self._write( self._write(
incompatibility, incompatibility,
f"{conjunction} because {with_line!s} ({line})," (
f" {incompatibility_string}.", f"{conjunction} because {with_line!s} ({line}),"
f" {incompatibility_string}."
),
numbered=numbered, numbered=numbered,
) )
else: else:
...@@ -170,9 +172,11 @@ class _Writer: ...@@ -170,9 +172,11 @@ class _Writer:
self._write( self._write(
incompatibility, incompatibility,
f"{conjunction} because" (
f" {cause.conflict!s} ({self._line_numbers[cause.conflict]})," f"{conjunction} because {cause.conflict!s}"
f" {incompatibility_string}", f" ({self._line_numbers[cause.conflict]}),"
f" {incompatibility_string}"
),
numbered=numbered, numbered=numbered,
) )
elif isinstance(cause.conflict.cause, ConflictCause) or isinstance( elif isinstance(cause.conflict.cause, ConflictCause) or isinstance(
......
...@@ -19,8 +19,10 @@ class PythonRequirementSolutionProvider(HasSolutionsForException): ...@@ -19,8 +19,10 @@ class PythonRequirementSolutionProvider(HasSolutionsForException):
return False return False
m = re.match( m = re.match(
"^The current project's Python requirement (.+) is not compatible " (
"with some of the required packages Python requirement", "^The current project's Python requirement (.+) is not compatible "
"with some of the required packages Python requirement"
),
str(exception), str(exception),
) )
......
...@@ -8,8 +8,11 @@ from poetry.repositories.cached_repository import ( # isort: skip # nopycln: im ...@@ -8,8 +8,11 @@ from poetry.repositories.cached_repository import ( # isort: skip # nopycln: im
) )
warnings.warn( warnings.warn(
"Module poetry.repositories.cached is renamed and scheduled for removal in poetry" (
" release 1.4.0. Please migrate to poetry.repositories.cached_repository.", "Module poetry.repositories.cached is renamed and scheduled for removal in"
" poetry release 1.4.0. Please migrate to"
" poetry.repositories.cached_repository."
),
DeprecationWarning, DeprecationWarning,
stacklevel=2, stacklevel=2,
) )
...@@ -8,8 +8,10 @@ from poetry.repositories.http_repository import ( # isort: skip # nopycln: impo ...@@ -8,8 +8,10 @@ from poetry.repositories.http_repository import ( # isort: skip # nopycln: impo
) )
warnings.warn( warnings.warn(
"Module poetry.repositories.http is renamed and scheduled for removal in poetry" (
" release 1.4.0. Please migrate to poetry.repositories.http_repository.", "Module poetry.repositories.http is renamed and scheduled for removal in poetry"
" release 1.4.0. Please migrate to poetry.repositories.http_repository."
),
DeprecationWarning, DeprecationWarning,
stacklevel=2, stacklevel=2,
) )
...@@ -270,9 +270,11 @@ class InstalledRepository(Repository): ...@@ -270,9 +270,11 @@ class InstalledRepository(Repository):
name = canonicalize_name(distribution.metadata["name"]) name = canonicalize_name(distribution.metadata["name"])
except TypeError: except TypeError:
logger.warning( logger.warning(
"Project environment contains an invalid distribution" (
" (<c1>%s</>). Consider removing it manually or recreate the" "Project environment contains an invalid distribution"
" environment.", " (<c1>%s</>). Consider removing it manually or recreate"
" the environment."
),
path, path,
) )
skipped.add(path) skipped.add(path)
......
...@@ -18,9 +18,11 @@ class Pool(RepositoryPool): ...@@ -18,9 +18,11 @@ class Pool(RepositoryPool):
ignore_repository_names: bool = False, ignore_repository_names: bool = False,
) -> None: ) -> None:
warnings.warn( warnings.warn(
"Object Pool from poetry.repositories.pool is renamed and scheduled for" (
" removal in poetry release 1.4.0. Please migrate to RepositoryPool from" "Object Pool from poetry.repositories.pool is renamed and scheduled for"
" poetry.repositories.repository_pool.", " removal in poetry release 1.4.0. Please migrate to RepositoryPool"
" from poetry.repositories.repository_pool."
),
DeprecationWarning, DeprecationWarning,
stacklevel=2, stacklevel=2,
) )
......
...@@ -86,8 +86,10 @@ class PyPiRepository(HTTPRepository): ...@@ -86,8 +86,10 @@ class PyPiRepository(HTTPRepository):
results.append(package) results.append(package)
except InvalidVersion: except InvalidVersion:
self._log( self._log(
f'Unable to parse version "{version}" for the {name} package,' (
" skipping", f'Unable to parse version "{version}" for the {name} package,'
" skipping"
),
level="debug", level="debug",
) )
......
...@@ -541,8 +541,10 @@ class EnvManager: ...@@ -541,8 +541,10 @@ class EnvManager:
try: try:
self._io.write_error_line( self._io.write_error_line(
"Trying to detect current active python executable as specified in the" (
" config.", "Trying to detect current active python executable as specified in"
" the config."
),
verbosity=Verbosity.VERBOSE, verbosity=Verbosity.VERBOSE,
) )
executable = self._full_python_path("python") executable = self._full_python_path("python")
...@@ -551,8 +553,10 @@ class EnvManager: ...@@ -551,8 +553,10 @@ class EnvManager:
) )
except CalledProcessError: except CalledProcessError:
self._io.write_error_line( self._io.write_error_line(
"Unable to detect the current active python executable. Falling back to" (
" default.", "Unable to detect the current active python executable. Falling"
" back to default."
),
verbosity=Verbosity.VERBOSE, verbosity=Verbosity.VERBOSE,
) )
return executable return executable
......
...@@ -295,8 +295,10 @@ class Git: ...@@ -295,8 +295,10 @@ class Git:
if isinstance(e, KeyError): if isinstance(e, KeyError):
# the local copy is at a bad state, lets remove it # the local copy is at a bad state, lets remove it
logger.debug( logger.debug(
"Removing local clone (<c1>%s</>) of repository as it is in a" (
" broken state.", "Removing local clone (<c1>%s</>) of repository as it is in a"
" broken state."
),
local.path, local.path,
) )
remove_directory(local.path, force=True) remove_directory(local.path, force=True)
...@@ -305,8 +307,11 @@ class Git: ...@@ -305,8 +307,11 @@ class Git:
raise raise
logger.debug( logger.debug(
"\nRequested ref (<c2>%s</c2>) was not fetched to local copy and cannot" (
" be used. The following error was raised:\n\n\t<warning>%s</>", "\nRequested ref (<c2>%s</c2>) was not fetched to local copy and"
" cannot be used. The following error was"
" raised:\n\n\t<warning>%s</>"
),
refspec.key, refspec.key,
e, e,
) )
...@@ -433,8 +438,10 @@ class Git: ...@@ -433,8 +438,10 @@ class Git:
# without additional configuration or changes for existing projects that # without additional configuration or changes for existing projects that
# use http basic auth credentials. # use http basic auth credentials.
logger.debug( logger.debug(
"Unable to fetch from private repository '%s', falling back to" (
" system git", "Unable to fetch from private repository '%s', falling back to"
" system git"
),
url, url,
) )
......
...@@ -844,13 +844,15 @@ def test_predefined_all_options(tester: CommandTester, repo: TestRepository): ...@@ -844,13 +844,15 @@ def test_predefined_all_options(tester: CommandTester, repo: TestRepository):
] ]
tester.execute( tester.execute(
"--name my-package " (
"--description 'This is a description' " "--name my-package "
"--author 'Foo Bar <foo@example.com>' " "--description 'This is a description' "
"--python '^3.8' " "--author 'Foo Bar <foo@example.com>' "
"--license MIT " "--python '^3.8' "
"--dependency pendulum " "--license MIT "
"--dev-dependency pytest", "--dependency pendulum "
"--dev-dependency pytest"
),
inputs="\n".join(inputs), inputs="\n".join(inputs),
) )
...@@ -941,10 +943,12 @@ line-length = 88 ...@@ -941,10 +943,12 @@ line-length = 88
repo.add_package(get_package("foo", "1.19.2")) repo.add_package(get_package("foo", "1.19.2"))
tester.execute( tester.execute(
"--author 'Your Name <you@example.com>' " (
"--name 'my-package' " "--author 'Your Name <you@example.com>' "
"--python '^3.6' " "--name 'my-package' "
"--dependency foo", "--python '^3.6' "
"--dependency foo"
),
interactive=False, interactive=False,
) )
......
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