prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Installing directory poetry package with dependencies in secondary source fails
  <!--
    Hi there! Thank you for discovering and submitting an issue.
  
    Before you submit this; let's make sure of a few things.
    Please make sure the following boxes are ticked if they are correct.
    If not, please try and fulfill these first.
  -->
  
  <!-- Checked checkbox should look like this: [x] -->
  - [x] I am on the [latest](https://github.com/sdispater/poetry/releases/latest) Poetry version.
  - [x] I have searched the [issues](https://github.com/sdispater/poetry/issues) of this repo and believe that this is not a duplicate.
  - [x] If an exception occurs when executing a command, I executed it again in debug mode (`-vvv` option).
  
  <!--
    Once those are done, if you're able to fill in the following list with your information,
    it'd be very helpful to whoever handles the issue.
  -->
  
  - **MacOS 10.14**: <!-- Replace with version + name -->
  - **1.0.0b8**: <!-- Replace with version -->
  
  ## Issue
  Due to https://github.com/pypa/pip/issues/7444 installing a directory which is managed by poetry or has a pyproject.toml file present will cause the `--no-deps` argument to be ignored. 
  
  This can go unnoticed as long as you are only working with pypi dependencies but when your package depends on a private pypi repository this causes installs to fail. 
  
  
  --- 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/packages/file_dependency.py`
  Content:
  ```
  1 import hashlib
  2 import io
  3 
  4 from pkginfo.distribution import HEADER_ATTRS
  5 from pkginfo.distribution import HEADER_ATTRS_2_0
  6 
  7 from poetry.utils._compat import Path
  8 
  9 from .dependency import Dependency
  10 
  11 
  12 # Patching pkginfo to support Metadata version 2.1 (PEP 566)
  13 HEADER_ATTRS.update(
  14     {"2.1": HEADER_ATTRS_2_0 + (("Provides-Extra", "provides_extra", True),)}
  15 )
  16 
  17 
  18 class FileDependency(Dependency):
  19     def __init__(
  20         self,
  21         name,
  22         path,  # type: Path
  23         category="main",  # type: str
  24         optional=False,  # type: bool
  25         base=None,  # type: Path
  26     ):
  27         self._path = path
  28         self._base = base
  29         self._full_path = path
  30 
  31         if self._base and not self._path.is_absolute():
  32             self._full_path = self._base / self._path
  33 
  34         if not self._full_path.exists():
  35             raise ValueError("File {} does not exist".format(self._path))
  36 
  37         if self._full_path.is_dir():
  38             raise ValueError("{} is a directory, expected a file".format(self._path))
  39 
  40         super(FileDependency, self).__init__(
  41             name, "*", category=category, optional=optional, allows_prereleases=True
  42         )
  43 
  44     @property
  45     def path(self):
  46         return self._path
  47 
  48     @property
  49     def full_path(self):
  50         return self._full_path.resolve()
  51 
  52     def is_file(self):
  53         return True
  54 
  55     def hash(self):
  56         h = hashlib.sha256()
  57         with self._full_path.open("rb") as fp:
  58             for content in iter(lambda: fp.read(io.DEFAULT_BUFFER_SIZE), b""):
  59                 h.update(content)
  60 
  61         return h.hexdigest()
  62
  ```
  
  Path: `poetry/packages/directory_dependency.py`
  Content:
  ```
  1 from pkginfo.distribution import HEADER_ATTRS
  2 from pkginfo.distribution import HEADER_ATTRS_2_0
  3 
  4 from poetry.utils._compat import Path
  5 from poetry.utils.toml_file import TomlFile
  6 
  7 from .dependency import Dependency
  8 
  9 
  10 # Patching pkginfo to support Metadata version 2.1 (PEP 566)
  11 HEADER_ATTRS.update(
  12     {"2.1": HEADER_ATTRS_2_0 + (("Provides-Extra", "provides_extra", True),)}
  13 )
  14 
  15 
  16 class DirectoryDependency(Dependency):
  17     def __init__(
  18         self,
  19         name,
  20         path,  # type: Path
  21         category="main",  # type: str
  22         optional=False,  # type: bool
  23         base=None,  # type: Path
  24         develop=True,  # type: bool
  25     ):
  26         self._path = path
  27         self._base = base
  28         self._full_path = path
  29         self._develop = develop
  30         self._supports_poetry = False
  31 
  32         if self._base and not self._path.is_absolute():
  33             self._full_path = self._base / self._path
  34 
  35         if not self._full_path.exists():
  36             raise ValueError("Directory {} does not exist".format(self._path))
  37 
  38         if self._full_path.is_file():
  39             raise ValueError("{} is a file, expected a directory".format(self._path))
  40 
  41         # Checking content to determine actions
  42         setup = self._full_path / "setup.py"
  43         pyproject = TomlFile(self._full_path / "pyproject.toml")
  44         if pyproject.exists():
  45             pyproject_content = pyproject.read()
  46             self._supports_poetry = (
  47                 "tool" in pyproject_content and "poetry" in pyproject_content["tool"]
  48             )
  49 
  50         if not setup.exists() and not self._supports_poetry:
  51             raise ValueError(
  52                 "Directory {} does not seem to be a Python package".format(
  53                     self._full_path
  54                 )
  55             )
  56 
  57         super(DirectoryDependency, self).__init__(
  58             name, "*", category=category, optional=optional, allows_prereleases=True
  59         )
  60 
  61     @property
  62     def path(self):
  63         return self._path
  64 
  65     @property
  66     def full_path(self):
  67         return self._full_path.resolve()
  68 
  69     @property
  70     def base(self):
  71         return self._base
  72 
  73     @property
  74     def develop(self):
  75         return self._develop
  76 
  77     def supports_poetry(self):
  78         return self._supports_poetry
  79 
  80     def is_directory(self):
  81         return True
  82
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/poetry/packages/directory_dependency.py b/poetry/packages/directory_dependency.py
  --- a/poetry/packages/directory_dependency.py
  +++ b/poetry/packages/directory_dependency.py
  @@ -74,6 +74,17 @@
       def develop(self):
           return self._develop
   
  +    @property
  +    def base_pep_508_name(self):  # type: () -> str
  +        requirement = self.pretty_name
  +
  +        if self.extras:
  +            requirement += "[{}]".format(",".join(self.extras))
  +
  +        requirement += " @ {}".format(self._path)
  +
  +        return requirement
  +
       def supports_poetry(self):
           return self._supports_poetry
   
  diff --git a/poetry/packages/file_dependency.py b/poetry/packages/file_dependency.py
  --- a/poetry/packages/file_dependency.py
  +++ b/poetry/packages/file_dependency.py
  @@ -49,6 +49,17 @@
       def full_path(self):
           return self._full_path.resolve()
   
  +    @property
  +    def base_pep_508_name(self):  # type: () -> str
  +        requirement = self.pretty_name
  +
  +        if self.extras:
  +            requirement += "[{}]".format(",".join(self.extras))
  +
  +        requirement += " @ {}".format(self._path)
  +
  +        return requirement
  +
       def is_file(self):
           return True
  
verification_info: {"golden_diff": "diff --git a/poetry/packages/directory_dependency.py b/poetry/packages/directory_dependency.py\n--- a/poetry/packages/directory_dependency.py\n+++ b/poetry/packages/directory_dependency.py\n@@ -74,6 +74,17 @@\n     def develop(self):\n         return self._develop\n \n+    @property\n+    def base_pep_508_name(self):  # type: () -> str\n+        requirement = self.pretty_name\n+\n+        if self.extras:\n+            requirement += \"[{}]\".format(\",\".join(self.extras))\n+\n+        requirement += \" @ {}\".format(self._path)\n+\n+        return requirement\n+\n     def supports_poetry(self):\n         return self._supports_poetry\n \ndiff --git a/poetry/packages/file_dependency.py b/poetry/packages/file_dependency.py\n--- a/poetry/packages/file_dependency.py\n+++ b/poetry/packages/file_dependency.py\n@@ -49,6 +49,17 @@\n     def full_path(self):\n         return self._full_path.resolve()\n \n+    @property\n+    def base_pep_508_name(self):  # type: () -> str\n+        requirement = self.pretty_name\n+\n+        if self.extras:\n+            requirement += \"[{}]\".format(\",\".join(self.extras))\n+\n+        requirement += \" @ {}\".format(self._path)\n+\n+        return requirement\n+\n     def is_file(self):\n         return True\n", "issue": "Installing directory poetry package with dependencies in secondary source fails\n<!--\r\n  Hi there! Thank you for discovering and submitting an issue.\r\n\r\n  Before you submit this; let's make sure of a few things.\r\n  Please make sure the following boxes are ticked if they are correct.\r\n  If not, please try and fulfill these first.\r\n-->\r\n\r\n<!-- Checked checkbox should look like this: [x] -->\r\n- [x] I am on the [latest](https://github.com/sdispater/poetry/releases/latest) Poetry version.\r\n- [x] I have searched the [issues](https://github.com/sdispater/poetry/issues) of this repo and believe that this is not a duplicate.\r\n- [x] If an exception occurs when executing a command, I executed it again in debug mode (`-vvv` option).\r\n\r\n<!--\r\n  Once those are done, if you're able to fill in the following list with your information,\r\n  it'd be very helpful to whoever handles the issue.\r\n-->\r\n\r\n- **MacOS 10.14**: <!-- Replace with version + name -->\r\n- **1.0.0b8**: <!-- Replace with version -->\r\n\r\n## Issue\r\nDue to https://github.com/pypa/pip/issues/7444 installing a directory which is managed by poetry or has a pyproject.toml file present will cause the `--no-deps` argument to be ignored. \r\n\r\nThis can go unnoticed as long as you are only working with pypi dependencies but when your package depends on a private pypi repository this causes installs to fail. \r\n\n", "before_files": [{"content": "import hashlib\nimport io\n\nfrom pkginfo.distribution import HEADER_ATTRS\nfrom pkginfo.distribution import HEADER_ATTRS_2_0\n\nfrom poetry.utils._compat import Path\n\nfrom .dependency import Dependency\n\n\n# Patching pkginfo to support Metadata version 2.1 (PEP 566)\nHEADER_ATTRS.update(\n    {\"2.1\": HEADER_ATTRS_2_0 + ((\"Provides-Extra\", \"provides_extra\", True),)}\n)\n\n\nclass FileDependency(Dependency):\n    def __init__(\n        self,\n        name,\n        path,  # type: Path\n        category=\"main\",  # type: str\n        optional=False,  # type: bool\n        base=None,  # type: Path\n    ):\n        self._path = path\n        self._base = base\n        self._full_path = path\n\n        if self._base and not self._path.is_absolute():\n            self._full_path = self._base / self._path\n\n        if not self._full_path.exists():\n            raise ValueError(\"File {} does not exist\".format(self._path))\n\n        if self._full_path.is_dir():\n            raise ValueError(\"{} is a directory, expected a file\".format(self._path))\n\n        super(FileDependency, self).__init__(\n            name, \"*\", category=category, optional=optional, allows_prereleases=True\n        )\n\n    @property\n    def path(self):\n        return self._path\n\n    @property\n    def full_path(self):\n        return self._full_path.resolve()\n\n    def is_file(self):\n        return True\n\n    def hash(self):\n        h = hashlib.sha256()\n        with self._full_path.open(\"rb\") as fp:\n            for content in iter(lambda: fp.read(io.DEFAULT_BUFFER_SIZE), b\"\"):\n                h.update(content)\n\n        return h.hexdigest()\n", "path": "poetry/packages/file_dependency.py"}, {"content": "from pkginfo.distribution import HEADER_ATTRS\nfrom pkginfo.distribution import HEADER_ATTRS_2_0\n\nfrom poetry.utils._compat import Path\nfrom poetry.utils.toml_file import TomlFile\n\nfrom .dependency import Dependency\n\n\n# Patching pkginfo to support Metadata version 2.1 (PEP 566)\nHEADER_ATTRS.update(\n    {\"2.1\": HEADER_ATTRS_2_0 + ((\"Provides-Extra\", \"provides_extra\", True),)}\n)\n\n\nclass DirectoryDependency(Dependency):\n    def __init__(\n        self,\n        name,\n        path,  # type: Path\n        category=\"main\",  # type: str\n        optional=False,  # type: bool\n        base=None,  # type: Path\n        develop=True,  # type: bool\n    ):\n        self._path = path\n        self._base = base\n        self._full_path = path\n        self._develop = develop\n        self._supports_poetry = False\n\n        if self._base and not self._path.is_absolute():\n            self._full_path = self._base / self._path\n\n        if not self._full_path.exists():\n            raise ValueError(\"Directory {} does not exist\".format(self._path))\n\n        if self._full_path.is_file():\n            raise ValueError(\"{} is a file, expected a directory\".format(self._path))\n\n        # Checking content to determine actions\n        setup = self._full_path / \"setup.py\"\n        pyproject = TomlFile(self._full_path / \"pyproject.toml\")\n        if pyproject.exists():\n            pyproject_content = pyproject.read()\n            self._supports_poetry = (\n                \"tool\" in pyproject_content and \"poetry\" in pyproject_content[\"tool\"]\n            )\n\n        if not setup.exists() and not self._supports_poetry:\n            raise ValueError(\n                \"Directory {} does not seem to be a Python package\".format(\n                    self._full_path\n                )\n            )\n\n        super(DirectoryDependency, self).__init__(\n            name, \"*\", category=category, optional=optional, allows_prereleases=True\n        )\n\n    @property\n    def path(self):\n        return self._path\n\n    @property\n    def full_path(self):\n        return self._full_path.resolve()\n\n    @property\n    def base(self):\n        return self._base\n\n    @property\n    def develop(self):\n        return self._develop\n\n    def supports_poetry(self):\n        return self._supports_poetry\n\n    def is_directory(self):\n        return True\n", "path": "poetry/packages/directory_dependency.py"}], "after_files": [{"content": "import hashlib\nimport io\n\nfrom pkginfo.distribution import HEADER_ATTRS\nfrom pkginfo.distribution import HEADER_ATTRS_2_0\n\nfrom poetry.utils._compat import Path\n\nfrom .dependency import Dependency\n\n\n# Patching pkginfo to support Metadata version 2.1 (PEP 566)\nHEADER_ATTRS.update(\n    {\"2.1\": HEADER_ATTRS_2_0 + ((\"Provides-Extra\", \"provides_extra\", True),)}\n)\n\n\nclass FileDependency(Dependency):\n    def __init__(\n        self,\n        name,\n        path,  # type: Path\n        category=\"main\",  # type: str\n        optional=False,  # type: bool\n        base=None,  # type: Path\n    ):\n        self._path = path\n        self._base = base\n        self._full_path = path\n\n        if self._base and not self._path.is_absolute():\n            self._full_path = self._base / self._path\n\n        if not self._full_path.exists():\n            raise ValueError(\"File {} does not exist\".format(self._path))\n\n        if self._full_path.is_dir():\n            raise ValueError(\"{} is a directory, expected a file\".format(self._path))\n\n        super(FileDependency, self).__init__(\n            name, \"*\", category=category, optional=optional, allows_prereleases=True\n        )\n\n    @property\n    def path(self):\n        return self._path\n\n    @property\n    def full_path(self):\n        return self._full_path.resolve()\n\n    @property\n    def base_pep_508_name(self):  # type: () -> str\n        requirement = self.pretty_name\n\n        if self.extras:\n            requirement += \"[{}]\".format(\",\".join(self.extras))\n\n        requirement += \" @ {}\".format(self._path)\n\n        return requirement\n\n    def is_file(self):\n        return True\n\n    def hash(self):\n        h = hashlib.sha256()\n        with self._full_path.open(\"rb\") as fp:\n            for content in iter(lambda: fp.read(io.DEFAULT_BUFFER_SIZE), b\"\"):\n                h.update(content)\n\n        return h.hexdigest()\n", "path": "poetry/packages/file_dependency.py"}, {"content": "from pkginfo.distribution import HEADER_ATTRS\nfrom pkginfo.distribution import HEADER_ATTRS_2_0\n\nfrom poetry.utils._compat import Path\nfrom poetry.utils.toml_file import TomlFile\n\nfrom .dependency import Dependency\n\n\n# Patching pkginfo to support Metadata version 2.1 (PEP 566)\nHEADER_ATTRS.update(\n    {\"2.1\": HEADER_ATTRS_2_0 + ((\"Provides-Extra\", \"provides_extra\", True),)}\n)\n\n\nclass DirectoryDependency(Dependency):\n    def __init__(\n        self,\n        name,\n        path,  # type: Path\n        category=\"main\",  # type: str\n        optional=False,  # type: bool\n        base=None,  # type: Path\n        develop=True,  # type: bool\n    ):\n        self._path = path\n        self._base = base\n        self._full_path = path\n        self._develop = develop\n        self._supports_poetry = False\n\n        if self._base and not self._path.is_absolute():\n            self._full_path = self._base / self._path\n\n        if not self._full_path.exists():\n            raise ValueError(\"Directory {} does not exist\".format(self._path))\n\n        if self._full_path.is_file():\n            raise ValueError(\"{} is a file, expected a directory\".format(self._path))\n\n        # Checking content to determine actions\n        setup = self._full_path / \"setup.py\"\n        pyproject = TomlFile(self._full_path / \"pyproject.toml\")\n        if pyproject.exists():\n            pyproject_content = pyproject.read()\n            self._supports_poetry = (\n                \"tool\" in pyproject_content and \"poetry\" in pyproject_content[\"tool\"]\n            )\n\n        if not setup.exists() and not self._supports_poetry:\n            raise ValueError(\n                \"Directory {} does not seem to be a Python package\".format(\n                    self._full_path\n                )\n            )\n\n        super(DirectoryDependency, self).__init__(\n            name, \"*\", category=category, optional=optional, allows_prereleases=True\n        )\n\n    @property\n    def path(self):\n        return self._path\n\n    @property\n    def full_path(self):\n        return self._full_path.resolve()\n\n    @property\n    def base(self):\n        return self._base\n\n    @property\n    def develop(self):\n        return self._develop\n\n    @property\n    def base_pep_508_name(self):  # type: () -> str\n        requirement = self.pretty_name\n\n        if self.extras:\n            requirement += \"[{}]\".format(\",\".join(self.extras))\n\n        requirement += \" @ {}\".format(self._path)\n\n        return requirement\n\n    def supports_poetry(self):\n        return self._supports_poetry\n\n    def is_directory(self):\n        return True\n", "path": "poetry/packages/directory_dependency.py"}]}