Make _get_editable_info always return editable=True for editables
At the beginning this function returns if not dist.editable.
So returning editable=False after that does not make sense.
Return an editable with the file system location instead when
there is any issue getting VCS information.
@@ -212,7 +212,6 @@ def _get_editable_info(dist: BaseDistribution) -> _EditableInfo:
f"# '{ex.url}'",
],
)
-
except BadCommand:
logger.warning(
"cannot determine version of editable source in %s "
@@ -220,22 +219,17 @@ def _get_editable_info(dist: BaseDistribution) -> _EditableInfo:
location,
vcs_backend.name,
)
- return _EditableInfo(requirement=None, editable=True, comments=[])
-
+ return _EditableInfo(requirement=location, editable=True, comments=[])
except InstallationError as exc:
- logger.warning(
- "Error when trying to get requirement for VCS system %s, "
- "falling back to uneditable format",
- exc,
- )
+ logger.warning("Error when trying to get requirement for VCS system %s", exc)
else:
return _EditableInfo(requirement=req, editable=True, comments=[])
logger.warning("Could not determine repository location of %s", location)
return _EditableInfo(
- requirement=None,
- editable=False,
+ requirement=location,
+ editable=True,
comments=["## !! Could not determine repository location"],
)
