Repository: python-poetry/poetry
Pull request: Wrap long lines to comply with flake8 E501
Resolves: #4776

Hi! This is my first PR for `poetry`; please let me know how I can improve my work.

Because of the nature of the issue being fixed (linting rules), this PR touches a lot of files. There are no functional changes, however, so I figured it would be OK for a single PR. Let me know if you would like me to break it up into smaller PRs (an option would be `tests` first, then `src`, for example).

# Changes
**_(updated 2020-01-08)_**

* Updated `.flake8` to remove the `E501` error (line too long) from the list of ignored warnings.
* ~Added `poetry` to `isort` namespace packages - see discussion below for the reason why.~
* Explicitly ignored the `E501` error for some long test function names and the occasional URL/path/hash.
* Apply `black --experimental-string-processing` to handle long strings. Added this functionality to `pre-commit`.
* Manually wrap some strings that `black` did not format (notably strings without spaces).
* Manually wrap multi-line strings.
* Manually wrap some docstrings and in-line comments.
* Fixed a typo in `src/poetry/console/commands/source/add.py`: "already exits" -> "already exists"
* Fixed a few more rare typos in docs/comments.

# String wrapping approach
**_(updated 2020-01-07)_**

I try to be consistent with the formatting guidelines of `black`, and the style of the rest of the code base.

For long regular strings that are not handled by `black`, I wrap them using implicit string concatenation, with **leading** space and if it's an f-string, an 'f' only at the lines where it's required:

```python
# Original
long_string = f"This string is way too long for a code base with a maximum character limit of {88}."

# Wrapped
long_string = (
    "This string is way too long for a code base"
    f" with a maximum character limit of {88}."
)
```

For multi-line strings, I use backslash breaks with **leading** space:
```python
# Original
long_string = """\
This string is way too long for a code base with a maximum character limit of 88.
"""

# Wrapped
long_string = """\
This string is way too long for a code base\
 with a maximum character limit of 88.
"""
```


Problem statement:
Code Quality: Additional lints in this repository (help wanted!)
We're doing a bunch of code quality cleanup, and as part of that effort I'd like to implement some additional lints/coding conventions. There will be a lot of manual changes here, so I think these will be some items to have multiple people tackle. 

In no particular order:

- ~Add `ban-relative-imports = true` to `.flake8` and remove relative imports from the repo.~
- ~Add `flake8-type-checking==1.0.4` to `.pre-commit-config.yaml` with `enable-extensions = TC, TC2` in `.flake8`, and rework our type annotations for zero runtime cost using string constants. When we drop Python 3.6 support, pyupgrade will be used to automatically switch to `from __future__ import annotations` and unquote the annotations.~
- ~Add `flake8-use-fstring==1.3` to `.pre-commit-config.yaml` and fix all the use of `.format()` on string constants in the repo. Start at level 0, and try level 1 if possible. Level 2 is likely useless in this repo (I think we will always use `.format()` on string variables), but you could prove me wrong.~
- ~Remove `E501` from `.flake8` -- currently, black leaves our long comments, docstrings, and string constants alone -- let's hand-format them to comply with the line length limit.~

Please call dibs in this issue to prevent duplicated effort.

(suggestions for additional code quality improvements/tools to enforce them are also welcomed here)

Hints from issue discussion:
This comment tracks the implementation status of new lints:

* [x] `ban-relative-imports = true` @ #4782 by @branchvincent 
* [x] `flake8-annotations` @ #4775, #4801, #4805 by @finswimmer 
* [x] `pep8-naming` @ #4778 by @danieleades 
* [x] `flake8-use-fstring` @ #4794 by @branchvincent 
* [x] `flake8-type-checking` @ #4787 by @radoering 
* [x] `flake8-simplify` @ #4798 by @radoering 
* [x] `flake8-eradicate` @ #4806 by @radoering 
> * Add `ban-relative-imports = true` to `.flake8` and remove relative imports from the repo.

happy to take this one!
i'll take `pep8-naming`

see #4778 
Taking the occasion, I'd like to discuss the following, in the hope of be handled as part of this effort:

`poetry-schema.json`: I noticed that both projects ([poetry](https://github.com/python-poetry/poetry/blob/master/src/poetry/json/schemas/poetry-schema.json) and [poetry-core](https://github.com/python-poetry/poetry-core/blob/master/poetry/core/json/schemas/poetry-schema.json)) carry a schema file. Is that really required? I guess we could have only one file in **poetry-core** and be consumed by **poetry** when/if required.
@wagnerluis1982 I have moved that to https://github.com/python-poetry/poetry/discussions/4780
> * Add `flake8-use-fstring==1.3`

I'll take this one as well


Added `flake8-use-fstring` to `poetry-core`. Before adding here, we prob want to merge #4758?
Are any of these plugins redundant? For example, does it make sense to use both `pyupgrade` *and* `use-f-strings`?
> 
> 
> Are any of these plugins redundant? For example, does it make sense to use both `pyupgrade` _and_ `use-f-strings`?

`pyupgrade` does not enforce f-strings exactly -- it's only clever enough to do maybe 40% of the job (check out my PR). As far as the ones I have not researched/trialed in detail, they could be -- we'll have to discuss that on the individual PRs (or someone can do some research into actual usefulness and post here if they want to, I suppose).

Commit message: Manual line wrapping for install scripts

Patch to review:
diff --git a/.flake8 b/.flake8
index 4a6c7199262..15b489dd632 100644
--- a/.flake8
+++ b/.flake8
@@ -12,8 +12,6 @@ enable-extensions = TC, TC2
 type-checking-exempt-modules = typing, typing-extensions
 eradicate-whitelist-extend = ^-.*;
 extend-ignore =
-    # E501: Line too long (FIXME: long string constants)
-    E501,
     # E203: Whitespace before ':' (pycqa/pycodestyle#373)
     E203,
     # SIM106: Handle error-cases first
diff --git a/get-poetry.py b/get-poetry.py
index a7d8e01b3ac..f7450f778f0 100644
--- a/get-poetry.py
+++ b/get-poetry.py
@@ -458,11 +458,11 @@ def _is_supported(x):
             print(
                 colorize(
                     "error",
-                    "Version {version} does not support this installation method. Please specify a version prior to "
-                    "1.2.0a1 explicitly using the '--version' option.\n"
-                    "Please see "
-                    "https://python-poetry.org/blog/announcing-poetry-1-2-0a1.html#deprecation-of-the-get-poetry-py-script "
-                    "for more information.".format(version=version),
+                    "Version {version} does not support this installation method."
+                    " Please specify a version prior to 1.2.0a1 explicitly using the"
+                    " '--version' option.\nPlease see"
+                    " https://python-poetry.org/blog/announcing-poetry-1-2-0a1.html#deprecation-of-the-get-poetry-py-script"
+                    " for more information.".format(version=version),
                 )
             )
             return None, None
@@ -470,9 +470,9 @@ def _is_supported(x):
         print(
             colorize(
                 "warning",
-                "This installer is deprecated. "
-                "Poetry versions installed using this script will not be able to use 'self update' command to upgrade to "
-                "1.2.0a1 or later.",
+                "This installer is deprecated. Poetry versions installed using this"
+                " script will not be able to use 'self update' command to upgrade to"
+                " 1.2.0a1 or later.",
             )
         )
 
@@ -685,7 +685,8 @@ def _which_python(self):
                 return executable
 
             if fallback is None:
-                # keep this one as the fallback; it was the first valid executable we found.
+                # keep this one as the fallback; it was the first valid executable we
+                # found.
                 fallback = executable
 
         if fallback is None:
@@ -773,7 +774,8 @@ def add_to_fish_path(self):
             print(
                 colorize(
                     "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
@@ -808,7 +810,8 @@ def add_to_windows_path(self):
             print(
                 colorize(
                     "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
@@ -1074,8 +1077,10 @@ def main():
         "--file",
         dest="file",
         action="store",
-        help="Install from a local file instead of fetching the latest version "
-        "of Poetry available online.",
+        help=(
+            "Install from a local file instead of fetching the latest version "
+            "of Poetry available online."
+        ),
     )
 
     args = parser.parse_args()
diff --git a/install-poetry.py b/install-poetry.py
index b1cb0388a45..a5e56fd1243 100644
--- a/install-poetry.py
+++ b/install-poetry.py
@@ -273,7 +273,8 @@ def __init__(self, return_code: int = 0, log: Optional[str] = None):
 class VirtualEnvironment:
     def __init__(self, path: Path) -> None:
         self._path = path
-        # str is required for compatibility with subprocess run on CPython <= 3.7 on Windows
+        # str is required for compatibility with subprocess run on CPython <= 3.7 on
+        # Windows
         self._python = str(
             self._path.joinpath("Scripts/python.exe" if WINDOWS else "bin/python")
         )
@@ -313,7 +314,8 @@ def make(cls, target: Path) -> "VirtualEnvironment":
 
         env = cls(target)
 
-        # we do this here to ensure that outdated system default pip does not trigger older bugs
+        # we do this here to ensure that outdated system default pip does not trigger
+        # older bugs
         env.pip("install", "--disable-pip-version-check", "--upgrade", "pip")
 
         return env
@@ -480,7 +482,8 @@ def _is_self_upgrade_supported(x):
             mx = self.VERSION_REGEX.match(x)
 
             if mx is None:
-                # the version is not semver, perhaps scm or file, we assume upgrade is supported
+                # the version is not semver, perhaps scm or file, we assume upgrade is
+                # supported
                 return True
 
             vx = tuple(int(p) for p in mx.groups()[:3]) + (mx.group(5),)
@@ -490,8 +493,9 @@ def _is_self_upgrade_supported(x):
             self._write(
                 colorize(
                     "warning",
-                    f"You are installing {version}. When using the current installer, this version does not support "
-                    f"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:
@@ -883,7 +887,10 @@ def main():
                 text=True,
             )
             installer._write(colorize("error", f"See {path} for error logs."))
-            text = f"{e.log}\nTraceback:\n\n{''.join(traceback.format_tb(e.__traceback__))}"
+            text = (
+                f"{e.log}\n"
+                f"Traceback:\n\n{''.join(traceback.format_tb(e.__traceback__))}"
+            )
             Path(path).write_text(text)
 
         return e.return_code
@@ -893,8 +900,9 @@ def 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",
+            "The canonical source for Poetry's installation script is now"
+            " https://install.python-poetry.org. Please update your usage to reflect"
+            " this.\n",
         )
     )
     sys.exit(main())
diff --git a/pyproject.toml b/pyproject.toml
index 0dc64b4877c..c1e05413f6b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -89,6 +89,7 @@ extend_skip = ["setup.py"]
 
 [tool.black]
 target-version = ['py36']
+experimental_string_processing = true
 force-exclude = '''
 .*/setup\.py$
 '''
diff --git a/src/poetry/__init__.py b/src/poetry/__init__.py
index 2e50d9cce89..a6aa520a38b 100644
--- a/src/poetry/__init__.py
+++ b/src/poetry/__init__.py
@@ -1 +1 @@
-__path__ = __import__("pkgutil").extend_path(__path__, __name__)  # type: ignore[has-type]
+__path__ = __import__("pkgutil").extend_path(__path__, __name__)  # type: ignore[has-type]  # noqa: E501
diff --git a/src/poetry/console/application.py b/src/poetry/console/application.py
index 158b7bed604..a74a68b0ff1 100644
--- a/src/poetry/console/application.py
+++ b/src/poetry/console/application.py
@@ -353,7 +353,7 @@ def _get_solution_provider_repository(self) -> "SolutionProviderRepository":
             SolutionProviderRepository,
         )
 
-        from poetry.mixology.solutions.providers.python_requirement_solution_provider import (
+        from poetry.mixology.solutions.providers.python_requirement_solution_provider import (  # noqa: E501
             PythonRequirementSolutionProvider,
         )
 
diff --git a/src/poetry/console/commands/about.py b/src/poetry/console/commands/about.py
index 064c5b76586..18ef62a78af 100644
--- a/src/poetry/console/commands/about.py
+++ b/src/poetry/console/commands/about.py
@@ -9,8 +9,11 @@ class AboutCommand(Command):
 
     def handle(self) -> None:
         self.line(
-            """<info>Poetry - Package Management for Python</info>
+            """\
+<info>Poetry - Package Management for Python</info>
 
-<comment>Poetry is a dependency manager tracking local dependencies of your projects and libraries.
-See <fg=blue>https://github.com/python-poetry/poetry</> for more information.</comment>"""
+<comment>Poetry is a dependency manager tracking local dependencies of your projects\
+ and libraries.
+See <fg=blue>https://github.com/python-poetry/poetry</> for more information.</comment>\
+"""
         )
diff --git a/src/poetry/console/commands/add.py b/src/poetry/console/commands/add.py
index ad3c2386675..4c5f5c0a4e3 100644
--- a/src/poetry/console/commands/add.py
+++ b/src/poetry/console/commands/add.py
@@ -54,24 +54,31 @@ class AddCommand(InstallerCommand, InitCommand):
         option(
             "dry-run",
             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)."),
     ]
-    help = (
-        "The add command adds required packages to your <comment>pyproject.toml</> and installs them.\n\n"
-        "If you do not specify a version constraint, poetry will choose a suitable one based on the available package versions.\n\n"
-        "You can specify a package in the following forms:\n"
-        "  - A single name (<b>requests</b>)\n"
-        "  - A name and a constraint (<b>requests@^2.23.0</b>)\n"
-        "  - A git url (<b>git+https://github.com/python-poetry/poetry.git</b>)\n"
-        "  - A git url with a revision (<b>git+https://github.com/python-poetry/poetry.git#develop</b>)\n"
-        "  - A git SSH url (<b>git+ssh://github.com/python-poetry/poetry.git</b>)\n"
-        "  - A git SSH url with a revision (<b>git+ssh://github.com/python-poetry/poetry.git#develop</b>)\n"
-        "  - A file path (<b>../my-package/my-package.whl</b>)\n"
-        "  - A directory (<b>../my-package/</b>)\n"
-        "  - A url (<b>https://example.com/packages/my-package-0.1.0.tar.gz</b>)\n"
-    )
+    help = """\
+The add command adds required packages to your <comment>pyproject.toml</> and installs\
+ them.
+
+If you do not specify a version constraint, poetry will choose a suitable one based on\
+ the available package versions.
+
+You can specify a package in the following forms:
+  - A single name (<b>requests</b>)
+  - A name and a constraint (<b>requests@^2.23.0</b>)
+  - A git url (<b>git+https://github.com/python-poetry/poetry.git</b>)
+  - A git url with a revision\
+ (<b>git+https://github.com/python-poetry/poetry.git#develop</b>)
+  - A git SSH url (<b>git+ssh://github.com/python-poetry/poetry.git</b>)
+  - A git SSH url with a revision\
+ (<b>git+ssh://github.com/python-poetry/poetry.git#develop</b>)
+  - A file path (<b>../my-package/my-package.whl</b>)
+  - A directory (<b>../my-package/</b>)
+  - A url (<b>https://example.com/packages/my-package-0.1.0.tar.gz</b>)
+"""
 
     loggers = ["poetry.repositories.pypi_repository", "poetry.inspection.info"]
 
@@ -244,11 +251,13 @@ def get_existing_packages_from_input(
 
     def notify_about_existing_packages(self, existing_packages: List[str]) -> None:
         self.line(
-            "The following packages are already present in the pyproject.toml and will be skipped:\n"
+            "The following packages are already present in the pyproject.toml and will"
+            " be skipped:\n"
         )
         for name in existing_packages:
             self.line(f"  • <c1>{name}</c1>")
         self.line(
-            "\nIf you want to update it to the latest compatible version, you can use `poetry update package`.\n"
-            "If you prefer to upgrade it to the latest available version, you can use `poetry add package@latest`.\n"
+            "\nIf you want to update it to the latest compatible version, you can use"
+            " `poetry update package`.\nIf you prefer to upgrade it to the latest"
+            " available version, you can use `poetry add package@latest`.\n"
         )
diff --git a/src/poetry/console/commands/cache/clear.py b/src/poetry/console/commands/cache/clear.py
index fe5f20d6a24..73f9a612f00 100644
--- a/src/poetry/console/commands/cache/clear.py
+++ b/src/poetry/console/commands/cache/clear.py
@@ -42,8 +42,7 @@ def handle(self) -> int:
         if len(parts) == 1:
             if not self.option("all"):
                 raise RuntimeError(
-                    "Add the --all option if you want to clear all "
-                    f"{parts[0]} caches"
+                    f"Add the --all option if you want to clear all {parts[0]} caches"
                 )
 
             if not os.path.exists(str(cache_dir)):
diff --git a/src/poetry/console/commands/env/info.py b/src/poetry/console/commands/env/info.py
index b3eaf2eb4ac..ce0e52064c5 100644
--- a/src/poetry/console/commands/env/info.py
+++ b/src/poetry/console/commands/env/info.py
@@ -40,12 +40,15 @@ def _display_complete_info(self, env: "Env") -> None:
         listing = [
             f"<info>Python</info>:         <comment>{env_python_version}</>",
             f"<info>Implementation</info>: <comment>{env.python_implementation}</>",
-            f"<info>Path</info>:           <comment>{env.path if env.is_venv() else 'NA'}</>",
-            f"<info>Executable</info>:     <comment>{env.python if env.is_venv() else 'NA'}</>",
+            "<info>Path</info>:          "
+            f" <comment>{env.path if env.is_venv() else 'NA'}</>",
+            "<info>Executable</info>:    "
+            f" <comment>{env.python if env.is_venv() else 'NA'}</>",
         ]
         if env.is_venv():
             listing.append(
-                f"<info>Valid</info>:          <{'comment' if env.is_sane() else 'error'}>{env.is_sane()}</>"
+                "<info>Valid</info>:         "
+                f" <{'comment' if env.is_sane() else 'error'}>{env.is_sane()}</>"
             )
         self.line("\n".join(listing))
 
diff --git a/src/poetry/console/commands/env/remove.py b/src/poetry/console/commands/env/remove.py
index c3c43d4d5d3..5f5dd3d4de1 100644
--- a/src/poetry/console/commands/env/remove.py
+++ b/src/poetry/console/commands/env/remove.py
@@ -12,8 +12,8 @@ class EnvRemoveCommand(Command):
     arguments = [
         argument(
             "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,
             multiple=True,
         )
@@ -21,8 +21,9 @@ class EnvRemoveCommand(Command):
     options = [
         option(
             "all",
-            description="Remove all managed virtual environments associated with the "
-            "project.",
+            description=(
+                "Remove all managed virtual environments associated with the project."
+            ),
         ),
     ]
 
diff --git a/src/poetry/console/commands/init.py b/src/poetry/console/commands/init.py
index 31e33577357..5d831c1914a 100644
--- a/src/poetry/console/commands/init.py
+++ b/src/poetry/console/commands/init.py
@@ -54,7 +54,8 @@ class InitCommand(Command):
     ]
 
     help = """\
-The <c1>init</c1> command creates a basic <comment>pyproject.toml</> file in the current directory.
+The <c1>init</c1> command creates a basic <comment>pyproject.toml</> file in the\
+ current directory.
 """
 
     def __init__(self) -> None:
@@ -76,13 +77,15 @@ def handle(self) -> int:
         if pyproject.file.exists():
             if pyproject.is_poetry_project():
                 self.line(
-                    "<error>A pyproject.toml file with a poetry section already exists.</error>"
+                    "<error>A pyproject.toml file with a poetry section already"
+                    " exists.</error>"
                 )
                 return 1
 
             if pyproject.data.get("build-system"):
                 self.line(
-                    "<error>A pyproject.toml file with a defined build-system already exists.</error>"
+                    "<error>A pyproject.toml file with a defined build-system already"
+                    " exists.</error>"
                 )
                 return 1
 
@@ -91,7 +94,8 @@ def handle(self) -> int:
         if self.io.is_interactive():
             self.line("")
             self.line(
-                "This command will guide you through creating your <info>pyproject.toml</> config."
+                "This command will guide you through creating your"
+                " <info>pyproject.toml</> config."
             )
             self.line("")
 
@@ -165,16 +169,18 @@ def handle(self) -> int:
             )
 
         question = "Would you like to define your main dependencies interactively?"
-        help_message = (
-            "You can specify a package in the following forms:\n"
-            "  - A single name (<b>requests</b>)\n"
-            "  - A name and a constraint (<b>requests@^2.23.0</b>)\n"
-            "  - A git url (<b>git+https://github.com/python-poetry/poetry.git</b>)\n"
-            "  - A git url with a revision (<b>git+https://github.com/python-poetry/poetry.git#develop</b>)\n"
-            "  - A file path (<b>../my-package/my-package.whl</b>)\n"
-            "  - A directory (<b>../my-package/</b>)\n"
-            "  - A url (<b>https://example.com/packages/my-package-0.1.0.tar.gz</b>)\n"
-        )
+        help_message = """\
+You can specify a package in the following forms:
+  - A single name (<b>requests</b>)
+  - A name and a constraint (<b>requests@^2.23.0</b>)
+  - A git url (<b>git+https://github.com/python-poetry/poetry.git</b>)
+  - A git url with a revision\
+ (<b>git+https://github.com/python-poetry/poetry.git#develop</b>)
+  - A file path (<b>../my-package/my-package.whl</b>)
+  - A directory (<b>../my-package/</b>)
+  - A url (<b>https://example.com/packages/my-package-0.1.0.tar.gz</b>)
+"""
+
         help_displayed = False
         if self.confirm(question, True):
             if self.io.is_interactive():
@@ -280,11 +286,13 @@ def _determine_requirements(
                         choices.append(found_package.pretty_name)
 
                     self.line(
-                        f"Found <info>{len(matches)}</info> packages matching <c1>{package}</c1>"
+                        f"Found <info>{len(matches)}</info> packages matching"
+                        f" <c1>{package}</c1>"
                     )
 
                     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,
                     )
@@ -310,7 +318,8 @@ def _determine_requirements(
                         )
 
                         self.line(
-                            f"Using version <b>{package_constraint}</b> for <c1>{package}</c1>"
+                            f"Using version <b>{package_constraint}</b> for"
+                            f" <c1>{package}</c1>"
                         )
 
                     constraint["version"] = package_constraint
diff --git a/src/poetry/console/commands/install.py b/src/poetry/console/commands/install.py
index 23274665138..c150e1bd203 100644
--- a/src/poetry/console/commands/install.py
+++ b/src/poetry/console/commands/install.py
@@ -34,17 +34,20 @@ class InstallCommand(InstallerCommand):
         option(
             "no-dev",
             None,
-            "Do not install the development dependencies. (<warning>Deprecated</warning>)",
+            "Do not install the development dependencies."
+            " (<warning>Deprecated</warning>)",
         ),
         option(
             "dev-only",
             None,
-            "Only install the development dependencies. (<warning>Deprecated</warning>)",
+            "Only install the development dependencies."
+            " (<warning>Deprecated</warning>)",
         ),
         option(
             "sync",
             None,
-            "Synchronize the environment with the locked packages and the specified groups.",
+            "Synchronize the environment with the locked packages and the specified"
+            " groups.",
         ),
         option(
             "no-root", None, "Do not install the root package (the current project)."
@@ -108,14 +111,16 @@ def handle(self) -> int:
         only_groups = []
         if self.option("no-dev"):
             self.line(
-                "<warning>The `<fg=yellow;options=bold>--no-dev</>` option is deprecated, "
-                "use the `<fg=yellow;options=bold>--without dev</>` notation instead.</warning>"
+                "<warning>The `<fg=yellow;options=bold>--no-dev</>` option is"
+                " deprecated, use the `<fg=yellow;options=bold>--without dev</>`"
+                " notation instead.</warning>"
             )
             excluded_groups.append("dev")
         elif self.option("dev-only"):
             self.line(
-                "<warning>The `<fg=yellow;options=bold>--dev-only</>` option is deprecated, "
-                "use the `<fg=yellow;options=bold>--only dev</>` notation instead.</warning>"
+                "<warning>The `<fg=yellow;options=bold>--dev-only</>` option is"
+                " deprecated, use the `<fg=yellow;options=bold>--only dev</>` notation"
+                " instead.</warning>"
             )
             only_groups.append("dev")
 
@@ -147,8 +152,9 @@ def handle(self) -> int:
         with_synchronization = self.option("sync")
         if self.option("remove-untracked"):
             self.line(
-                "<warning>The `<fg=yellow;options=bold>--remove-untracked</>` option is deprecated, "
-                "use the `<fg=yellow;options=bold>--sync</>` option instead.</warning>"
+                "<warning>The `<fg=yellow;options=bold>--remove-untracked</>` option is"
+                " deprecated, use the `<fg=yellow;options=bold>--sync</>` option"
+                " instead.</warning>"
             )
 
             with_synchronization = True
@@ -177,8 +183,9 @@ def handle(self) -> int:
             return 0
 
         log_install = (
-            f"<b>Installing</> the current project: <c1>{self.poetry.package.pretty_name}</c1> "
-            f"(<{{tag}}>{self.poetry.package.pretty_version}</>)"
+            "<b>Installing</> the current project:"
+            f" <c1>{self.poetry.package.pretty_name}</c1>"
+            f" (<{{tag}}>{self.poetry.package.pretty_version}</>)"
         )
         overwrite = self._io.output.is_decorated() and not self.io.is_debug()
         self.line("")
diff --git a/src/poetry/console/commands/lock.py b/src/poetry/console/commands/lock.py
index ba3b266e099..3eb9d26d810 100644
--- a/src/poetry/console/commands/lock.py
+++ b/src/poetry/console/commands/lock.py
@@ -15,14 +15,15 @@ class LockCommand(InstallerCommand):
         option(
             "check",
             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</>.",
         ),
     ]
 
     help = """
 The <info>lock</info> command reads the <comment>pyproject.toml</> file from the
-current directory, processes it, and locks the dependencies in the <comment>poetry.lock</>
+current directory, processes it, and locks the dependencies in the\
+ <comment>poetry.lock</>
 file.
 
 <info>poetry lock</info>
diff --git a/src/poetry/console/commands/new.py b/src/poetry/console/commands/new.py
index af4c0c5fdf6..33e141ec740 100644
--- a/src/poetry/console/commands/new.py
+++ b/src/poetry/console/commands/new.py
@@ -40,7 +40,8 @@ def handle(self) -> None:
 
         path = Path(self.argument("path"))
         if not path.is_absolute():
-            # we do not use resolve here due to compatibility issues for path.resolve(strict=False)
+            # we do not use resolve here due to compatibility issues
+            # for path.resolve(strict=False)
             path = Path.cwd().joinpath(path)
 
         name = self.option("name")
@@ -50,7 +51,7 @@ def handle(self) -> None:
         if path.exists() and list(path.glob("*")):
             # Directory is not empty. Aborting.
             raise RuntimeError(
-                f"Destination <fg=yellow>{path}</> " "exists and is not empty"
+                f"Destination <fg=yellow>{path}</> exists and is not empty"
             )
 
         readme_format = self.option("readme") or "md"
@@ -81,5 +82,6 @@ def handle(self) -> None:
             path = path.relative_to(Path.cwd())
 
         self.line(
-            f"Created package <info>{layout_._package_name}</> in <fg=blue>{path.as_posix()}</>"
+            f"Created package <info>{layout_._package_name}</> in"
+            f" <fg=blue>{path.as_posix()}</>"
         )
diff --git a/src/poetry/console/commands/plugin/add.py b/src/poetry/console/commands/plugin/add.py
index 04cc94b480f..98142be95ef 100644
--- a/src/poetry/console/commands/plugin/add.py
+++ b/src/poetry/console/commands/plugin/add.py
@@ -26,7 +26,8 @@ class PluginAddCommand(InitCommand):
         option(
             "dry-run",
             None,
-            "Output the operations but do not execute anything (implicitly enables --verbose).",
+            "Output the operations but do not execute anything (implicitly enables"
+            " --verbose).",
         )
     ]
 
@@ -35,16 +36,19 @@ class PluginAddCommand(InitCommand):
 
 It works similarly to the <c1>add</c1> command:
 
-If you do not specify a version constraint, poetry will choose a suitable one based on the available package versions.
+If you do not specify a version constraint, poetry will choose a suitable one based on\
+ the available package versions.
 
 You can specify a package in the following forms:
 
   - A single name (<b>requests</b>)
   - A name and a constraint (<b>requests@^2.23.0</b>)
   - A git url (<b>git+https://github.com/python-poetry/poetry.git</b>)
-  - A git url with a revision (<b>git+https://github.com/python-poetry/poetry.git#develop</b>)
+  - A git url with a revision\
+ (<b>git+https://github.com/python-poetry/poetry.git#develop</b>)
   - A git SSH url (<b>git+ssh://github.com/python-poetry/poetry.git</b>)
-  - A git SSH url with a revision (<b>git+ssh://github.com/python-poetry/poetry.git#develop</b>)
+  - A git SSH url with a revision\
+ (<b>git+ssh://github.com/python-poetry/poetry.git#develop</b>)
   - A file path (<b>../my-package/my-package.whl</b>)
   - A directory (<b>../my-package/</b>)
   - A url (<b>https://example.com/packages/my-package-0.1.0.tar.gz</b>)\
@@ -95,8 +99,9 @@ def handle(self) -> int:
         # We retrieve the packages installed in the system environment.
         # We assume that this environment will be a self contained virtual environment
         # built by the official installer or by pipx.
-        # If not, it might lead to side effects since other installed packages
-        # might not be required by Poetry but still taken into account when resolving dependencies.
+        # If not, it might lead to side effects since other installed packages might not
+        # be required by Poetry but still be taken into account when resolving
+        # dependencies.
         installed_repository = InstalledRepository.load(
             system_env, with_dependencies=True
         )
diff --git a/src/poetry/console/commands/plugin/remove.py b/src/poetry/console/commands/plugin/remove.py
index c69f584d7d1..cb9ada41ea3 100644
--- a/src/poetry/console/commands/plugin/remove.py
+++ b/src/poetry/console/commands/plugin/remove.py
@@ -24,7 +24,8 @@ class PluginRemoveCommand(Command):
         option(
             "dry-run",
             None,
-            "Output the operations but do not execute anything (implicitly enables --verbose).",
+            "Output the operations but do not execute anything (implicitly enables"
+            " --verbose).",
         )
     ]
 
diff --git a/src/poetry/console/commands/plugin/show.py b/src/poetry/console/commands/plugin/show.py
index bd3d66d1856..1d8a8e599dc 100644
--- a/src/poetry/console/commands/plugin/show.py
+++ b/src/poetry/console/commands/plugin/show.py
@@ -82,7 +82,8 @@ def handle(self) -> int:
                 self.line("      <info>Dependencies</info>")
                 for dependency in package.requires:
                     self.line(
-                        f"        - {dependency.pretty_name} (<c2>{dependency.pretty_constraint}</c2>)"
+                        f"        - {dependency.pretty_name}"
+                        f" (<c2>{dependency.pretty_constraint}</c2>)"
                     )
 
         return 0
diff --git a/src/poetry/console/commands/publish.py b/src/poetry/console/commands/publish.py
index f2720621bce..7daa81a0ac0 100644
--- a/src/poetry/console/commands/publish.py
+++ b/src/poetry/console/commands/publish.py
@@ -49,8 +49,8 @@ def handle(self) -> Optional[int]:
         # Building package first, if told
         if self.option("build"):
             if publisher.files and not self.confirm(
-                f"There are <info>{len(publisher.files)}</info> files ready for publishing. "
-                "Build anyway?"
+                f"There are <info>{len(publisher.files)}</info> files ready for"
+                " publishing. Build anyway?"
             ):
                 self.line_error("<error>Aborted!</error>")
 
diff --git a/src/poetry/console/commands/show.py b/src/poetry/console/commands/show.py
index c192596bb8b..8d561146ad3 100644
--- a/src/poetry/console/commands/show.py
+++ b/src/poetry/console/commands/show.py
@@ -36,7 +36,8 @@ class ShowCommand(EnvCommand):
         option(
             "with",
             None,
-            "Show the information of the specified optional groups' dependencies as well.",
+            "Show the information of the specified optional groups' dependencies as"
+            " well.",
             flag=False,
             multiple=True,
         ),
@@ -46,7 +47,8 @@ class ShowCommand(EnvCommand):
         option(
             "only",
             None,
-            "Only show the information of dependencies belonging to the specified groups.",
+            "Only show the information of dependencies belonging to the specified"
+            " groups.",
             flag=False,
             multiple=True,
         ),
@@ -97,8 +99,9 @@ def handle(self) -> Optional[int]:
         only_groups = []
         if self.option("no-dev"):
             self.line(
-                "<warning>The `<fg=yellow;options=bold>--no-dev</>` option is deprecated, "
-                "use the `<fg=yellow;options=bold>--without dev</>` notation instead.</warning>"
+                "<warning>The `<fg=yellow;options=bold>--no-dev</>` option is"
+                " deprecated, use the `<fg=yellow;options=bold>--without dev</>`"
+                " notation instead.</warning>"
             )
             excluded_groups.append("dev")
 
@@ -201,7 +204,8 @@ def handle(self) -> Optional[int]:
                 self.line("<info>dependencies</info>")
                 for dependency in pkg.requires:
                     self.line(
-                        f" - <c1>{dependency.pretty_name}</c1> <b>{dependency.pretty_constraint}</b>"
+                        f" - <c1>{dependency.pretty_name}</c1>"
+                        f" <b>{dependency.pretty_constraint}</b>"
                     )
 
             if required_by:
@@ -301,7 +305,10 @@ def handle(self) -> Optional[int]:
             ):
                 continue
 
-            line = f"<fg={color}>{name:{name_length - len(install_marker)}}{install_marker}</>"
+            line = (
+                f"<fg={color}>"
+                f"{name:{name_length - len(install_marker)}}{install_marker}</>"
+            )
             if write_version:
                 version = get_package_version_display_string(
                     locked, root=self.poetry.file.parent
@@ -357,7 +364,10 @@ def display_package_tree(
 
             level = 1
             color = self.colors[level]
-            info = f"{tree_bar}── <{color}>{dependency.name}</{color}> {dependency.pretty_constraint}"
+            info = (
+                f"{tree_bar}── <{color}>{dependency.name}</{color}>"
+                f" {dependency.pretty_constraint}"
+            )
             self._write_tree_line(io, info)
 
             tree_bar = tree_bar.replace("└", " ")
@@ -400,7 +410,10 @@ def _display_tree(
             if dependency.name in current_tree:
                 circular_warn = "(circular dependency aborted here)"
 
-            info = f"{tree_bar}── <{color}>{dependency.name}</{color}> {dependency.pretty_constraint} {circular_warn}"
+            info = (
+                f"{tree_bar}── <{color}>{dependency.name}</{color}>"
+                f" {dependency.pretty_constraint} {circular_warn}"
+            )
             self._write_tree_line(io, info)
 
             tree_bar = tree_bar.replace("└", " ")
diff --git a/src/poetry/console/commands/source/add.py b/src/poetry/console/commands/source/add.py
index 23adfbada6a..373221dd679 100644
--- a/src/poetry/console/commands/source/add.py
+++ b/src/poetry/console/commands/source/add.py
@@ -59,7 +59,8 @@ def handle(self) -> Optional[int]:
 
         if is_default and is_secondary:
             self.line_error(
-                "Cannot configure a source as both <c1>default</c1> and <c1>secondary</c1>."
+                "Cannot configure a source as both <c1>default</c1> and"
+                " <c1>secondary</c1>."
             )
             return 1
 
@@ -73,18 +74,20 @@ def handle(self) -> Optional[int]:
         for source in existing_sources:
             if source == new_source:
                 self.line(
-                    f"Source with name <c1>{name}</c1> already exits. Skipping addition."
+                    f"Source with name <c1>{name}</c1> already exists. Skipping"
+                    " addition."
                 )
                 return 0
             elif source.default and is_default:
                 self.line_error(
-                    f"<error>Source with name <c1>{source.name}</c1> is already set to default. "
-                    f"Only one default source can be configured at a time.</error>"
+                    f"<error>Source with name <c1>{source.name}</c1> is already set to"
+                    " default. Only one default source can be configured at a"
+                    " time.</error>"
                 )
                 return 1
 
             if source.name == name:
-                self.line(f"Source with name <c1>{name}</c1> already exits. Updating.")
+                self.line(f"Source with name <c1>{name}</c1> already exists. Updating.")
                 source = new_source
                 new_source = None
 
diff --git a/src/poetry/console/commands/version.py b/src/poetry/console/commands/version.py
index 54875a746e2..2aa96ce1aee 100644
--- a/src/poetry/console/commands/version.py
+++ b/src/poetry/console/commands/version.py
@@ -58,7 +58,8 @@ def handle(self) -> None:
                 self.line(version.to_string())
             else:
                 self.line(
-                    f"Bumping version from <b>{self.poetry.package.pretty_version}</> to <fg=green>{version}</>"
+                    f"Bumping version from <b>{self.poetry.package.pretty_version}</>"
+                    f" to <fg=green>{version}</>"
                 )
 
             content = self.poetry.file.read()
@@ -71,7 +72,8 @@ def handle(self) -> None:
                 self.line(self.poetry.package.pretty_version)
             else:
                 self.line(
-                    f"<comment>{self.poetry.package.name}</> <info>{self.poetry.package.pretty_version}</>"
+                    f"<comment>{self.poetry.package.name}</>"
+                    f" <info>{self.poetry.package.pretty_version}</>"
                 )
 
     def increment_version(self, version: str, rule: str) -> "Version":
diff --git a/src/poetry/inspection/info.py b/src/poetry/inspection/info.py
index 5941da37b89..7d754c0bb6f 100644
--- a/src/poetry/inspection/info.py
+++ b/src/poetry/inspection/info.py
@@ -112,7 +112,8 @@ def load(cls, data: Dict[str, Optional[Union[str, List[str]]]]) -> "PackageInfo"
         """
         Helper method to load data from a dictionary produced by `PackageInfo.asdict()`.
 
-        :param data: Data to load. This is expected to be a `dict` object output by `asdict()`.
+        :param data: Data to load. This is expected to be a `dict` object output by
+            `asdict()`.
         """
         cache_version = data.pop("_cache_version", None)
         return cls(cache_version=cache_version, **data)
@@ -129,17 +130,20 @@ def to_package(
         root_dir: Optional[Path] = None,
     ) -> Package:
         """
-        Create a new `poetry.core.packages.package.Package` instance using metadata from this instance.
+        Create a new `poetry.core.packages.package.Package` instance using metadata from
+        this instance.
 
-        :param name: Name to use for the package, if not specified name from this instance is used.
+        :param name: Name to use for the package, if not specified name from this
+            instance is used.
         :param extras: Extras to activate for this package.
-        :param root_dir:  Optional root directory to use for the package. If set, dependency strings
-            will be parsed relative to this directory.
+        :param root_dir:  Optional root directory to use for the package. If set,
+            dependency strings will be parsed relative to this directory.
         """
         name = name or self.name
 
         if not self.version:
-            # The version could not be determined, so we raise an error since it is mandatory.
+            # The version could not be determined, so we raise an error since it is
+            # mandatory.
             raise RuntimeError(f"Unable to retrieve the package version for {name}")
 
         package = Package(
@@ -155,8 +159,8 @@ def to_package(
         package.files = self.files
 
         if root_dir or (self._source_type in {"directory"} and self._source_url):
-            # this is a local poetry project, this means we can extract "richer" requirement information
-            # eg: development requirements etc.
+            # this is a local poetry project, this means we can extract "richer"
+            # requirement information, eg: development requirements etc.
             poetry_package = self._get_poetry_package(path=root_dir or self._source_url)
             if poetry_package:
                 package.extras = poetry_package.extras
@@ -178,8 +182,8 @@ def to_package(
             except ValueError:
                 # Likely unable to parse constraint so we skip it
                 self._log(
-                    f"Invalid constraint ({req}) found in {package.name}-{package.version} dependencies, "
-                    "skipping",
+                    f"Invalid constraint ({req}) found in"
+                    f" {package.name}-{package.version} dependencies, skipping",
                     level="warning",
                 )
                 continue
@@ -188,7 +192,8 @@ def to_package(
                 # this dependency is required by an extra package
                 for extra in dependency.in_extras:
                     if extra not in package.extras:
-                        # this is the first time we encounter this extra for this package
+                        # this is the first time we encounter this extra for this
+                        # package
                         package.extras[extra] = []
 
                     package.extras[extra].append(dependency)
@@ -206,7 +211,8 @@ def _from_distribution(
         cls, dist: Union[pkginfo.BDist, pkginfo.SDist, pkginfo.Wheel]
     ) -> "PackageInfo":
         """
-        Helper method to parse package information from a `pkginfo.Distribution` instance.
+        Helper method to parse package information from a `pkginfo.Distribution`
+        instance.
 
         :param dist: The distribution instance to parse information from.
         """
@@ -237,9 +243,9 @@ def _from_distribution(
     @classmethod
     def _from_sdist_file(cls, path: Path) -> "PackageInfo":
         """
-        Helper method to parse package information from an sdist file. We attempt to first inspect the
-        file using `pkginfo.SDist`. If this does not provide us with package requirements, we extract the
-        source and handle it as a directory.
+        Helper method to parse package information from an sdist file. We attempt to
+        first inspect the file using `pkginfo.SDist`. If this does not provide us with
+        package requirements, we extract the source and handle it as a directory.
 
         :param path: The sdist file to parse information from.
         """
@@ -302,9 +308,10 @@ def has_setup_files(path: Path) -> bool:
     @classmethod
     def from_setup_files(cls, path: Path) -> "PackageInfo":
         """
-        Mechanism to parse package information from a `setup.[py|cfg]` file. This uses the implementation
-        at `poetry.utils.setup_reader.SetupReader` in order to parse the file. This is not reliable for
-        complex setup files and should only attempted as a fallback.
+        Mechanism to parse package information from a `setup.[py|cfg]` file. This uses
+        the implementation at `poetry.utils.setup_reader.SetupReader` in order to parse
+        the file. This is not reliable for complex setup files and should only attempted
+        as a fallback.
 
         :param path: Path to `setup.py` file
         """
@@ -361,9 +368,9 @@ def _find_dist_info(path: Path) -> Iterator[Path]:
         :param path: Path to search.
         """
         pattern = "**/*.*-info"
-        # Sometimes pathlib will fail on recursive symbolic links, so we need to workaround it
-        # and use the glob module instead. Note that this does not happen with pathlib2
-        # so it's safe to use it for Python < 3.4.
+        # Sometimes pathlib will fail on recursive symbolic links, so we need to work
+        # around it and use the glob module instead. Note that this does not happen with
+        # pathlib2 so it's safe to use it for Python < 3.4.
         directories = glob.iglob(path.joinpath(pattern).as_posix(), recursive=True)
 
         for d in directories:
@@ -508,13 +515,14 @@ def _pep517_metadata(cls, path: Path) -> "PackageInfo":
     @classmethod
     def from_directory(cls, path: Path, disable_build: bool = False) -> "PackageInfo":
         """
-        Generate package information from a package source directory. If `disable_build` is not `True` and
-        introspection of all available metadata fails, the package is attempted to be build in an isolated
-        environment so as to generate required metadata.
+        Generate package information from a package source directory. If `disable_build`
+        is not `True` and introspection of all available metadata fails, the package is
+        attempted to be built in an isolated environment so as to generate required
+        metadata.
 
         :param path: Path to generate package information from.
-        :param disable_build: If not `True` and setup reader fails, PEP 517 isolated build is attempted in
-            order to gather metadata.
+        :param disable_build: If not `True` and setup reader fails, PEP 517 isolated
+            build is attempted in order to gather metadata.
         """
         project_package = cls._get_poetry_package(path)
         if project_package:
diff --git a/src/poetry/installation/chooser.py b/src/poetry/installation/chooser.py
index 1050a720140..73e6bd5bed0 100644
--- a/src/poetry/installation/chooser.py
+++ b/src/poetry/installation/chooser.py
@@ -112,7 +112,8 @@ def _get_links(self, package: "Package") -> List["Link"]:
 
         if links and not selected_links:
             raise RuntimeError(
-                f"Retrieved digest for link {link.filename}({h}) not in poetry.lock metadata {hashes}"
+                f"Retrieved digest for link {link.filename}({h}) not in poetry.lock"
+                f" metadata {hashes}"
             )
 
         return selected_links
diff --git a/src/poetry/installation/executor.py b/src/poetry/installation/executor.py
index 3b8c920c2bf..b9dcd8e92f6 100644
--- a/src/poetry/installation/executor.py
+++ b/src/poetry/installation/executor.py
@@ -230,7 +230,8 @@ def _execute_operation(self, operation: "OperationTypes") -> None:
                     with self._lock:
                         self._sections[id(operation)] = self._io.section()
                         self._sections[id(operation)].write_line(
-                            f"  <fg=blue;options=bold>•</> {op_message}: <fg=blue>Pending...</>"
+                            f"  <fg=blue;options=bold>•</> {op_message}:"
+                            " <fg=blue>Pending...</>"
                         )
             else:
                 if self._should_write_operation(operation):
@@ -266,7 +267,11 @@ def _execute_operation(self, operation: "OperationTypes") -> None:
                 if not self.supports_fancy_output():
                     io = self._io
                 else:
-                    message = f"  <error>•</error> {self.get_operation_message(operation, error=True)}: <error>Failed</error>"
+                    message = (
+                        "  <error>•</error>"
+                        f" {self.get_operation_message(operation, error=True)}:"
+                        " <error>Failed</error>"
+                    )
                     self._write(operation, message)
                     io = self._sections.get(id(operation), self._io)
 
@@ -279,7 +284,11 @@ def _execute_operation(self, operation: "OperationTypes") -> None:
                     self._shutdown = True
         except KeyboardInterrupt:
             try:
-                message = f"  <warning>•</warning> {self.get_operation_message(operation, warning=True)}: <warning>Cancelled</warning>"
+                message = (
+                    "  <warning>•</warning>"
+                    f" {self.get_operation_message(operation, warning=True)}:"
+                    " <warning>Cancelled</warning>"
+                )
                 if not self.supports_fancy_output():
                     self._io.write_line(message)
                 else:
@@ -376,21 +385,26 @@ def get_operation_message(
 
         if operation.job_type == "install":
             return (
-                f"<{base_tag}>Installing <{package_color}>{operation.package.name}</{package_color}> "
-                f"(<{operation_color}>{operation.package.full_pretty_version}</>)</>"
+                f"<{base_tag}>Installing"
+                f" <{package_color}>{operation.package.name}</{package_color}>"
+                f" (<{operation_color}>{operation.package.full_pretty_version}</>)</>"
             )
 
         if operation.job_type == "uninstall":
             return (
-                f"<{base_tag}>Removing <{package_color}>{operation.package.name}</{package_color}> "
-                f"(<{operation_color}>{operation.package.full_pretty_version}</>)</>"
+                f"<{base_tag}>Removing"
+                f" <{package_color}>{operation.package.name}</{package_color}>"
+                f" (<{operation_color}>{operation.package.full_pretty_version}</>)</>"
             )
 
         if operation.job_type == "update":
             return (
-                f"<{base_tag}>Updating <{package_color}>{operation.initial_package.name}</{package_color}> "
-                f"(<{source_operation_color}>{operation.initial_package.full_pretty_version}</{source_operation_color}> "
-                f"-> <{operation_color}>{operation.target_package.full_pretty_version}</>)</>"
+                f"<{base_tag}>Updating"
+                f" <{package_color}>{operation.initial_package.name}</{package_color}> "
+                f"(<{source_operation_color}>"
+                f"{operation.initial_package.full_pretty_version}"
+                f"</{source_operation_color}> -> <{operation_color}>"
+                f"{operation.target_package.full_pretty_version}</>)</>"
             )
         return ""
 
@@ -464,7 +478,10 @@ def _install(self, operation: Union["Install", "Update"]) -> int:
             archive = self._download(operation)
 
         operation_message = self.get_operation_message(operation)
-        message = f"  <fg=blue;options=bold>•</> {operation_message}: <info>Installing...</info>"
+        message = (
+            f"  <fg=blue;options=bold>•</> {operation_message}:"
+            " <info>Installing...</info>"
+        )
         self._write(operation, message)
         return self.pip_install(archive, upgrade=operation.job_type == "update")
 
@@ -492,7 +509,10 @@ def _prepare_file(self, operation: Union["Install", "Update"]) -> Path:
         package = operation.package
         operation_message = self.get_operation_message(operation)
 
-        message = f"  <fg=blue;options=bold>•</> {operation_message}: <info>Preparing...</info>"
+        message = (
+            f"  <fg=blue;options=bold>•</> {operation_message}:"
+            " <info>Preparing...</info>"
+        )
         self._write(operation, message)
 
         archive = Path(package.source_url)
@@ -509,7 +529,10 @@ def _install_directory(self, operation: Union["Install", "Update"]) -> int:
         package = operation.package
         operation_message = self.get_operation_message(operation)
 
-        message = f"  <fg=blue;options=bold>•</> {operation_message}: <info>Building...</info>"
+        message = (
+            f"  <fg=blue;options=bold>•</> {operation_message}:"
+            " <info>Building...</info>"
+        )
         self._write(operation, message)
 
         if package.root_dir:
@@ -644,7 +667,8 @@ def _validate_archive_hash(archive: Union[Path, Link], package: "Package") -> st
 
         if archive_hash not in known_hashes:
             raise RuntimeError(
-                f"Hash for {package} from archive {archive_path.name} not found in known hashes (was: {archive_hash})"
+                f"Hash for {package} from archive {archive_path.name} not found in"
+                f" known hashes (was: {archive_hash})"
             )
 
         return archive_hash
diff --git a/src/poetry/installation/installer.py b/src/poetry/installation/installer.py
index 97f36e3f30d..697c707b7f6 100644
--- a/src/poetry/installation/installer.py
+++ b/src/poetry/installation/installer.py
@@ -414,14 +414,16 @@ def _execute_install(self, operation: Install) -> None:
         if operation.skipped:
             if self.is_verbose() and (self._execute_operations or self.is_dry_run()):
                 self._io.write_line(
-                    f"  - Skipping <c1>{target.pretty_name}</c1> (<c2>{target.full_pretty_version}</c2>) {operation.skip_reason}"
+                    f"  - Skipping <c1>{target.pretty_name}</c1>"
+                    f" (<c2>{target.full_pretty_version}</c2>) {operation.skip_reason}"
                 )
 
             return
 
         if self._execute_operations or self.is_dry_run():
             self._io.write_line(
-                f"  - Installing <c1>{target.pretty_name}</c1> (<c2>{target.full_pretty_version}</c2>)"
+                f"  - Installing <c1>{target.pretty_name}</c1>"
+                f" (<c2>{target.full_pretty_version}</c2>)"
             )
 
         if not self._execute_operations:
@@ -444,8 +446,9 @@ def _execute_update(self, operation: Update) -> None:
 
         if self._execute_operations or self.is_dry_run():
             self._io.write_line(
-                f"  - Updating <c1>{target.pretty_name}</c1> "
-                f"(<c2>{source.full_pretty_version}</c2> -> <c2>{target.full_pretty_version}</c2>)"
+                f"  - Updating <c1>{target.pretty_name}</c1>"
+                f" (<c2>{source.full_pretty_version}</c2> ->"
+                f" <c2>{target.full_pretty_version}</c2>)"
             )
 
         if not self._execute_operations:
@@ -458,14 +461,16 @@ def _execute_uninstall(self, operation: Uninstall) -> None:
         if operation.skipped:
             if self.is_verbose() and (self._execute_operations or self.is_dry_run()):
                 self._io.write_line(
-                    f"  - Not removing <c1>{target.pretty_name}</c1> (<c2>{target.pretty_version}</c2>) {operation.skip_reason}"
+                    f"  - Not removing <c1>{target.pretty_name}</c1>"
+                    f" (<c2>{target.pretty_version}</c2>) {operation.skip_reason}"
                 )
 
             return
 
         if self._execute_operations or self.is_dry_run():
             self._io.write_line(
-                f"  - Removing <c1>{target.pretty_name}</c1> (<c2>{target.pretty_version}</c2>)"
+                f"  - Removing <c1>{target.pretty_name}</c1>"
+                f" (<c2>{target.pretty_version}</c2>)"
             )
 
         if not self._execute_operations:
diff --git a/src/poetry/installation/operations/install.py b/src/poetry/installation/operations/install.py
index 5205d746037..95014d10b96 100644
--- a/src/poetry/installation/operations/install.py
+++ b/src/poetry/installation/operations/install.py
@@ -25,7 +25,13 @@ def job_type(self) -> str:
         return "install"
 
     def __str__(self) -> str:
-        return f"Installing {self.package.pretty_name} ({self.format_version(self.package)})"
+        return (
+            "Installing"
+            f" {self.package.pretty_name} ({self.format_version(self.package)})"
+        )
 
     def __repr__(self) -> str:
-        return f"<Install {self.package.pretty_name} ({self.format_version(self.package)})>"
+        return (
+            "<Install"
+            f" {self.package.pretty_name} ({self.format_version(self.package)})>"
+        )
diff --git a/src/poetry/installation/operations/uninstall.py b/src/poetry/installation/operations/uninstall.py
index c2ea5303145..3edcbef98c8 100644
--- a/src/poetry/installation/operations/uninstall.py
+++ b/src/poetry/installation/operations/uninstall.py
@@ -28,7 +28,13 @@ def job_type(self) -> str:
         return "uninstall"
 
     def __str__(self) -> str:
-        return f"Uninstalling {self.package.pretty_name} ({self.format_version(self._package)})"
+        return (
+            "Uninstalling"
+            f" {self.package.pretty_name} ({self.format_version(self._package)})"
+        )
 
     def __repr__(self) -> str:
-        return f"<Uninstall {self.package.pretty_name} ({self.format_version(self.package)})>"
+        return (
+            "<Uninstall"
+            f" {self.package.pretty_name} ({self.format_version(self.package)})>"
+        )
diff --git a/src/poetry/installation/pip_installer.py b/src/poetry/installation/pip_installer.py
index abefac6da16..e05fa0cfc6f 100644
--- a/src/poetry/installation/pip_installer.py
+++ b/src/poetry/installation/pip_installer.py
@@ -52,7 +52,8 @@ def install(self, package: "Package", update: bool = False) -> None:
             parsed = urllib.parse.urlparse(package.source_url)
             if parsed.scheme == "http":
                 self._io.write_error(
-                    f"    <warning>Installing from unsecure host: {parsed.hostname}</warning>"
+                    "    <warning>Installing from unsecure host:"
+                    f" {parsed.hostname}</warning>"
                 )
                 args += ["--trusted-host", parsed.hostname]
 
@@ -159,7 +160,10 @@ def requirement(self, package: "Package", formatted: bool = False) -> str:
             return req
 
         if package.source_type == "git":
-            req = f"git+{package.source_url}@{package.source_reference}#egg={package.name}"
+            req = (
+                f"git+{package.source_url}@{package.source_reference}"
+                f"#egg={package.name}"
+            )
 
             if package.develop:
                 req = ["-e", req]
diff --git a/src/poetry/layouts/layout.py b/src/poetry/layouts/layout.py
index abd1e87deb7..9e036005a63 100644
--- a/src/poetry/layouts/layout.py
+++ b/src/poetry/layouts/layout.py
@@ -63,7 +63,8 @@ def __init__(
         if self._readme_format not in self.ACCEPTED_README_FORMATS:
             accepted_readme_formats = ", ".join(self.ACCEPTED_README_FORMATS)
             raise ValueError(
-                f"Invalid readme format '{readme_format}', use one of {accepted_readme_formats}."
+                f"Invalid readme format '{readme_format}', use one of"
+                f" {accepted_readme_formats}."
             )
 
         self._license = license
diff --git a/src/poetry/masonry/builders/editable.py b/src/poetry/masonry/builders/editable.py
index f7a3996a2ca..a55ddffcf26 100644
--- a/src/poetry/masonry/builders/editable.py
+++ b/src/poetry/masonry/builders/editable.py
@@ -47,7 +47,8 @@ def __init__(self, poetry: "Poetry", env: "Env", io: "IO") -> None:
 
     def build(self) -> None:
         self._debug(
-            f"  - Building package <c1>{self._package.name}</c1> in <info>editable</info> mode"
+            f"  - Building package <c1>{self._package.name}</c1> in"
+            " <info>editable</info> mode"
         )
 
         if self._package.build_script:
@@ -63,7 +64,8 @@ def build(self) -> None:
             distribution_name=self._package.name
         ):
             self._debug(
-                f"  - Removed <c2>{removed.name}</c2> directory from <b>{removed.parent}</b>"
+                f"  - Removed <c2>{removed.name}</c2> directory from"
+                f" <b>{removed.parent}</b>"
             )
 
         added_files = []
@@ -121,7 +123,8 @@ def _add_pth(self) -> List[Path]:
         # remove any pre-existing pth files for this package
         for file in self._env.site_packages.find(path=pth_file, writable_only=True):
             self._debug(
-                f"  - Removing existing <c2>{file.name}</c2> from <b>{file.parent}</b> for {self._poetry.file.parent}"
+                f"  - Removing existing <c2>{file.name}</c2> from <b>{file.parent}</b>"
+                f" for {self._poetry.file.parent}"
             )
             # We can't use unlink(missing_ok=True) because it's not always available
             if file.exists():
@@ -132,13 +135,15 @@ def _add_pth(self) -> List[Path]:
                 pth_file, content, encoding="utf-8"
             )
             self._debug(
-                f"  - Adding <c2>{pth_file.name}</c2> to <b>{pth_file.parent}</b> for {self._poetry.file.parent}"
+                f"  - Adding <c2>{pth_file.name}</c2> to <b>{pth_file.parent}</b> for"
+                f" {self._poetry.file.parent}"
             )
             return [pth_file]
         except OSError:
             # TODO: Replace with PermissionError
             self._io.write_error_line(
-                f"  - Failed to create <c2>{pth_file.name}</c2> for {self._poetry.file.parent}"
+                f"  - Failed to create <c2>{pth_file.name}</c2> for"
+                f" {self._poetry.file.parent}"
             )
             return []
 
@@ -151,7 +156,8 @@ def _add_scripts(self) -> List[Path]:
                 break
         else:
             self._io.write_error_line(
-                f"  - Failed to find a suitable script installation directory for {self._poetry.file.parent}"
+                "  - Failed to find a suitable script installation directory for"
+                f" {self._poetry.file.parent}"
             )
             return []
 
@@ -185,7 +191,8 @@ def _add_scripts(self) -> List[Path]:
                 cmd_script = script_file.with_suffix(".cmd")
                 cmd = WINDOWS_CMD_TEMPLATE.format(python=self._env.python, script=name)
                 self._debug(
-                    f"  - Adding the <c2>{cmd_script.name}</c2> script wrapper to <b>{scripts_path}</b>"
+                    f"  - Adding the <c2>{cmd_script.name}</c2> script wrapper to"
+                    f" <b>{scripts_path}</b>"
                 )
 
                 with cmd_script.open("w", encoding="utf-8") as f:
@@ -204,7 +211,8 @@ def _add_dist_info(self, added_files: List[Path]) -> None:
         dist_info = self._env.site_packages.mkdir(Path(builder.dist_info))
 
         self._debug(
-            f"  - Adding the <c2>{dist_info.name}</c2> directory to <b>{dist_info.parent}</b>"
+            f"  - Adding the <c2>{dist_info.name}</c2> directory to"
+            f" <b>{dist_info.parent}</b>"
         )
 
         with dist_info.joinpath("METADATA").open("w", encoding="utf-8") as f:
diff --git a/src/poetry/mixology/failure.py b/src/poetry/mixology/failure.py
index 7a033687874..8060e57e9d0 100644
--- a/src/poetry/mixology/failure.py
+++ b/src/poetry/mixology/failure.py
@@ -43,9 +43,10 @@ def write(self) -> str:
             if isinstance(incompatibility.cause, PythonCause):
                 if not required_python_version_notification:
                     buffer.append(
-                        f"The current project's Python requirement ({incompatibility.cause.root_python_version}) "
-                        "is not compatible with some of the required "
-                        "packages Python requirement:"
+                        "The current project's Python requirement"
+                        f" ({incompatibility.cause.root_python_version}) is not"
+                        " compatible with some of the required packages Python"
+                        " requirement:"
                     )
                     required_python_version_notification = True
 
@@ -54,9 +55,9 @@ def write(self) -> str:
                 )
                 constraint = parse_constraint(incompatibility.cause.python_version)
                 buffer.append(
-                    f"  - {incompatibility.terms[0].dependency.name} requires Python "
-                    f"{incompatibility.cause.python_version}, so it will not be satisfied "
-                    f"for Python {root_constraint.difference(constraint)}"
+                    f"  - {incompatibility.terms[0].dependency.name} requires Python"
+                    f" {incompatibility.cause.python_version}, so it will not be"
+                    f" satisfied for Python {root_constraint.difference(constraint)}"
                 )
 
         if required_python_version_notification:
@@ -145,7 +146,8 @@ def _visit(
                 self._visit(without_line, details_for_cause)
                 self._write(
                     incompatibility,
-                    f"{conjunction} because {with_line!s} ({line}), {incompatibility_string}.",
+                    f"{conjunction} because {with_line!s} ({line}),"
+                    f" {incompatibility_string}.",
                     numbered=numbered,
                 )
             else:
@@ -170,7 +172,9 @@ def _visit(
 
                     self._write(
                         incompatibility,
-                        f"{conjunction} because {cause.conflict!s} ({self._line_numbers[cause.conflict]}), {incompatibility_string}",
+                        f"{conjunction} because"
+                        f" {cause.conflict!s} ({self._line_numbers[cause.conflict]}),"
+                        f" {incompatibility_string}",
                         numbered=numbered,
                     )
         elif isinstance(cause.conflict.cause, ConflictCause) or isinstance(
diff --git a/src/poetry/mixology/incompatibility.py b/src/poetry/mixology/incompatibility.py
index 021be6ae91c..3b78a601587 100644
--- a/src/poetry/mixology/incompatibility.py
+++ b/src/poetry/mixology/incompatibility.py
@@ -54,11 +54,11 @@ def __init__(self, terms: List["Term"], cause: "IncompatibilityCause") -> None:
                 if ref in by_ref:
                     by_ref[ref] = by_ref[ref].intersect(term)
 
-                    # If we have two terms that refer to the same package but have a null
-                    # intersection, they're mutually exclusive, making this incompatibility
-                    # irrelevant, since we already know that mutually exclusive version
-                    # ranges are incompatible. We should never derive an irrelevant
-                    # incompatibility.
+                    # If we have two terms that refer to the same package but have a
+                    # null intersection, they're mutually exclusive, making this
+                    # incompatibility irrelevant, since we already know that mutually
+                    # exclusive version ranges are incompatible. We should never derive
+                    # an irrelevant incompatibility.
                     assert by_ref[ref] is not None
                 else:
                     by_ref[ref] = term
@@ -127,7 +127,10 @@ def __str__(self) -> str:
             assert depender.is_positive()
             assert not dependee.is_positive()
 
-            return f"{self._terse(depender, allow_every=True)} depends on {self._terse(dependee)}"
+            return (
+                f"{self._terse(depender, allow_every=True)} depends on"
+                f" {self._terse(dependee)}"
+            )
         elif isinstance(self._cause, PythonCause):
             assert len(self._terms) == 1
             assert self._terms[0].is_positive()
@@ -150,7 +153,10 @@ def __str__(self) -> str:
             assert len(self._terms) == 1
             assert self._terms[0].is_positive()
 
-            return f"no versions of {self._terms[0].dependency.name} match {self._terms[0].constraint}"
+            return (
+                f"no versions of {self._terms[0].dependency.name} match"
+                f" {self._terms[0].constraint}"
+            )
         elif isinstance(self._cause, PackageNotFoundCause):
             assert len(self._terms) == 1
             assert self._terms[0].is_positive()
@@ -161,7 +167,10 @@ def __str__(self) -> str:
             assert not self._terms[0].is_positive()
             assert self._terms[0].dependency.is_root
 
-            return f"{self._terms[0].dependency.name} is {self._terms[0].dependency.constraint}"
+            return (
+                f"{self._terms[0].dependency.name} is"
+                f" {self._terms[0].dependency.constraint}"
+            )
         elif self.is_failure():
             return "version solving failed"
 
@@ -205,7 +214,10 @@ def __str__(self) -> str:
                 return f"if {' and '.join(positive)} then {' or '.join(negative)}"
 
             positive_term = [term for term in self._terms if term.is_positive()][0]
-            return f"{self._terse(positive_term, allow_every=True)} requires {' or '.join(negative)}"
+            return (
+                f"{self._terse(positive_term, allow_every=True)} requires"
+                f" {' or '.join(negative)}"
+            )
         elif positive:
             return f"one of {' or '.join(positive)} must be false"
         else:
diff --git a/src/poetry/mixology/partial_solution.py b/src/poetry/mixology/partial_solution.py
index d7c59380a3b..ed5aee4293e 100644
--- a/src/poetry/mixology/partial_solution.py
+++ b/src/poetry/mixology/partial_solution.py
@@ -20,7 +20,8 @@ class PartialSolution:
     # what's true for the eventual set of package versions that will comprise the
     # total solution.
     #
-    # See https://github.com/dart-lang/mixology/tree/master/doc/solver.md#partial-solution.
+    # See:
+    # https://github.com/dart-lang/mixology/tree/master/doc/solver.md#partial-solution.
     """
 
     def __init__(self) -> None:
diff --git a/src/poetry/mixology/solutions/solutions/python_requirement_solution.py b/src/poetry/mixology/solutions/solutions/python_requirement_solution.py
index 4734f6c83de..5e97aade791 100644
--- a/src/poetry/mixology/solutions/solutions/python_requirement_solution.py
+++ b/src/poetry/mixology/solutions/solutions/python_requirement_solution.py
@@ -26,14 +26,17 @@ def __init__(self, exception: "PackageNotFoundCause") -> None:
                 constraint = parse_constraint(incompatibility.cause.python_version)
 
                 version_solutions.append(
-                    f"For <fg=default;options=bold>{incompatibility.terms[0].dependency.name}</>, "
-                    "a possible solution would be to set the `<fg=default;options=bold>python</>` "
-                    f'property to <fg=yellow>"{root_constraint.intersect(constraint)}"</>'
+                    "For <fg=default;options=bold>"
+                    f"{incompatibility.terms[0].dependency.name}</>,"
+                    " a possible solution would be to set the"
+                    " `<fg=default;options=bold>python</>` property to"
+                    f' <fg=yellow>"{root_constraint.intersect(constraint)}"</>'
                 )
 
         description = (
-            "The Python requirement can be specified via the `<fg=default;options=bold>python</>` "
-            "or `<fg=default;options=bold>markers</>` properties"
+            "The Python requirement can be specified via the"
+            " `<fg=default;options=bold>python</>` or"
+            " `<fg=default;options=bold>markers</>` properties"
         )
         if version_solutions:
             description += "\n\n" + "\n".join(version_solutions)
@@ -53,6 +56,6 @@ def solution_description(self) -> str:
     @property
     def documentation_links(self) -> List[str]:
         return [
-            "https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies",
-            "https://python-poetry.org/docs/dependency-specification/#using-environment-markers",
+            "https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies",  # noqa: E501
+            "https://python-poetry.org/docs/dependency-specification/#using-environment-markers",  # noqa: E501
         ]
diff --git a/src/poetry/mixology/version_solver.py b/src/poetry/mixology/version_solver.py
index 0a0f22561ae..555f9c02324 100644
--- a/src/poetry/mixology/version_solver.py
+++ b/src/poetry/mixology/version_solver.py
@@ -109,8 +109,8 @@ def _propagate(self, package: str) -> None:
 
                 if result is _conflict:
                     # If the incompatibility is satisfied by the solution, we use
-                    # _resolve_conflict() to determine the root cause of the conflict as a
-                    # new incompatibility.
+                    # _resolve_conflict() to determine the root cause of the conflict as
+                    # a new incompatibility.
                     #
                     # It also backjumps to a point in the solution
                     # where that incompatibility will allow us to derive new assignments
@@ -180,13 +180,14 @@ def _propagate_incompatibility(
     def _resolve_conflict(self, incompatibility: Incompatibility) -> Incompatibility:
         """
         Given an incompatibility that's satisfied by _solution,
-        The `conflict resolution`_ constructs a new incompatibility that encapsulates the root
-        cause of the conflict and backtracks _solution until the new
+        The `conflict resolution`_ constructs a new incompatibility that encapsulates
+        the root cause of the conflict and backtracks _solution until the new
         incompatibility will allow _propagate() to deduce new assignments.
 
         Adds the new incompatibility to _incompatibilities and returns it.
 
-        .. _conflict resolution: https://github.com/dart-lang/pub/tree/master/doc/solver.md#conflict-resolution
+        .. _conflict resolution:
+        https://github.com/dart-lang/pub/tree/master/doc/solver.md#conflict-resolution
         """
         self._log(f"conflict: {incompatibility}")
 
@@ -286,7 +287,8 @@ def _resolve_conflict(self, incompatibility: Incompatibility) -> Incompatibility
             # the incompatibility as well, See the `algorithm documentation`_ for
             # details.
             #
-            # .. _algorithm documentation: https://github.com/dart-lang/pub/tree/master/doc/solver.md#conflict-resolution
+            # .. _algorithm documentation:
+            # https://github.com/dart-lang/pub/tree/master/doc/solver.md#conflict-resolution  # noqa: E501
             if difference is not None:
                 new_terms.append(difference.inverse)
 
@@ -297,7 +299,8 @@ def _resolve_conflict(self, incompatibility: Incompatibility) -> Incompatibility
 
             partially = "" if difference is None else " partially"
             self._log(
-                f"! {most_recent_term} is{partially} satisfied by {most_recent_satisfier}"
+                f"! {most_recent_term} is{partially} satisfied by"
+                f" {most_recent_satisfier}"
             )
             self._log(f'! which is caused by "{most_recent_satisfier.cause}"')
             self._log(f"! thus: {incompatibility}")
diff --git a/src/poetry/packages/locker.py b/src/poetry/packages/locker.py
index 6b3317a0795..5eb84755dfe 100644
--- a/src/poetry/packages/locker.py
+++ b/src/poetry/packages/locker.py
@@ -179,7 +179,8 @@ def locked_repository(self, with_dev_reqs: bool = False) -> "Repository":
 
                 root_dir = self._lock.path.parent
                 if package.source_type == "directory":
-                    # root dir should be the source of the package relative to the lock path
+                    # root dir should be the source of the package relative to the lock
+                    # path
                     root_dir = Path(package.source_url)
 
                 if isinstance(constraint, list):
@@ -290,7 +291,8 @@ def get_project_dependencies(
         pinned_versions: bool = False,
         with_nested: bool = False,
     ) -> Iterable[Dependency]:
-        # group packages entries by name, this is required because requirement might use different constraints
+        # group packages entries by name, this is required because requirement might use
+        # different constraints
         packages_by_name = {}
         for pkg in locked_packages:
             if pkg.name not in packages_by_name:
@@ -482,9 +484,10 @@ def _get_lock_data(self) -> "TOMLDocument":
         lock_version_allowed = accepted_versions.allows(lock_version)
         if lock_version_allowed and current_version < lock_version:
             logger.warning(
-                "The lock file might not be compatible with the current version of Poetry.\n"
-                "Upgrade Poetry to ensure the lock file is read properly or, alternatively, "
-                "regenerate the lock file with the `poetry lock` command."
+                "The lock file might not be compatible with the current version of"
+                " Poetry.\nUpgrade Poetry to ensure the lock file is read properly or,"
+                " alternatively, regenerate the lock file with the `poetry lock`"
+                " command."
             )
         elif not lock_version_allowed:
             raise RuntimeError(
diff --git a/src/poetry/publishing/publisher.py b/src/poetry/publishing/publisher.py
index 309c2a951f3..5e44c931434 100644
--- a/src/poetry/publishing/publisher.py
+++ b/src/poetry/publishing/publisher.py
@@ -89,8 +89,9 @@ def publish(
         if repository_name == "pypi":
             repository_name = "PyPI"
         self._io.write_line(
-            f"Publishing <c1>{self._package.pretty_name}</c1> (<c2>{self._package.pretty_version}</c2>) "
-            f"to <info>{repository_name}</info>"
+            f"Publishing <c1>{self._package.pretty_name}</c1>"
+            f" (<c2>{self._package.pretty_version}</c2>) to"
+            f" <info>{repository_name}</info>"
         )
 
         self._uploader.upload(
diff --git a/src/poetry/publishing/uploader.py b/src/poetry/publishing/uploader.py
index 6decfc45237..f13df804fc0 100644
--- a/src/poetry/publishing/uploader.py
+++ b/src/poetry/publishing/uploader.py
@@ -83,7 +83,8 @@ def files(self) -> List["Path"]:
 
         wheels = list(
             dist.glob(
-                f"{escape_name(self._package.pretty_name)}-{escape_version(version)}-*.whl"
+                f"{escape_name(self._package.pretty_name)}-{escape_version(version)}"
+                "-*.whl"
             )
         )
         tars = list(dist.glob(f"{self._package.pretty_name}-{version}.tar.gz"))
@@ -295,7 +296,7 @@ def _register(self, session: requests.Session, url: str) -> requests.Response:
         dist = self._poetry.file.parent / "dist"
         file = (
             dist
-            / f"{self._package.name}-{normalize_version(self._package.version.text)}.tar.gz"
+            / f"{self._package.name}-{normalize_version(self._package.version.text)}.tar.gz"  # noqa: E501
         )
 
         if not file.exists():
diff --git a/src/poetry/puzzle/provider.py b/src/poetry/puzzle/provider.py
index 4413a880142..ffeb820f56f 100644
--- a/src/poetry/puzzle/provider.py
+++ b/src/poetry/puzzle/provider.py
@@ -258,7 +258,8 @@ def search_for_file(self, dependency: "FileDependency") -> List["Package"]:
         if dependency.name != package.name:
             # For now, the dependency's name must match the actual package's name
             raise RuntimeError(
-                f"The dependency name for {dependency.name} does not match the actual package's name: {package.name}"
+                f"The dependency name for {dependency.name} does not match the actual"
+                f" package's name: {package.name}"
             )
 
         if dependency.base is not None:
@@ -318,7 +319,8 @@ def get_package_from_directory(
         if name and name != package.name:
             # For now, the dependency's name must match the actual package's name
             raise RuntimeError(
-                f"The dependency name for {name} does not match the actual package's name: {package.name}"
+                f"The dependency name for {name} does not match the actual package's"
+                f" name: {package.name}"
             )
 
         return package
@@ -332,7 +334,8 @@ def search_for_url(self, dependency: "URLDependency") -> List["Package"]:
         if dependency.name != package.name:
             # For now, the dependency's name must match the actual package's name
             raise RuntimeError(
-                f"The dependency name for {dependency.name} does not match the actual package's name: {package.name}"
+                f"The dependency name for {dependency.name} does not match the actual"
+                f" package's name: {package.name}"
             )
 
         for extra in dependency.extras:
@@ -631,8 +634,8 @@ def complete_package(self, package: DependencyPackage) -> DependencyPackage:
             def fmt_warning(d: "Dependency") -> str:
                 marker = d.marker if not d.marker.is_any() else "*"
                 return (
-                    f"<c1>{d.name}</c1> <fg=default>(<c2>{d.pretty_constraint}</c2>)</> "
-                    f"with markers <b>{marker}</b>"
+                    f"<c1>{d.name}</c1> <fg=default>(<c2>{d.pretty_constraint}</c2>)</>"
+                    f" with markers <b>{marker}</b>"
                 )
 
             warnings = ", ".join(fmt_warning(d) for d in _deps[:-1])
@@ -673,7 +676,8 @@ def fmt_warning(d: "Dependency") -> str:
                         dep_other.set_constraint(
                             dep_other.constraint.intersect(dep_any.constraint)
                         )
-                        # TODO: Setting _pretty_constraint can be removed once the following issue has been fixed
+                        # TODO: Setting _pretty_constraint can be removed once the
+                        # following issue has been fixed:
                         # https://github.com/python-poetry/poetry/issues/4589
                         dep_other._pretty_constraint = str(dep_other.constraint)
 
@@ -765,7 +769,10 @@ def debug(self, message: str, depth: int = 0) -> None:
         elif message.startswith("derived:"):
             m = re.match(r"derived: (.+?) \((.+?)\)$", message)
             if m:
-                message = f"<fg=blue>derived</>: <c1>{m.group(1)}</c1> (<c2>{m.group(2)}</c2>)"
+                message = (
+                    f"<fg=blue>derived</>: <c1>{m.group(1)}</c1>"
+                    f" (<c2>{m.group(2)}</c2>)"
+                )
             else:
                 message = (
                     f"<fg=blue>derived</>: <c1>{message.split('derived: ')[1]}</c1>"
@@ -786,7 +793,10 @@ def debug(self, message: str, depth: int = 0) -> None:
                     f"depends on <c1>{m.group(2)}</c1> (<c2>{m.group(3)}</c2>)"
                 )
             else:
-                message = f"<fg=red;options=bold>conflict</>: {message.split('conflict: ')[1]}"
+                message = (
+                    "<fg=red;options=bold>conflict</>:"
+                    f" {message.split('conflict: ')[1]}"
+                )
 
         message = message.replace("! ", "<error>!</error> ")
 
diff --git a/src/poetry/puzzle/solver.py b/src/poetry/puzzle/solver.py
index cf9d7e7b443..80e32d43b48 100644
--- a/src/poetry/puzzle/solver.py
+++ b/src/poetry/puzzle/solver.py
@@ -78,10 +78,12 @@ def solve(self, use_latest: List[str] = None) -> "Transaction":
 
             if len(self._overrides) > 1:
                 self._provider.debug(
-                    f"Complete version solving took {end - start:.3f} seconds with {len(self._overrides)} overrides"
+                    f"Complete version solving took {end - start:.3f} seconds with"
+                    f" {len(self._overrides)} overrides"
                 )
                 self._provider.debug(
-                    f"Resolved with overrides: {', '.join(f'({b})' for b in self._overrides)}"
+                    "Resolved with overrides:"
+                    f" {', '.join(f'({b})' for b in self._overrides)}"
                 )
 
         return Transaction(
@@ -140,7 +142,8 @@ def _solve(self, use_latest: List[str] = None) -> Tuple[List["Package"], List[in
         except SolveFailure as e:
             raise SolverProblemError(e)
 
-        # NOTE passing explicit empty array for seen to reset between invocations during update + install cycle
+        # NOTE passing explicit empty array for seen to reset between invocations during
+        # update + install cycle
         results = dict(
             depth_first_search(
                 PackageNode(self._package, packages, seen=[]), aggregate_package_nodes
diff --git a/src/poetry/puzzle/transaction.py b/src/poetry/puzzle/transaction.py
index 379ddbcbcae..858ac2b862e 100644
--- a/src/poetry/puzzle/transaction.py
+++ b/src/poetry/puzzle/transaction.py
@@ -79,9 +79,9 @@ def calculate_operations(
                 current_package_names = {
                     current_package.name for current_package in self._current_packages
                 }
-                # We preserve pip/setuptools/wheel when not managed by poetry, this is done
-                # to avoid externally managed virtual environments causing unnecessary
-                # removals.
+                # We preserve pip/setuptools/wheel when not managed by poetry, this is
+                # done to avoid externally managed virtual environments causing
+                # unnecessary removals.
                 preserved_package_names = {
                     "pip",
                     "setuptools",
diff --git a/src/poetry/repositories/installed_repository.py b/src/poetry/repositories/installed_repository.py
index a39207864c9..b4c9f848bbc 100644
--- a/src/poetry/repositories/installed_repository.py
+++ b/src/poetry/repositories/installed_repository.py
@@ -49,8 +49,8 @@ def get_package_paths(cls, env: "Env", name: str) -> Set[Path]:
         paths = set()
 
         # we identify the candidate pth files to check, this is done so to handle cases
-        # where the pth file for foo-bar might have been installed as either foo-bar.pth or
-        # foo_bar.pth (expected) in either pure or platform lib directories.
+        # where the pth file for foo-bar might have been installed as either foo-bar.pth
+        # or foo_bar.pth (expected) in either pure or platform lib directories.
         candidates = itertools.product(
             {env.purelib, env.platlib},
             {name, module_name(name)},
diff --git a/src/poetry/repositories/legacy_repository.py b/src/poetry/repositories/legacy_repository.py
index cd147914c81..23c9223d323 100644
--- a/src/poetry/repositories/legacy_repository.py
+++ b/src/poetry/repositories/legacy_repository.py
@@ -342,7 +342,8 @@ def _get_release_info(self, name: str, version: str) -> dict:
         links = list(page.links_for_version(Version.parse(version)))
         if not links:
             raise PackageNotFound(
-                f'No valid distribution links found for package: "{name}" version: "{version}"'
+                f'No valid distribution links found for package: "{name}" version:'
+                f' "{version}"'
             )
         urls = defaultdict(list)
         files = []
diff --git a/src/poetry/repositories/pypi_repository.py b/src/poetry/repositories/pypi_repository.py
index 41cb85997e1..6caf68234ab 100644
--- a/src/poetry/repositories/pypi_repository.py
+++ b/src/poetry/repositories/pypi_repository.py
@@ -121,7 +121,8 @@ def find_packages(self, dependency: Dependency) -> List[Package]:
             if not release:
                 # Bad release
                 self._log(
-                    f"No release information found for {dependency.name}-{version}, skipping",
+                    f"No release information found for {dependency.name}-{version},"
+                    " skipping",
                     level="debug",
                 )
                 continue
@@ -130,7 +131,8 @@ def find_packages(self, dependency: Dependency) -> List[Package]:
                 package = Package(info["info"]["name"], version)
             except InvalidVersion:
                 self._log(
-                    f'Unable to parse version "{version}" for the {dependency.name} package, skipping',
+                    f'Unable to parse version "{version}" for the'
+                    f" {dependency.name} package, skipping",
                     level="debug",
                 )
                 continue
@@ -183,7 +185,8 @@ def search(self, query: str) -> List[Package]:
                 results.append(result)
             except InvalidVersion:
                 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",
                 )
 
diff --git a/src/poetry/utils/env.py b/src/poetry/utils/env.py
index 5c10d0ef000..9760b26b5a6 100644
--- a/src/poetry/utils/env.py
+++ b/src/poetry/utils/env.py
@@ -117,7 +117,9 @@ def _version_nodot(version):
     "sys_platform": sys.platform,
     "version_info": tuple(sys.version_info),
     # Extra information
-    "interpreter_name": INTERPRETER_SHORT_NAMES.get(implementation_name, implementation_name),
+    "interpreter_name": INTERPRETER_SHORT_NAMES.get(
+        implementation_name, implementation_name
+    ),
     "interpreter_version": interpreter_version(),
 }
 
@@ -262,7 +264,8 @@ def make_candidates(
 
         if not results and strict:
             raise RuntimeError(
-                f'Unable to find a suitable destination for "{path}" in {paths_csv(self._candidates)}'
+                f'Unable to find a suitable destination for "{path}" in'
+                f" {paths_csv(self._candidates)}"
             )
 
         return results
@@ -416,7 +419,10 @@ class EnvCommandError(EnvError):
     def __init__(self, e: CalledProcessError, input: Optional[str] = None) -> None:
         self.e = e
 
-        message = f"Command {e.cmd} errored with the following return code {e.returncode}, and output: \n{decode(e.output)}"
+        message = (
+            f"Command {e.cmd} errored with the following return code {e.returncode},"
+            f" and output: \n{decode(e.output)}"
+        )
         if input:
             message += f"input was : {input}"
         super().__init__(message)
@@ -481,7 +487,8 @@ def activate(self, python: str, io: "IO") -> "Env":
                         [
                             python,
                             "-c",
-                            "\"import sys; print('.'.join([str(s) for s in sys.version_info[:3]]))\"",
+                            "\"import sys; print('.'.join([str(s) for s in"
+                            ' sys.version_info[:3]]))"',
                         ]
                     ),
                     shell=True,
@@ -727,7 +734,8 @@ def remove(self, python: str) -> "Env":
                         [
                             python,
                             "-c",
-                            "\"import sys; print('.'.join([str(s) for s in sys.version_info[:3]]))\"",
+                            "\"import sys; print('.'.join([str(s) for s in"
+                            ' sys.version_info[:3]]))"',
                         ]
                     ),
                     shell=True,
@@ -802,7 +810,8 @@ def create_venv(
                         [
                             executable,
                             "-c",
-                            "\"import sys; print('.'.join([str(s) for s in sys.version_info[:3]]))\"",
+                            "\"import sys; print('.'.join([str(s) for s in"
+                            ' sys.version_info[:3]]))"',
                         ]
                     ),
                     shell=True,
@@ -824,8 +833,8 @@ def create_venv(
                 )
 
             io.write_line(
-                f"<warning>The currently activated Python version {python_patch} "
-                f"is not supported by the project ({self._poetry.package.python_versions}).\n"
+                f"<warning>The currently activated Python version {python_patch} is not"
+                f" supported by the project ({self._poetry.package.python_versions}).\n"
                 "Trying to find and use a compatible version.</warning> "
             )
 
@@ -856,7 +865,8 @@ def create_venv(
                                 [
                                     python,
                                     "-c",
-                                    "\"import sys; print('.'.join([str(s) for s in sys.version_info[:3]]))\"",
+                                    "\"import sys; print('.'.join([str(s) for s in"
+                                    ' sys.version_info[:3]]))"',
                                 ]
                             ),
                             stderr=subprocess.STDOUT,
@@ -904,7 +914,8 @@ def create_venv(
             if force:
                 if not env.is_sane():
                     io.write_line(
-                        f"<warning>The virtual environment found in {env.path} seems to be broken.</warning>"
+                        f"<warning>The virtual environment found in {env.path} seems to"
+                        " be broken.</warning>"
                     )
                 io.write_line(f"Recreating virtualenv <c1>{name}</> in {venv!s}")
                 self.remove_venv(venv)
@@ -965,7 +976,8 @@ def build_venv(
             else flags.pop("no-setuptools", True)
         )
 
-        # we want wheels to be enabled when pip is required and it has not been explicitly disabled
+        # we want wheels to be enabled when pip is required and it has not been
+        # explicitly disabled
         flags["no-wheel"] = (
             not with_wheel
             if with_wheel is not None
@@ -1174,7 +1186,8 @@ def pip(self) -> str:
         """
         Path to current pip executable
         """
-        # we do not use as_posix() here due to issues with windows pathlib2 implementation
+        # we do not use as_posix() here due to issues with windows pathlib2
+        # implementation
         path = self._bin(self._pip_executable)
         if not Path(path).exists():
             return str(self.pip_embedded)
diff --git a/src/poetry/utils/pip.py b/src/poetry/utils/pip.py
index 807659fb8a4..e2afd0ad379 100644
--- a/src/poetry/utils/pip.py
+++ b/src/poetry/utils/pip.py
@@ -28,9 +28,10 @@ def pip_install(
     path = url_to_path(path.url) if isinstance(path, Link) else path
     is_wheel = path.suffix == ".whl"
 
-    # We disable version check here as we are already pinning to version available in either the
-    # virtual environment or the virtualenv package embedded wheel. Version checks are a wasteful
-    # network call that adds a lot of wait time when installing a lot of packages.
+    # We disable version check here as we are already pinning to version available in
+    # either the virtual environment or the virtualenv package embedded wheel. Version
+    # checks are a wasteful network call that adds a lot of wait time when installing a
+    # lot of packages.
     args = ["install", "--disable-pip-version-check", "--prefix", str(environment.path)]
 
     if not is_wheel:
@@ -55,8 +56,9 @@ def pip_install(
         return environment.run_pip(*args)
     except EnvCommandError as e:
         if sys.version_info < (3, 7) and not is_wheel:
-            # Under certain Python3.6 installs vendored pip wheel does not contain zip-safe
-            # pep517 lib. In this cases we create an isolated ephemeral virtual environment.
+            # Under certain Python3.6 installs vendored pip wheel does not contain
+            # zip-safe pep517 lib. In this cases we create an isolated ephemeral virtual
+            # environment.
             with ephemeral_environment(
                 executable=environment.python, with_pip=True, with_setuptools=True
             ) as env:
diff --git a/tests/console/commands/plugin/test_add.py b/tests/console/commands/plugin/test_add.py
index 0b029f3fa27..c26ccde4da8 100644
--- a/tests/console/commands/plugin/test_add.py
+++ b/tests/console/commands/plugin/test_add.py
@@ -192,12 +192,15 @@ def test_add_existing_plugin_warns_about_no_operation(
     tester.execute("poetry-plugin")
 
     expected = """\
-The following plugins are already present in the pyproject.toml file and will be skipped:
+The following plugins are already present in the pyproject.toml file and will be\
+ skipped:
 
   • poetry-plugin
 
-If you want to update it to the latest compatible version, you can use `poetry plugin update package`.
-If you prefer to upgrade it to the latest available version, you can use `poetry plugin add package@latest`.
+If you want to update it to the latest compatible version,\
+ you can use `poetry plugin update package`.
+If you prefer to upgrade it to the latest available version,\
+ you can use `poetry plugin add package@latest`.
 
 """
 
diff --git a/tests/console/commands/source/test_add.py b/tests/console/commands/source/test_add.py
index db755e310ef..6d225826a1f 100644
--- a/tests/console/commands/source/test_add.py
+++ b/tests/console/commands/source/test_add.py
@@ -78,7 +78,8 @@ def test_source_add_error_pypi(tester: "CommandTester"):
     tester.execute("pypi https://test.pypi.org/simple/")
     assert (
         tester.io.fetch_error().strip()
-        == "Failed to validate addition of pypi: The name [pypi] is reserved for repositories"
+        == "Failed to validate addition of pypi: The name [pypi] is reserved for"
+        " repositories"
     )
     assert tester.status_code == 1
 
@@ -89,7 +90,7 @@ def test_source_add_existing(
     tester.execute(f"--default {source_existing.name} {source_existing.url}")
     assert (
         tester.io.fetch_output().strip()
-        == f"Source with name {source_existing.name} already exits. Updating."
+        == f"Source with name {source_existing.name} already exists. Updating."
     )
 
     poetry_with_source.pyproject.reload()
diff --git a/tests/console/commands/test_about.py b/tests/console/commands/test_about.py
index 4110fa15c41..61e57069b78 100644
--- a/tests/console/commands/test_about.py
+++ b/tests/console/commands/test_about.py
@@ -19,7 +19,8 @@ def test_about(tester: "CommandTester"):
     expected = """\
 Poetry - Package Management for Python
 
-Poetry is a dependency manager tracking local dependencies of your projects and libraries.
+Poetry is a dependency manager tracking local dependencies of your projects and\
+ libraries.
 See https://github.com/python-poetry/poetry for more information.
 """
 
diff --git a/tests/console/commands/test_add.py b/tests/console/commands/test_add.py
index 841b44fb565..96816fde992 100644
--- a/tests/console/commands/test_add.py
+++ b/tests/console/commands/test_add.py
@@ -77,7 +77,8 @@ def test_add_no_constraint_editable_error(
     tester.execute("-e cachy")
 
     expected = """
-Failed to add packages. Only vcs/path dependencies support editable installs. cachy is neither.
+Failed to add packages. Only vcs/path dependencies support editable installs.\
+ cachy is neither.
 
 No changes were applied.
 """
@@ -565,7 +566,8 @@ def test_add_url_constraint_wheel(
 Package operations: 2 installs, 0 updates, 0 removals
 
   • Installing pendulum (1.4.4)
-  • Installing demo (0.1.0 https://python-poetry.org/distributions/demo-0.1.0-py2.py3-none-any.whl)
+  • Installing demo\
+ (0.1.0 https://python-poetry.org/distributions/demo-0.1.0-py2.py3-none-any.whl)
 """
 
     assert expected == tester.io.fetch_output()
@@ -590,7 +592,8 @@ def test_add_url_constraint_wheel_with_extras(
     repo.add_package(get_package("tomlkit", "0.5.5"))
 
     tester.execute(
-        "https://python-poetry.org/distributions/demo-0.1.0-py2.py3-none-any.whl[foo,bar]"
+        "https://python-poetry.org/distributions/demo-0.1.0-py2.py3-none-any.whl"
+        "[foo,bar]"
     )
 
     expected = """\
@@ -605,7 +608,8 @@ def test_add_url_constraint_wheel_with_extras(
   • Installing cleo (0.6.5)
   • Installing pendulum (1.4.4)
   • Installing tomlkit (0.5.5)
-  • Installing demo (0.1.0 https://python-poetry.org/distributions/demo-0.1.0-py2.py3-none-any.whl)
+  • Installing demo\
+ (0.1.0 https://python-poetry.org/distributions/demo-0.1.0-py2.py3-none-any.whl)
 """
     # Order might be different, split into lines and compare the overall output.
     expected = set(expected.splitlines())
@@ -617,7 +621,9 @@ def test_add_url_constraint_wheel_with_extras(
 
     assert "demo" in content["dependencies"]
     assert content["dependencies"]["demo"] == {
-        "url": "https://python-poetry.org/distributions/demo-0.1.0-py2.py3-none-any.whl",
+        "url": (
+            "https://python-poetry.org/distributions/demo-0.1.0-py2.py3-none-any.whl"
+        ),
         "extras": ["foo", "bar"],
     }
 
@@ -873,8 +879,10 @@ def test_add_should_skip_when_adding_existing_package_with_no_constraint(
 
   • foo
 
-If you want to update it to the latest compatible version, you can use `poetry update package`.
-If you prefer to upgrade it to the latest available version, you can use `poetry add package@latest`.
+If you want to update it to the latest compatible version,\
+ you can use `poetry update package`.
+If you prefer to upgrade it to the latest available version,\
+ you can use `poetry add package@latest`.
 """
 
     assert expected in tester.io.fetch_output()
@@ -1502,7 +1510,8 @@ def test_add_url_constraint_wheel_old_installer(
 Package operations: 2 installs, 0 updates, 0 removals
 
   - Installing pendulum (1.4.4)
-  - Installing demo (0.1.0 https://python-poetry.org/distributions/demo-0.1.0-py2.py3-none-any.whl)
+  - Installing demo\
+ (0.1.0 https://python-poetry.org/distributions/demo-0.1.0-py2.py3-none-any.whl)
 """
 
     assert expected == old_tester.io.fetch_output()
@@ -1528,7 +1537,8 @@ def test_add_url_constraint_wheel_with_extras_old_installer(
     repo.add_package(get_package("tomlkit", "0.5.5"))
 
     old_tester.execute(
-        "https://python-poetry.org/distributions/demo-0.1.0-py2.py3-none-any.whl[foo,bar]"
+        "https://python-poetry.org/distributions/demo-0.1.0-py2.py3-none-any.whl"
+        "[foo,bar]"
     )
 
     expected = """\
@@ -1543,7 +1553,8 @@ def test_add_url_constraint_wheel_with_extras_old_installer(
   - Installing cleo (0.6.5)
   - Installing pendulum (1.4.4)
   - Installing tomlkit (0.5.5)
-  - Installing demo (0.1.0 https://python-poetry.org/distributions/demo-0.1.0-py2.py3-none-any.whl)
+  - Installing demo\
+ (0.1.0 https://python-poetry.org/distributions/demo-0.1.0-py2.py3-none-any.whl)
 """
 
     assert expected == old_tester.io.fetch_output()
@@ -1554,7 +1565,9 @@ def test_add_url_constraint_wheel_with_extras_old_installer(
 
     assert "demo" in content["dependencies"]
     assert content["dependencies"]["demo"] == {
-        "url": "https://python-poetry.org/distributions/demo-0.1.0-py2.py3-none-any.whl",
+        "url": (
+            "https://python-poetry.org/distributions/demo-0.1.0-py2.py3-none-any.whl"
+        ),
         "extras": ["foo", "bar"],
     }
 
@@ -1791,14 +1804,16 @@ def test_add_should_skip_when_adding_existing_package_with_no_constraint_old_ins
 
   • foo
 
-If you want to update it to the latest compatible version, you can use `poetry update package`.
-If you prefer to upgrade it to the latest available version, you can use `poetry add package@latest`.
+If you want to update it to the latest compatible version,\
+ you can use `poetry update package`.
+If you prefer to upgrade it to the latest available version,\
+ you can use `poetry add package@latest`.
 """
 
     assert expected in old_tester.io.fetch_output()
 
 
-def test_add_should_work_when_adding_existing_package_with_latest_constraint_old_installer(
+def test_add_should_work_when_adding_existing_package_with_latest_constraint_old_installer(  # noqa: E501
     app: "PoetryTestApplication",
     repo: "TestRepository",
     installer: "NoopInstaller",
diff --git a/tests/console/commands/test_check.py b/tests/console/commands/test_check.py
index 7e1ddb86b9e..e971789fb3b 100644
--- a/tests/console/commands/test_check.py
+++ b/tests/console/commands/test_check.py
@@ -39,8 +39,10 @@ def test_check_invalid(mocker: "MockerFixture", tester: "CommandTester"):
 
     expected = """\
 Error: 'description' is a required property
-Warning: A wildcard Python dependency is ambiguous. Consider specifying a more explicit one.
-Warning: The "pendulum" dependency specifies the "allows-prereleases" property, which is deprecated. Use "allow-prereleases" instead.
+Warning: A wildcard Python dependency is ambiguous.\
+ Consider specifying a more explicit one.
+Warning: The "pendulum" dependency specifies the "allows-prereleases" property,\
+ which is deprecated. Use "allow-prereleases" instead.
 """
 
     assert expected == tester.io.fetch_output()
diff --git a/tests/console/commands/test_search.py b/tests/console/commands/test_search.py
index 14f4b5c5d88..b295bdacd97 100644
--- a/tests/console/commands/test_search.py
+++ b/tests/console/commands/test_search.py
@@ -67,7 +67,8 @@ def test_search(tester: "CommandTester", http: Type["httpretty.httpretty"]):
  Python wrapper for the CircleCI API
 
 sqlalchemy-nav (0.0.2)
- SQLAlchemy-Nav provides SQLAlchemy Mixins for creating navigation bars compatible with Bootstrap
+ SQLAlchemy-Nav provides SQLAlchemy Mixins for creating navigation bars compatible with\
+ Bootstrap
 
 sqlalchemy-repr (0.0.1)
  Automatically generates pretty repr of a SQLAlchemy model.
diff --git a/tests/console/commands/test_show.py b/tests/console/commands/test_show.py
index ebc3f33b573..c2f7835caf2 100644
--- a/tests/console/commands/test_show.py
+++ b/tests/console/commands/test_show.py
@@ -386,8 +386,10 @@ def test_show_latest_decorated(
     tester.execute("--latest", decorated=True)
 
     expected = """\
-\033[36mcachy   \033[39m \033[39;1m0.1.0\033[39;22m \033[33m0.2.0\033[39m Cachy package
-\033[36mpendulum\033[39m \033[39;1m2.0.0\033[39;22m \033[31m2.0.1\033[39m Pendulum package
+\033[36mcachy   \033[39m \033[39;1m0.1.0\033[39;22m\
+ \033[33m0.2.0\033[39m Cachy package
+\033[36mpendulum\033[39m \033[39;1m2.0.0\033[39;22m\
+ \033[31m2.0.1\033[39m Pendulum package
 """
 
     assert expected == tester.io.fetch_output()
@@ -898,7 +900,9 @@ def test_show_outdated_git_dev_dependency(
                     "source": {
                         "type": "git",
                         "reference": "9cf87a285a2d3fbb0b9fa621997b3acc3631ed24",
-                        "resolved_reference": "9cf87a285a2d3fbb0b9fa621997b3acc3631ed24",
+                        "resolved_reference": (
+                            "9cf87a285a2d3fbb0b9fa621997b3acc3631ed24"
+                        ),
                         "url": "https://github.com/demo/demo.git",
                     },
                 },
diff --git a/tests/helpers.py b/tests/helpers.py
index 40e84d23f9e..3c208ab6cc5 100644
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -216,6 +216,7 @@ def find_packages(self, dependency: "Dependency") -> List[Package]:
     def find_links_for_package(self, package: Package) -> List[Link]:
         return [
             Link(
-                f"https://foo.bar/files/{escape_name(package.name)}-{escape_version(package.version.text)}-py2.py3-none-any.whl"
+                f"https://foo.bar/files/{escape_name(package.name)}"
+                f"-{escape_version(package.version.text)}-py2.py3-none-any.whl"
             )
         ]
diff --git a/tests/inspection/test_info.py b/tests/inspection/test_info.py
index d2eada446c9..075fd931e87 100644
--- a/tests/inspection/test_info.py
+++ b/tests/inspection/test_info.py
@@ -90,7 +90,7 @@ def demo_setup_complex(source_dir: Path) -> Path:
 def demo_setup_complex_pep517_legacy(demo_setup_complex: Path) -> Path:
     pyproject_toml = demo_setup_complex / "pyproject.toml"
     pyproject_toml.write_text(
-        decode("[build-system]\n" 'requires = ["setuptools", "wheel"]')
+        decode('[build-system]\nrequires = ["setuptools", "wheel"]')
     )
     return demo_setup_complex
 
diff --git a/tests/installation/test_chef.py b/tests/installation/test_chef.py
index 783c09fcd41..bee9b2a7268 100644
--- a/tests/installation/test_chef.py
+++ b/tests/installation/test_chef.py
@@ -83,7 +83,8 @@ def test_get_cache_directory_for_link(config: "Config", config_cache_dir: Path):
     )
 
     expected = Path(
-        f"{config_cache_dir.as_posix()}/artifacts/ba/63/13/283a3b3b7f95f05e9e6f84182d276f7bb0951d5b0cc24422b33f7a4648"
+        f"{config_cache_dir.as_posix()}/artifacts/ba/63/13/"
+        "283a3b3b7f95f05e9e6f84182d276f7bb0951d5b0cc24422b33f7a4648"
     )
 
     assert expected == directory
diff --git a/tests/installation/test_chooser.py b/tests/installation/test_chooser.py
index b55dc7227da..0fb40affe0c 100644
--- a/tests/installation/test_chooser.py
+++ b/tests/installation/test_chooser.py
@@ -207,7 +207,7 @@ def test_chooser_chooses_distributions_that_match_the_package_hashes(
     package = Package("isort", "4.3.4")
     files = [
         {
-            "hash": "sha256:b9c40e9750f3d77e6e4d441d8b0266cf555e7cdabdcff33c4fd06366ca761ef8",
+            "hash": "sha256:b9c40e9750f3d77e6e4d441d8b0266cf555e7cdabdcff33c4fd06366ca761ef8",  # noqa: E501
             "filename": "isort-4.3.4.tar.gz",
         }
     ]
@@ -240,7 +240,7 @@ def test_chooser_throws_an_error_if_package_hashes_do_not_match(
     package = Package("isort", "4.3.4")
     files = [
         {
-            "hash": "sha256:0000000000000000000000000000000000000000000000000000000000000000",
+            "hash": "sha256:0000000000000000000000000000000000000000000000000000000000000000",  # noqa: E501
             "filename": "isort-4.3.4.tar.gz",
         }
     ]
diff --git a/tests/installation/test_executor.py b/tests/installation/test_executor.py
index e93035520a7..ed08113528f 100644
--- a/tests/installation/test_executor.py
+++ b/tests/installation/test_executor.py
@@ -252,11 +252,23 @@ def test_execute_works_with_ansi_output(
     env._run.assert_called_once()
 
     expected = [
-        "\x1b[39;1mPackage operations\x1b[39;22m: \x1b[34m1\x1b[39m install, \x1b[34m0\x1b[39m updates, \x1b[34m0\x1b[39m removals",
-        "\x1b[34;1m•\x1b[39;22m \x1b[39mInstalling \x1b[39m\x1b[36mpytest\x1b[39m\x1b[39m (\x1b[39m\x1b[39;1m3.5.2\x1b[39;22m\x1b[39m)\x1b[39m: \x1b[34mPending...\x1b[39m",
-        "\x1b[34;1m•\x1b[39;22m \x1b[39mInstalling \x1b[39m\x1b[36mpytest\x1b[39m\x1b[39m (\x1b[39m\x1b[39;1m3.5.2\x1b[39;22m\x1b[39m)\x1b[39m: \x1b[34mDownloading...\x1b[39m",
-        "\x1b[34;1m•\x1b[39;22m \x1b[39mInstalling \x1b[39m\x1b[36mpytest\x1b[39m\x1b[39m (\x1b[39m\x1b[39;1m3.5.2\x1b[39;22m\x1b[39m)\x1b[39m: \x1b[34mInstalling...\x1b[39m",
-        "\x1b[32;1m•\x1b[39;22m \x1b[39mInstalling \x1b[39m\x1b[36mpytest\x1b[39m\x1b[39m (\x1b[39m\x1b[32m3.5.2\x1b[39m\x1b[39m)\x1b[39m",  # finished
+        "\x1b[39;1mPackage operations\x1b[39;22m: \x1b[34m1\x1b[39m install,"
+        " \x1b[34m0\x1b[39m updates, \x1b[34m0\x1b[39m removals",
+        "\x1b[34;1m•\x1b[39;22m \x1b[39mInstalling"
+        " \x1b[39m\x1b[36mpytest\x1b[39m\x1b[39m"
+        " (\x1b[39m\x1b[39;1m3.5.2\x1b[39;22m\x1b[39m)\x1b[39m:"
+        " \x1b[34mPending...\x1b[39m",
+        "\x1b[34;1m•\x1b[39;22m \x1b[39mInstalling"
+        " \x1b[39m\x1b[36mpytest\x1b[39m\x1b[39m"
+        " (\x1b[39m\x1b[39;1m3.5.2\x1b[39;22m\x1b[39m)\x1b[39m:"
+        " \x1b[34mDownloading...\x1b[39m",
+        "\x1b[34;1m•\x1b[39;22m \x1b[39mInstalling"
+        " \x1b[39m\x1b[36mpytest\x1b[39m\x1b[39m"
+        " (\x1b[39m\x1b[39;1m3.5.2\x1b[39;22m\x1b[39m)\x1b[39m:"
+        " \x1b[34mInstalling...\x1b[39m",
+        "\x1b[32;1m•\x1b[39;22m \x1b[39mInstalling"
+        " \x1b[39m\x1b[36mpytest\x1b[39m\x1b[39m"
+        " (\x1b[39m\x1b[32m3.5.2\x1b[39m\x1b[39m)\x1b[39m",  # finished
     ]
     output = io_decorated.fetch_output()
     # hint: use print(repr(output)) if you need to debug this
@@ -542,7 +554,7 @@ def test_executor_should_use_cached_link_and_hash(
     package.files = [
         {
             "file": "demo-0.1.0-py2.py3-none-any.whl",
-            "hash": "sha256:70e704135718fffbcbf61ed1fc45933cfd86951a744b681000eaaa75da31f17a",
+            "hash": "sha256:70e704135718fffbcbf61ed1fc45933cfd86951a744b681000eaaa75da31f17a",  # noqa: E501
         }
     ]
 
diff --git a/tests/installation/test_installer.py b/tests/installation/test_installer.py
index a20324ef3ac..1218ff21adb 100644
--- a/tests/installation/test_installer.py
+++ b/tests/installation/test_installer.py
@@ -497,7 +497,7 @@ def test_run_install_does_not_remove_locked_packages_if_installed_but_not_requir
     assert installer.executor.removals_count == 0
 
 
-def test_run_install_removes_locked_packages_if_installed_and_synchronization_is_required(
+def test_run_install_removes_locked_packages_if_installed_and_synchronization_is_required(  # noqa: E501
     installer: Installer,
     locker: Locker,
     repo: Repository,
@@ -1873,7 +1873,7 @@ def test_run_install_duplicate_dependencies_different_constraints_with_lock_upda
 @pytest.mark.skip(
     "This is not working at the moment due to limitations in the resolver"
 )
-def test_installer_test_solver_finds_compatible_package_for_dependency_python_not_fully_compatible_with_package_python(
+def test_installer_test_solver_finds_compatible_package_for_dependency_python_not_fully_compatible_with_package_python(  # noqa: E501
     installer: Installer,
     locker: Locker,
     repo: Repository,
@@ -1901,7 +1901,7 @@ def test_installer_test_solver_finds_compatible_package_for_dependency_python_no
     assert installer.executor.installations_count == 1
 
 
-def test_installer_required_extras_should_not_be_removed_when_updating_single_dependency(
+def test_installer_required_extras_should_not_be_removed_when_updating_single_dependency(  # noqa: E501
     installer: Installer,
     locker: Locker,
     repo: Repository,
@@ -1968,7 +1968,7 @@ def test_installer_required_extras_should_not_be_removed_when_updating_single_de
     assert installer.executor.removals_count == 0
 
 
-def test_installer_required_extras_should_not_be_removed_when_updating_single_dependency_pypi_repository(
+def test_installer_required_extras_should_not_be_removed_when_updating_single_dependency_pypi_repository(  # noqa: E501
     locker: Locker,
     repo: Repository,
     package: ProjectPackage,
diff --git a/tests/installation/test_installer_old.py b/tests/installation/test_installer_old.py
index 992d35d9523..ca9cf40bc28 100644
--- a/tests/installation/test_installer_old.py
+++ b/tests/installation/test_installer_old.py
@@ -1532,7 +1532,7 @@ def test_run_install_duplicate_dependencies_different_constraints_with_lock_upda
 @pytest.mark.skip(
     "This is not working at the moment due to limitations in the resolver"
 )
-def test_installer_test_solver_finds_compatible_package_for_dependency_python_not_fully_compatible_with_package_python(
+def test_installer_test_solver_finds_compatible_package_for_dependency_python_not_fully_compatible_with_package_python(  # noqa: E501
     installer: Installer,
     locker: Locker,
     repo: Repository,
@@ -1562,7 +1562,7 @@ def test_installer_test_solver_finds_compatible_package_for_dependency_python_no
     assert len(installs) == 1
 
 
-def test_installer_required_extras_should_not_be_removed_when_updating_single_dependency(
+def test_installer_required_extras_should_not_be_removed_when_updating_single_dependency(  # noqa: E501
     installer: Installer,
     locker: Locker,
     repo: Repository,
@@ -1621,7 +1621,7 @@ def test_installer_required_extras_should_not_be_removed_when_updating_single_de
     assert len(installer.installer.removals) == 0
 
 
-def test_installer_required_extras_should_not_be_removed_when_updating_single_dependency_pypi_repository(
+def test_installer_required_extras_should_not_be_removed_when_updating_single_dependency_pypi_repository(  # noqa: E501
     locker: Locker,
     repo: Repository,
     package: ProjectPackage,
diff --git a/tests/masonry/builders/test_editable_builder.py b/tests/masonry/builders/test_editable_builder.py
index 604f5b80fe6..67ce0d2cea5 100644
--- a/tests/masonry/builders/test_editable_builder.py
+++ b/tests/masonry/builders/test_editable_builder.py
@@ -104,7 +104,8 @@ def test_builder_installs_proper_files_for_standard_packages(
     assert dist_info.joinpath("INSTALLER").read_text() == "poetry"
     assert (
         dist_info.joinpath("entry_points.txt").read_text()
-        == "[console_scripts]\nbaz=bar:baz.boom.bim\nfoo=foo:bar\nfox=fuz.foo:bar.baz\n\n"
+        == "[console_scripts]\nbaz=bar:baz.boom.bim\nfoo=foo:bar\n"
+        "fox=fuz.foo:bar.baz\n\n"
     )
 
     metadata = """\
diff --git a/tests/mixology/solutions/solutions/test_python_requirement_solution.py b/tests/mixology/solutions/solutions/test_python_requirement_solution.py
index f0fda6f2f22..3cccef48b32 100644
--- a/tests/mixology/solutions/solutions/test_python_requirement_solution.py
+++ b/tests/mixology/solutions/solutions/test_python_requirement_solution.py
@@ -24,8 +24,8 @@ def test_it_provides_the_correct_solution():
 For foo, a possible solution would be to set the `python` property to ">=3.6,<4.0"\
 """
     links = [
-        "https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies",
-        "https://python-poetry.org/docs/dependency-specification/#using-environment-markers",
+        "https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies",  # noqa: E501
+        "https://python-poetry.org/docs/dependency-specification/#using-environment-markers",  # noqa: E501
     ]
 
     assert title == solution.solution_title
diff --git a/tests/mixology/version_solver/test_python_constraint.py b/tests/mixology/version_solver/test_python_constraint.py
index 32db2669d52..f5f4430e85b 100644
--- a/tests/mixology/version_solver/test_python_constraint.py
+++ b/tests/mixology/version_solver/test_python_constraint.py
@@ -19,7 +19,9 @@ def test_dependency_does_not_match_root_python_constraint(
 
     add_to_repo(repo, "foo", "1.0.0", python="<3.5")
 
-    error = """The current project's Python requirement (>=3.6,<4.0) is not compatible with some of the required packages Python requirement:
+    error = """\
+The current project's Python requirement (>=3.6,<4.0) is not compatible with some of\
+ the required packages Python requirement:
   - foo requires Python <3.5, so it will not be satisfied for Python >=3.6,<4.0
 
 Because no versions of foo match !=1.0.0
diff --git a/tests/mixology/version_solver/test_unsolvable.py b/tests/mixology/version_solver/test_unsolvable.py
index c58064a3001..567849937a1 100644
--- a/tests/mixology/version_solver/test_unsolvable.py
+++ b/tests/mixology/version_solver/test_unsolvable.py
@@ -42,9 +42,12 @@ def test_no_version_that_matches_combined_constraints(
 
     error = """\
 Because foo (1.0.0) depends on shared (>=2.0.0 <3.0.0)
- and no versions of shared match >=2.9.0,<3.0.0, foo (1.0.0) requires shared (>=2.0.0,<2.9.0).
-And because bar (1.0.0) depends on shared (>=2.9.0 <4.0.0), bar (1.0.0) is incompatible with foo (1.0.0).
-So, because myapp depends on both foo (1.0.0) and bar (1.0.0), version solving failed."""
+ and no versions of shared match >=2.9.0,<3.0.0,\
+ foo (1.0.0) requires shared (>=2.0.0,<2.9.0).
+And because bar (1.0.0) depends on shared (>=2.9.0 <4.0.0),\
+ bar (1.0.0) is incompatible with foo (1.0.0).
+So, because myapp depends on both foo (1.0.0) and bar (1.0.0), version solving failed.\
+"""
 
     check_solver_result(root, provider, error=error)
 
@@ -62,8 +65,10 @@ def test_disjoint_constraints(
 
     error = """\
 Because bar (1.0.0) depends on shared (>3.0.0)
- and foo (1.0.0) depends on shared (<=2.0.0), bar (1.0.0) is incompatible with foo (1.0.0).
-So, because myapp depends on both foo (1.0.0) and bar (1.0.0), version solving failed."""
+ and foo (1.0.0) depends on shared (<=2.0.0),\
+ bar (1.0.0) is incompatible with foo (1.0.0).
+So, because myapp depends on both foo (1.0.0) and bar (1.0.0), version solving failed.\
+"""
 
     check_solver_result(root, provider, error=error)
     check_solver_result(root, provider, error=error)
diff --git a/tests/mixology/version_solver/test_with_lock.py b/tests/mixology/version_solver/test_with_lock.py
index a7b29c3078a..5fd9dc5e83e 100644
--- a/tests/mixology/version_solver/test_with_lock.py
+++ b/tests/mixology/version_solver/test_with_lock.py
@@ -73,7 +73,7 @@ def test_with_unrelated_locked_dependencies(
     )
 
 
-def test_unlocks_dependencies_if_necessary_to_ensure_that_a_new_dependency_is_statisfied(
+def test_unlocks_dependencies_if_necessary_to_ensure_that_a_new_dependency_is_satisfied(
     root: "ProjectPackage", provider: "Provider", repo: "Repository"
 ):
     root.add_dependency(Factory.create_dependency("foo", "*"))
diff --git a/tests/packages/test_locker.py b/tests/packages/test_locker.py
index d5e915d65bb..9b53b50f4e4 100644
--- a/tests/packages/test_locker.py
+++ b/tests/packages/test_locker.py
@@ -514,7 +514,7 @@ def test_extras_dependencies_are_ordered(locker: Locker, root: ProjectPackage):
     assert expected == content
 
 
-def test_locker_should_neither_emit_warnings_nor_raise_error_for_lower_compatible_versions(
+def test_locker_should_neither_emit_warnings_nor_raise_error_for_lower_compatible_versions(  # noqa: E501
     locker: Locker, caplog: "LogCaptureFixture"
 ):
     current_version = Version.parse(Locker._VERSION)
diff --git a/tests/puzzle/test_solver.py b/tests/puzzle/test_solver.py
index 0f0c2d8d8a6..dacb0b901db 100644
--- a/tests/puzzle/test_solver.py
+++ b/tests/puzzle/test_solver.py
@@ -964,7 +964,7 @@ def test_solver_with_dependency_in_both_default_and_dev_dependencies(
     assert a.category == "main"
 
 
-def test_solver_with_dependency_in_both_main_and_dev_dependencies_with_one_more_dependent(
+def test_solver_with_dependency_in_both_main_and_dev_dependencies_with_one_more_dependent(  # noqa: E501
     solver: Solver, repo: Repository, package: Package
 ):
     package.add_dependency(Factory.create_dependency("A", "*"))
@@ -1466,7 +1466,7 @@ def test_solver_can_resolve_git_dependencies_with_ref(
     assert op.package.source_resolved_reference.startswith("9cf87a2")
 
 
-def test_solver_does_not_trigger_conflict_for_python_constraint_if_python_requirement_is_compatible(
+def test_solver_does_not_trigger_conflict_for_python_constraint_if_python_requirement_is_compatible(  # noqa: E501
     solver: Solver, repo: Repository, package: Package
 ):
     solver.provider.set_package_python_versions("~2.7 || ^3.4")
@@ -1484,7 +1484,7 @@ def test_solver_does_not_trigger_conflict_for_python_constraint_if_python_requir
     check_solver_result(transaction, [{"job": "install", "package": package_a}])
 
 
-def test_solver_does_not_trigger_conflict_for_python_constraint_if_python_requirement_is_compatible_multiple(
+def test_solver_does_not_trigger_conflict_for_python_constraint_if_python_requirement_is_compatible_multiple(  # noqa: E501
     solver: Solver, repo: Repository, package: Package
 ):
     solver.provider.set_package_python_versions("~2.7 || ^3.4")
@@ -1516,7 +1516,7 @@ def test_solver_does_not_trigger_conflict_for_python_constraint_if_python_requir
     )
 
 
-def test_solver_triggers_conflict_for_dependency_python_not_fully_compatible_with_package_python(
+def test_solver_triggers_conflict_for_dependency_python_not_fully_compatible_with_package_python(  # noqa: E501
     solver: Solver, repo: Repository, package: Package
 ):
     solver.provider.set_package_python_versions("~2.7 || ^3.4")
@@ -1533,7 +1533,7 @@ def test_solver_triggers_conflict_for_dependency_python_not_fully_compatible_wit
         solver.solve()
 
 
-def test_solver_finds_compatible_package_for_dependency_python_not_fully_compatible_with_package_python(
+def test_solver_finds_compatible_package_for_dependency_python_not_fully_compatible_with_package_python(  # noqa: E501
     solver: Solver, repo: Repository, package: Package
 ):
     solver.provider.set_package_python_versions("~2.7 || ^3.4")
@@ -1555,7 +1555,7 @@ def test_solver_finds_compatible_package_for_dependency_python_not_fully_compati
     check_solver_result(transaction, [{"job": "install", "package": package_a100}])
 
 
-def test_solver_does_not_trigger_new_resolution_on_duplicate_dependencies_if_only_extras(
+def test_solver_does_not_trigger_new_resolution_on_duplicate_dependencies_if_only_extras(  # noqa: E501
     solver: Solver, repo: Repository, package: Package
 ):
     dep1 = Dependency.create_from_pep_508('B (>=1.0); extra == "foo"')
@@ -1693,7 +1693,8 @@ def test_solver_ignores_dependencies_with_incompatible_python_full_version_marke
     package_a = get_package("A", "1.0.0")
     package_a.add_dependency(
         Dependency.create_from_pep_508(
-            'B (<2.0); platform_python_implementation == "PyPy" and python_full_version < "2.7.9"'
+            'B (<2.0); platform_python_implementation == "PyPy" and python_full_version'
+            ' < "2.7.9"'
         )
     )
 
@@ -1835,7 +1836,9 @@ def test_solver_git_dependencies_short_hash_update_skipped(
                     source_type="git",
                     source_url="https://github.com/demo/demo.git",
                     source_reference="9cf87a285a2d3fbb0b9fa621997b3acc3631ed24",
-                    source_resolved_reference="9cf87a285a2d3fbb0b9fa621997b3acc3631ed24",
+                    source_resolved_reference=(
+                        "9cf87a285a2d3fbb0b9fa621997b3acc3631ed24"
+                    ),
                 ),
                 "skipped": True,
             },
diff --git a/tests/repositories/test_legacy_repository.py b/tests/repositories/test_legacy_repository.py
index f82c4c2413b..39d27f25e2c 100644
--- a/tests/repositories/test_legacy_repository.py
+++ b/tests/repositories/test_legacy_repository.py
@@ -283,11 +283,11 @@ def test_get_package_retrieves_non_sha256_hashes():
     expected = [
         {
             "file": "ipython-7.5.0-py3-none-any.whl",
-            "hash": "sha256:78aea20b7991823f6a32d55f4e963a61590820e43f666ad95ad07c7f0c704efa",
+            "hash": "sha256:78aea20b7991823f6a32d55f4e963a61590820e43f666ad95ad07c7f0c704efa",  # noqa: E501
         },
         {
             "file": "ipython-7.5.0.tar.gz",
-            "hash": "sha256:e840810029224b56cd0d9e7719dc3b39cf84d577f8ac686547c8ba7a06eeab26",
+            "hash": "sha256:e840810029224b56cd0d9e7719dc3b39cf84d577f8ac686547c8ba7a06eeab26",  # noqa: E501
         },
     ]
 
@@ -306,11 +306,11 @@ def test_get_package_retrieves_non_sha256_hashes_mismatching_known_hash():
         },
         {
             "file": "ipython-5.7.0-py3-none-any.whl",
-            "hash": "sha256:fc0464e68f9c65cd8c453474b4175432cc29ecb6c83775baedf6dbfcee9275ab",
+            "hash": "sha256:fc0464e68f9c65cd8c453474b4175432cc29ecb6c83775baedf6dbfcee9275ab",  # noqa: E501
         },
         {
             "file": "ipython-5.7.0.tar.gz",
-            "hash": "sha256:8db43a7fb7619037c98626613ff08d03dda9d5d12c84814a4504c78c0da8323c",
+            "hash": "sha256:8db43a7fb7619037c98626613ff08d03dda9d5d12c84814a4504c78c0da8323c",  # noqa: E501
         },
     ]
 
@@ -325,7 +325,7 @@ def test_get_package_retrieves_packages_with_no_hashes():
     assert [
         {
             "file": "jupyter-1.0.0.tar.gz",
-            "hash": "sha256:d9dc4b3318f310e34c82951ea5d6683f67bed7def4b259fafbfe4f1beb1d8e5f",
+            "hash": "sha256:d9dc4b3318f310e34c82951ea5d6683f67bed7def4b259fafbfe4f1beb1d8e5f",  # noqa: E501
         }
     ] == package.files
 
diff --git a/tests/repositories/test_pypi_repository.py b/tests/repositories/test_pypi_repository.py
index 5ebea3bb304..5efa1e69f91 100644
--- a/tests/repositories/test_pypi_repository.py
+++ b/tests/repositories/test_pypi_repository.py
@@ -104,9 +104,10 @@ def test_package():
     win_inet = package.extras["socks"][0]
     assert win_inet.name == "win-inet-pton"
     assert win_inet.python_versions == "~2.7 || ~2.6"
-    assert str(win_inet.marker) == (
-        'sys_platform == "win32" and (python_version == "2.7" '
-        'or python_version == "2.6") and extra == "socks"'
+    assert (
+        str(win_inet.marker)
+        == 'sys_platform == "win32" and (python_version == "2.7"'
+        ' or python_version == "2.6") and extra == "socks"'
     )
 
 
diff --git a/tests/test_factory.py b/tests/test_factory.py
index adf64ab4844..b15d762c994 100644
--- a/tests/test_factory.py
+++ b/tests/test_factory.py
@@ -103,7 +103,8 @@ def test_create_poetry():
     assert functools32.pretty_constraint == "^3.2.3"
     assert (
         str(functools32.marker)
-        == 'python_version ~= "2.7" and sys_platform == "win32" or python_version in "3.4 3.5"'
+        == 'python_version ~= "2.7" and sys_platform == "win32" or python_version in'
+        ' "3.4 3.5"'
     )
 
     assert "db" in package.extras
diff --git a/tests/utils/test_env.py b/tests/utils/test_env.py
index 1df3de7185a..ee8c4ee9ee6 100644
--- a/tests/utils/test_env.py
+++ b/tests/utils/test_env.py
@@ -795,7 +795,7 @@ def test_call_no_input_with_called_process_error(
     subprocess.call.assert_called_once()
 
 
-def test_create_venv_tries_to_find_a_compatible_python_executable_using_generic_ones_first(
+def test_create_venv_tries_to_find_a_compatible_python_executable_using_generic_ones_first(  # noqa: E501
     manager: EnvManager,
     poetry: "Poetry",
     config: "Config",
diff --git a/tests/utils/test_exporter.py b/tests/utils/test_exporter.py
index 1a0583e7861..da7810db1d1 100644
--- a/tests/utils/test_exporter.py
+++ b/tests/utils/test_exporter.py
@@ -276,8 +276,8 @@ def test_exporter_can_export_requirements_txt_poetry(tmp_dir: str, poetry: "Poet
         content = f.read()
 
     # The dependency graph:
-    # junit-xml 1.9 Creates JUnit XML test result documents that can be read by tools such as Jenkins
-    # └── six *
+    # junit-xml 1.9 Creates JUnit XML test result documents that can be read by tools
+    # └── six *     such as Jenkins
     # poetry 1.1.4 Python dependency management and packaging made easy.
     # ├── keyring >=21.2.0,<22.0.0
     # │   ├── importlib-metadata >=1
@@ -364,11 +364,12 @@ def test_exporter_can_export_requirements_txt_pyinstaller(
         content = f.read()
 
     # Rationale for the results:
-    #  * PyInstaller has an explicit dependency on altgraph, so it must always be installed.
+    #  * PyInstaller has an explicit dependency on altgraph, so it must always be
+    #    installed.
     #  * PyInstaller requires macholib on Darwin, which in turn requires altgraph.
     # The dependency graph:
-    # pyinstaller 4.0 PyInstaller bundles a Python application and all its dependencies into a single package.
-    # ├── altgraph *
+    # pyinstaller 4.0     PyInstaller bundles a Python application and all its
+    # ├── altgraph *      dependencies into a single package.
     # ├── macholib >=1.8 -- only on Darwin
     # │   └── altgraph >=0.15
     expected = {
@@ -453,7 +454,8 @@ def test_exporter_can_export_requirements_txt_with_nested_packages_and_markers(
             "c==7.8.9 ; sys_platform == 'win32' and python_version < '3.7'"
         ),
         "d": Dependency.create_from_pep_508(
-            "d==0.0.1 ; platform_system == 'Windows' and python_version < '3.7' or sys_platform == 'win32' and python_version < '3.7'"
+            "d==0.0.1 ; platform_system == 'Windows' and python_version < '3.7' or"
+            " sys_platform == 'win32' and python_version < '3.7'"
         ),
     }
 
@@ -571,7 +573,7 @@ def test_exporter_can_export_requirements_txt_with_standard_packages_and_hashes(
     assert expected == content
 
 
-def test_exporter_can_export_requirements_txt_with_standard_packages_and_hashes_disabled(
+def test_exporter_can_export_requirements_txt_with_standard_packages_and_hashes_disabled(  # noqa: E501
     tmp_dir: str, poetry: "Poetry"
 ):
     poetry.locker.mock_lock_data(
@@ -1158,7 +1160,7 @@ def test_exporter_can_export_requirements_txt_with_nested_directory_packages(
                     "python-versions": "*",
                     "source": {
                         "type": "directory",
-                        "url": "tests/fixtures/sample_project/../project_with_nested_local/bar",
+                        "url": "tests/fixtures/sample_project/../project_with_nested_local/bar",  # noqa: E501
                         "reference": "",
                     },
                 },
@@ -1170,7 +1172,7 @@ def test_exporter_can_export_requirements_txt_with_nested_directory_packages(
                     "python-versions": "*",
                     "source": {
                         "type": "directory",
-                        "url": "tests/fixtures/sample_project/../project_with_nested_local/bar/..",
+                        "url": "tests/fixtures/sample_project/../project_with_nested_local/bar/..",  # noqa: E501
                         "reference": "",
                     },
                 },
@@ -1237,7 +1239,8 @@ def test_exporter_can_export_requirements_txt_with_directory_packages_and_marker
         content = f.read()
 
     expected = f"""\
-foo @ {working_directory.as_uri()}/tests/fixtures/sample_project ; python_version < "3.7"
+foo @ {working_directory.as_uri()}/tests/fixtures/sample_project\
+ ; python_version < "3.7"
 """
 
     assert expected == content
@@ -1322,7 +1325,8 @@ def test_exporter_can_export_requirements_txt_with_file_packages_and_markers(
         content = f.read()
 
     expected = f"""\
-foo @ {working_directory.as_uri()}/tests/fixtures/distributions/demo-0.1.0.tar.gz ; python_version < "3.7"
+foo @ {working_directory.as_uri()}/tests/fixtures/distributions/demo-0.1.0.tar.gz\
+ ; python_version < "3.7"
 """
 
     assert expected == content
diff --git a/tests/utils/test_helpers.py b/tests/utils/test_helpers.py
index 25b140811e0..e891fd5a6e1 100644
--- a/tests/utils/test_helpers.py
+++ b/tests/utils/test_helpers.py
@@ -27,7 +27,8 @@ def test_parse_requires():
 pyparsing>=2.2.0.0,<3.0.0.0
 requests-toolbelt>=0.8.0.0,<0.9.0.0
 
-[:(python_version >= "2.7.0.0" and python_version < "2.8.0.0") or (python_version >= "3.4.0.0" and python_version < "3.5.0.0")]
+[:(python_version >= "2.7.0.0" and python_version < "2.8.0.0")\
+ or (python_version >= "3.4.0.0" and python_version < "3.5.0.0")]
 typing>=3.6.0.0,<4.0.0.0
 
 [:python_version >= "2.7.0.0" and python_version < "2.8.0.0"]
@@ -39,7 +40,7 @@ def test_parse_requires():
 
 [dev]
 isort@ git+git://github.com/timothycrosley/isort.git@e63ae06ec7d70b06df9e528357650281a3d3ec22#egg=isort
-"""
+"""  # noqa: E501
     result = parse_requires(requires)
     expected = [
         "jsonschema>=2.6.0.0,<3.0.0.0",
@@ -55,11 +56,17 @@ def test_parse_requires():
         "msgpack-python>=0.5.0.0,<0.6.0.0",
         "pyparsing>=2.2.0.0,<3.0.0.0",
         "requests-toolbelt>=0.8.0.0,<0.9.0.0",
-        'typing>=3.6.0.0,<4.0.0.0 ; (python_version >= "2.7.0.0" and python_version < "2.8.0.0") or (python_version >= "3.4.0.0" and python_version < "3.5.0.0")',
-        'virtualenv>=15.2.0.0,<16.0.0.0 ; python_version >= "2.7.0.0" and python_version < "2.8.0.0"',
-        'pathlib2>=2.3.0.0,<3.0.0.0 ; python_version >= "2.7.0.0" and python_version < "2.8.0.0"',
-        'zipfile36>=0.1.0.0,<0.2.0.0 ; python_version >= "3.4.0.0" and python_version < "3.6.0.0"',
-        'isort@ git+git://github.com/timothycrosley/isort.git@e63ae06ec7d70b06df9e528357650281a3d3ec22#egg=isort ; extra == "dev"',
+        'typing>=3.6.0.0,<4.0.0.0 ; (python_version >= "2.7.0.0" and python_version <'
+        ' "2.8.0.0") or (python_version >= "3.4.0.0" and python_version < "3.5.0.0")',
+        'virtualenv>=15.2.0.0,<16.0.0.0 ; python_version >= "2.7.0.0" and'
+        ' python_version < "2.8.0.0"',
+        'pathlib2>=2.3.0.0,<3.0.0.0 ; python_version >= "2.7.0.0" and python_version <'
+        ' "2.8.0.0"',
+        'zipfile36>=0.1.0.0,<0.2.0.0 ; python_version >= "3.4.0.0" and python_version <'
+        ' "3.6.0.0"',
+        "isort@"
+        " git+git://github.com/timothycrosley/isort.git@e63ae06ec7d70b06df9e528357650281a3d3ec22#egg=isort"  # noqa: E501
+        ' ; extra == "dev"',
     ]
     assert result == expected
 


Code review comments:
diff_hunk: @@ -481,7 +487,8 @@ def activate(self, python: str, io: "IO") -> "Env":
                         [
                             python,
                             "-c",
-                            "\"import sys; print('.'.join([str(s) for s in sys.version_info[:3]]))\"",
+                            "\"import sys; print('.'.join([str(s) for s in"
+                            ' sys.version_info[:3]]))"',
path: src/poetry/utils/env.py
text: @user1:
I wonder if we should keep the original format here for better readability. What do you think? (same for the lines 730 and 805, 859)

This can be achieved by `#fmt: off/on` (https://stackoverflow.com/a/58584557/9750706)

@author:
In this case, because the exact same string is repeated 4 times in this class, I'd suggest defining this as a string constant in the class (next to `ENVS_FILE`) called something like `VERSION_SCRIPT`.

Then we won't have to wrap it, and won't have to fiddle with black formatting.

_(did this in the most recent commit, let me know what you think)_

@user1:
Good idea  :+1: I saw there is already a `GET_PYTHON_VERSION` at the top of the file. I think we can use this one.

@author:
Even better! Adjusted the last commit to use the existing constant.

...or now that I think about it; maybe there is a reason to use a 'one-liner' version here, because it looks like command line arguments? Tests still pass though.

EDIT: I tested some things in a Notebook and I don't think the multi-line version will work, but maybe I am mistaken. We could just add this constant below the `GET_PYTHON_VERSION` constant as a `GET_PYTHON_VERSION_ONELINER` and use that instead. Avoid the trouble :) _(adjusted the commit to this idea)_