31
31
32
32
class _EditableInfo (NamedTuple ):
33
33
requirement : str
34
- editable : bool
35
34
comments : List [str ]
36
35
37
36
@@ -164,7 +163,7 @@ def _format_as_name_version(dist: BaseDistribution) -> str:
164
163
165
164
def _get_editable_info (dist : BaseDistribution ) -> _EditableInfo :
166
165
"""
167
- Compute and return values (req, editable, comments) for use in
166
+ Compute and return values (req, comments) for use in
168
167
FrozenRequirement.from_dist().
169
168
"""
170
169
editable_project_location = dist .editable_project_location
@@ -184,7 +183,6 @@ def _get_editable_info(dist: BaseDistribution) -> _EditableInfo:
184
183
)
185
184
return _EditableInfo (
186
185
requirement = location ,
187
- editable = True ,
188
186
comments = [f"# Editable install with no version control ({ display } )" ],
189
187
)
190
188
@@ -196,14 +194,12 @@ def _get_editable_info(dist: BaseDistribution) -> _EditableInfo:
196
194
display = _format_as_name_version (dist )
197
195
return _EditableInfo (
198
196
requirement = location ,
199
- editable = True ,
200
197
comments = [f"# Editable { vcs_name } install with no remote ({ display } )" ],
201
198
)
202
199
except RemoteNotValidError as ex :
203
200
display = _format_as_name_version (dist )
204
201
return _EditableInfo (
205
202
requirement = location ,
206
- editable = True ,
207
203
comments = [
208
204
f"# Editable { vcs_name } install ({ display } ) with either a deleted "
209
205
f"local remote or invalid URI:" ,
@@ -217,17 +213,16 @@ def _get_editable_info(dist: BaseDistribution) -> _EditableInfo:
217
213
location ,
218
214
vcs_backend .name ,
219
215
)
220
- return _EditableInfo (requirement = location , editable = True , comments = [])
216
+ return _EditableInfo (requirement = location , comments = [])
221
217
except InstallationError as exc :
222
218
logger .warning ("Error when trying to get requirement for VCS system %s" , exc )
223
219
else :
224
- return _EditableInfo (requirement = req , editable = True , comments = [])
220
+ return _EditableInfo (requirement = req , comments = [])
225
221
226
222
logger .warning ("Could not determine repository location of %s" , location )
227
223
228
224
return _EditableInfo (
229
225
requirement = location ,
230
- editable = True ,
231
226
comments = ["## !! Could not determine repository location" ],
232
227
)
233
228
@@ -251,8 +246,9 @@ def from_dist(cls, dist: BaseDistribution) -> "FrozenRequirement":
251
246
# TODO `get_requirement_info` is taking care of editable requirements.
252
247
# TODO This should be refactored when we will add detection of
253
248
# 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 )
256
252
else :
257
253
comments = []
258
254
direct_url = dist .direct_url
0 commit comments