Skip to content

Commit 283cabf

Browse files
committed
_EditableInfo does not need an editable flag
It is always true.
1 parent ddcf558 commit 283cabf

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/pip/_internal/operations/freeze.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
class _EditableInfo(NamedTuple):
3333
requirement: str
34-
editable: bool
3534
comments: List[str]
3635

3736

@@ -164,7 +163,7 @@ def _format_as_name_version(dist: BaseDistribution) -> str:
164163

165164
def _get_editable_info(dist: BaseDistribution) -> _EditableInfo:
166165
"""
167-
Compute and return values (req, editable, comments) for use in
166+
Compute and return values (req, comments) for use in
168167
FrozenRequirement.from_dist().
169168
"""
170169
editable_project_location = dist.editable_project_location
@@ -184,7 +183,6 @@ def _get_editable_info(dist: BaseDistribution) -> _EditableInfo:
184183
)
185184
return _EditableInfo(
186185
requirement=location,
187-
editable=True,
188186
comments=[f"# Editable install with no version control ({display})"],
189187
)
190188

@@ -196,14 +194,12 @@ def _get_editable_info(dist: BaseDistribution) -> _EditableInfo:
196194
display = _format_as_name_version(dist)
197195
return _EditableInfo(
198196
requirement=location,
199-
editable=True,
200197
comments=[f"# Editable {vcs_name} install with no remote ({display})"],
201198
)
202199
except RemoteNotValidError as ex:
203200
display = _format_as_name_version(dist)
204201
return _EditableInfo(
205202
requirement=location,
206-
editable=True,
207203
comments=[
208204
f"# Editable {vcs_name} install ({display}) with either a deleted "
209205
f"local remote or invalid URI:",
@@ -217,17 +213,16 @@ def _get_editable_info(dist: BaseDistribution) -> _EditableInfo:
217213
location,
218214
vcs_backend.name,
219215
)
220-
return _EditableInfo(requirement=location, editable=True, comments=[])
216+
return _EditableInfo(requirement=location, comments=[])
221217
except InstallationError as exc:
222218
logger.warning("Error when trying to get requirement for VCS system %s", exc)
223219
else:
224-
return _EditableInfo(requirement=req, editable=True, comments=[])
220+
return _EditableInfo(requirement=req, comments=[])
225221

226222
logger.warning("Could not determine repository location of %s", location)
227223

228224
return _EditableInfo(
229225
requirement=location,
230-
editable=True,
231226
comments=["## !! Could not determine repository location"],
232227
)
233228

@@ -251,8 +246,9 @@ def from_dist(cls, dist: BaseDistribution) -> "FrozenRequirement":
251246
# TODO `get_requirement_info` is taking care of editable requirements.
252247
# TODO This should be refactored when we will add detection of
253248
# editable that provide .dist-info metadata.
254-
if dist.editable:
255-
req, editable, comments = _get_editable_info(dist)
249+
editable = dist.editable
250+
if editable:
251+
req, comments = _get_editable_info(dist)
256252
else:
257253
comments = []
258254
direct_url = dist.direct_url

0 commit comments

Comments
 (0)