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