diff --git a/poetry/core/packages/directory_dependency.py b/poetry/core/packages/directory_dependency.py index d0cbf2523..184f534a2 100644 --- a/poetry/core/packages/directory_dependency.py +++ b/poetry/core/packages/directory_dependency.py @@ -10,6 +10,7 @@ from .constraints import BaseConstraint # noqa from .dependency import Dependency +from .utils.utils import path_to_url class DirectoryDependency(Dependency): @@ -121,7 +122,8 @@ def base_pep_508_name(self) -> str: if self.extras: requirement += "[{}]".format(",".join(self.extras)) - requirement += " @ {}".format(self._path.as_posix()) + path = path_to_url(self.path) if self.path.is_absolute() else self.path + requirement += " @ {}".format(path) return requirement