From 81317b450facaed2bc0c37b1f01ef5bb4b0ab700 Mon Sep 17 00:00:00 2001 From: Andrew Guenther Date: Sun, 21 Mar 2021 00:57:55 -0700 Subject: [PATCH 1/2] Output valid file URLs when building requirements --- poetry/core/packages/directory_dependency.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/poetry/core/packages/directory_dependency.py b/poetry/core/packages/directory_dependency.py index d0cbf2523..71cb758f1 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_url = path_to_url(self._path) + requirement += " @ {}".format(path_url) return requirement From 1d3e00eeb84a8793b8c81e69fad998b2d77029ae Mon Sep 17 00:00:00 2001 From: Andrew Guenther Date: Mon, 22 Mar 2021 05:45:25 -0700 Subject: [PATCH 2/2] Address @abn's feedback --- poetry/core/packages/directory_dependency.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poetry/core/packages/directory_dependency.py b/poetry/core/packages/directory_dependency.py index 71cb758f1..184f534a2 100644 --- a/poetry/core/packages/directory_dependency.py +++ b/poetry/core/packages/directory_dependency.py @@ -122,8 +122,8 @@ def base_pep_508_name(self) -> str: if self.extras: requirement += "[{}]".format(",".join(self.extras)) - path_url = path_to_url(self._path) - requirement += " @ {}".format(path_url) + path = path_to_url(self.path) if self.path.is_absolute() else self.path + requirement += " @ {}".format(path) return requirement