We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
--no-root behavior is inverted on latest develop
[This](https://github.com/sdispater/poetry/commit/37ec1447b3508ee0bbdb41f8e5773ed5bfae0654#diff-427299ba040b8502b4d29846e595c2d0R59) should probably be `if self.option("no-root")`, to _not_ install the root package when `--no-root` is provided.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `poetry/console/commands/install.py`
Content:
```
1 import os
2 
3 from .env_command import EnvCommand
4 
5 
6 class InstallCommand(EnvCommand):
7     """
8     Installs the project dependencies.
9 
10     install
11         { --no-dev : Do not install dev dependencies. }
12         { --no-root : Do not install the root package (your project). }
13         { --dry-run : Outputs the operations but will not execute anything
14                       (implicitly enables --verbose). }
15         { --E|extras=* : Extra sets of dependencies to install. }
16         { --develop=* : Install given packages in development mode. }
17     """
18 
19     help = """The <info>install</info> command reads the <comment>poetry.lock</> file from
20 the current directory, processes it, and downloads and installs all the
21 libraries and dependencies outlined in that file. If the file does not
22 exist it will look for <comment>pyproject.toml</> and do the same.
23 
24 <info>poetry install</info>
25 """
26 
27     _loggers = ["poetry.repositories.pypi_repository"]
28 
29     def handle(self):
30         from clikit.io import NullIO
31         from poetry.installation import Installer
32         from poetry.masonry.builders import SdistBuilder
33         from poetry.masonry.utils.module import ModuleOrPackageNotFound
34         from poetry.utils._compat import decode
35         from poetry.utils.env import NullEnv
36 
37         installer = Installer(
38             self.io, self.env, self.poetry.package, self.poetry.locker, self.poetry.pool
39         )
40 
41         extras = []
42         for extra in self.option("extras"):
43             if " " in extra:
44                 extras += [e.strip() for e in extra.split(" ")]
45             else:
46                 extras.append(extra)
47 
48         installer.extras(extras)
49         installer.dev_mode(not self.option("no-dev"))
50         installer.develop(self.option("develop"))
51         installer.dry_run(self.option("dry-run"))
52         installer.verbose(self.option("verbose"))
53 
54         return_code = installer.run()
55 
56         if return_code != 0:
57             return return_code
58 
59         if not self.option("no-root"):
60             return 0
61 
62         try:
63             builder = SdistBuilder(self.poetry, NullEnv(), NullIO())
64         except ModuleOrPackageNotFound:
65             # This is likely due to the fact that the project is an application
66             # not following the structure expected by Poetry
67             # If this is a true error it will be picked up later by build anyway.
68             return 0
69 
70         self.line(
71             "  - Installing <info>{}</info> (<comment>{}</comment>)".format(
72                 self.poetry.package.pretty_name, self.poetry.package.pretty_version
73             )
74         )
75 
76         if self.option("dry-run"):
77             return 0
78 
79         setup = self.poetry.file.parent / "setup.py"
80         has_setup = setup.exists()
81 
82         if has_setup:
83             self.line("<warning>A setup.py file already exists. Using it.</warning>")
84         else:
85             with setup.open("w", encoding="utf-8") as f:
86                 f.write(decode(builder.build_setup()))
87 
88         try:
89             self.env.run("pip", "install", "-e", str(setup.parent), "--no-deps")
90         finally:
91             if not has_setup:
92                 os.remove(str(setup))
93
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/poetry/console/commands/install.py b/poetry/console/commands/install.py
--- a/poetry/console/commands/install.py
+++ b/poetry/console/commands/install.py
@@ -56,7 +56,7 @@
         if return_code != 0:
             return return_code
 
-        if not self.option("no-root"):
+        if self.option("no-root"):
             return 0
 
         try:

{"golden_diff": "diff --git a/poetry/console/commands/install.py b/poetry/console/commands/install.py\n--- a/poetry/console/commands/install.py\n+++ b/poetry/console/commands/install.py\n@@ -56,7 +56,7 @@\n         if return_code != 0:\n             return return_code\n \n-        if not self.option(\"no-root\"):\n+        if self.option(\"no-root\"):\n             return 0\n \n         try:\n", "issue": "--no-root behavior is inverted on latest develop\n[This](https://github.com/sdispater/poetry/commit/37ec1447b3508ee0bbdb41f8e5773ed5bfae0654#diff-427299ba040b8502b4d29846e595c2d0R59) should probably be `if self.option(\"no-root\")`, to _not_ install the root package when `--no-root` is provided.\n", "before_files": [{"content": "import os\n\nfrom .env_command import EnvCommand\n\n\nclass InstallCommand(EnvCommand):\n    \"\"\"\n    Installs the project dependencies.\n\n    install\n        { --no-dev : Do not install dev dependencies. }\n        { --no-root : Do not install the root package (your project). }\n        { --dry-run : Outputs the operations but will not execute anything\n                      (implicitly enables --verbose). }\n        { --E|extras=* : Extra sets of dependencies to install. }\n        { --develop=* : Install given packages in development mode. }\n    \"\"\"\n\n    help = \"\"\"The <info>install</info> command reads the <comment>poetry.lock</> file from\nthe current directory, processes it, and downloads and installs all the\nlibraries and dependencies outlined in that file. If the file does not\nexist it will look for <comment>pyproject.toml</> and do the same.\n\n<info>poetry install</info>\n\"\"\"\n\n    _loggers = [\"poetry.repositories.pypi_repository\"]\n\n    def handle(self):\n        from clikit.io import NullIO\n        from poetry.installation import Installer\n        from poetry.masonry.builders import SdistBuilder\n        from poetry.masonry.utils.module import ModuleOrPackageNotFound\n        from poetry.utils._compat import decode\n        from poetry.utils.env import NullEnv\n\n        installer = Installer(\n            self.io, self.env, self.poetry.package, self.poetry.locker, self.poetry.pool\n        )\n\n        extras = []\n        for extra in self.option(\"extras\"):\n            if \" \" in extra:\n                extras += [e.strip() for e in extra.split(\" \")]\n            else:\n                extras.append(extra)\n\n        installer.extras(extras)\n        installer.dev_mode(not self.option(\"no-dev\"))\n        installer.develop(self.option(\"develop\"))\n        installer.dry_run(self.option(\"dry-run\"))\n        installer.verbose(self.option(\"verbose\"))\n\n        return_code = installer.run()\n\n        if return_code != 0:\n            return return_code\n\n        if not self.option(\"no-root\"):\n            return 0\n\n        try:\n            builder = SdistBuilder(self.poetry, NullEnv(), NullIO())\n        except ModuleOrPackageNotFound:\n            # This is likely due to the fact that the project is an application\n            # not following the structure expected by Poetry\n            # If this is a true error it will be picked up later by build anyway.\n            return 0\n\n        self.line(\n            \"  - Installing <info>{}</info> (<comment>{}</comment>)\".format(\n                self.poetry.package.pretty_name, self.poetry.package.pretty_version\n            )\n        )\n\n        if self.option(\"dry-run\"):\n            return 0\n\n        setup = self.poetry.file.parent / \"setup.py\"\n        has_setup = setup.exists()\n\n        if has_setup:\n            self.line(\"<warning>A setup.py file already exists. Using it.</warning>\")\n        else:\n            with setup.open(\"w\", encoding=\"utf-8\") as f:\n                f.write(decode(builder.build_setup()))\n\n        try:\n            self.env.run(\"pip\", \"install\", \"-e\", str(setup.parent), \"--no-deps\")\n        finally:\n            if not has_setup:\n                os.remove(str(setup))\n", "path": "poetry/console/commands/install.py"}], "after_files": [{"content": "import os\n\nfrom .env_command import EnvCommand\n\n\nclass InstallCommand(EnvCommand):\n    \"\"\"\n    Installs the project dependencies.\n\n    install\n        { --no-dev : Do not install dev dependencies. }\n        { --no-root : Do not install the root package (your project). }\n        { --dry-run : Outputs the operations but will not execute anything\n                      (implicitly enables --verbose). }\n        { --E|extras=* : Extra sets of dependencies to install. }\n        { --develop=* : Install given packages in development mode. }\n    \"\"\"\n\n    help = \"\"\"The <info>install</info> command reads the <comment>poetry.lock</> file from\nthe current directory, processes it, and downloads and installs all the\nlibraries and dependencies outlined in that file. If the file does not\nexist it will look for <comment>pyproject.toml</> and do the same.\n\n<info>poetry install</info>\n\"\"\"\n\n    _loggers = [\"poetry.repositories.pypi_repository\"]\n\n    def handle(self):\n        from clikit.io import NullIO\n        from poetry.installation import Installer\n        from poetry.masonry.builders import SdistBuilder\n        from poetry.masonry.utils.module import ModuleOrPackageNotFound\n        from poetry.utils._compat import decode\n        from poetry.utils.env import NullEnv\n\n        installer = Installer(\n            self.io, self.env, self.poetry.package, self.poetry.locker, self.poetry.pool\n        )\n\n        extras = []\n        for extra in self.option(\"extras\"):\n            if \" \" in extra:\n                extras += [e.strip() for e in extra.split(\" \")]\n            else:\n                extras.append(extra)\n\n        installer.extras(extras)\n        installer.dev_mode(not self.option(\"no-dev\"))\n        installer.develop(self.option(\"develop\"))\n        installer.dry_run(self.option(\"dry-run\"))\n        installer.verbose(self.option(\"verbose\"))\n\n        return_code = installer.run()\n\n        if return_code != 0:\n            return return_code\n\n        if self.option(\"no-root\"):\n            return 0\n\n        try:\n            builder = SdistBuilder(self.poetry, NullEnv(), NullIO())\n        except ModuleOrPackageNotFound:\n            # This is likely due to the fact that the project is an application\n            # not following the structure expected by Poetry\n            # If this is a true error it will be picked up later by build anyway.\n            return 0\n\n        self.line(\n            \"  - Installing <info>{}</info> (<comment>{}</comment>)\".format(\n                self.poetry.package.pretty_name, self.poetry.package.pretty_version\n            )\n        )\n\n        if self.option(\"dry-run\"):\n            return 0\n\n        setup = self.poetry.file.parent / \"setup.py\"\n        has_setup = setup.exists()\n\n        if has_setup:\n            self.line(\"<warning>A setup.py file already exists. Using it.</warning>\")\n        else:\n            with setup.open(\"w\", encoding=\"utf-8\") as f:\n                f.write(decode(builder.build_setup()))\n\n        try:\n            self.env.run(\"pip\", \"install\", \"-e\", str(setup.parent), \"--no-deps\")\n        finally:\n            if not has_setup:\n                os.remove(str(setup))\n", "path": "poetry/console/commands/install.py"}]}