diff --git a/news/277.bugfix.rst b/news/277.bugfix.rst new file mode 100644 index 0000000000000000000000000000000000000000..62a185eecee664b73f1d7b617b2510d08636b1f6 --- /dev/null +++ b/news/277.bugfix.rst @@ -0,0 +1 @@ +Fix a bug that editable packages with `src` directory can't be uninstalled correctly. diff --git a/pdm/installers/installers.py b/pdm/installers/installers.py index 367bae1d0fe47fb9782c6ed87f1aa1d4839db369..27721504147a8f345164ff33fa810c4220bb8352 100644 --- a/pdm/installers/installers.py +++ b/pdm/installers/installers.py @@ -77,10 +77,7 @@ class Installer: # pragma: no cover def uninstall(self, dist: Distribution) -> None: req = parse_requirement(dist.project_name) - if is_dist_editable(dist): - ireq = pip_shims.install_req_from_editable(dist.location) - else: - ireq = pip_shims.install_req_from_line(dist.project_name) + ireq = pip_shims.install_req_from_line(dist.project_name) ireq.req = req pathset = ireq.uninstall(auto_confirm=self.auto_confirm)