Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
pip._internal.commands.list Namespace Reference

Data Structures

class  _DistWithLatestInfo
 
class  ListCommand
 

Functions

Tuple[List[List[str]], List[str]] format_for_columns ("_ProcessedDists" pkgs, Values options)
 
str format_for_json ("_ProcessedDists" packages, Values options)
 

Variables

 _ProcessedDists
 
 logger = logging.getLogger(__name__)
 

Function Documentation

◆ format_for_columns()

Tuple[List[List[str]], List[str]] format_for_columns ( "_ProcessedDists"  pkgs,
Values   options 
)
Convert the package data into something usable
by output_package_listing_columns.

Definition at line 306 of file list.py.

308) -> Tuple[List[List[str]], List[str]]:
309 """
310 Convert the package data into something usable
311 by output_package_listing_columns.
312 """
313 header = ["Package", "Version"]
314
315 running_outdated = options.outdated
316 if running_outdated:
317 header.extend(["Latest", "Type"])
318
319 has_editables = any(x.editable for x in pkgs)
320 if has_editables:
321 header.append("Editable project location")
322
323 if options.verbose >= 1:
324 header.append("Location")
325 if options.verbose >= 1:
326 header.append("Installer")
327
328 data = []
329 for proj in pkgs:
330 # if we're working on the 'outdated' list, separate out the
331 # latest_version and type
332 row = [proj.raw_name, str(proj.version)]
333
334 if running_outdated:
337
338 if has_editables:
340
341 if options.verbose >= 1:
343 if options.verbose >= 1:
345
346 data.append(row)
347
348 return data, header
349
350
for i

References i.

Referenced by ListCommand.output_package_listing().

Here is the caller graph for this function:

◆ format_for_json()

str format_for_json ( "_ProcessedDists"  packages,
Values  options 
)

Definition at line 351 of file list.py.

351def format_for_json(packages: "_ProcessedDists", options: Values) -> str:
352 data = []
353 for dist in packages:
354 info = {
355 "name": dist.raw_name,
356 "version": str(dist.version),
357 }
358 if options.verbose >= 1:
359 info["location"] = dist.location or ""
360 info["installer"] = dist.installer
362 info["latest_version"] = str(dist.latest_version)
363 info["latest_filetype"] = dist.latest_filetype
364 editable_project_location = dist.editable_project_location
365 if editable_project_location:
366 info["editable_project_location"] = editable_project_location
367 data.append(info)
368 return json.dumps(data)

References i.

Referenced by ListCommand.output_package_listing().

Here is the caller graph for this function:

Variable Documentation

◆ _ProcessedDists

_ProcessedDists
protected

Definition at line 33 of file list.py.

◆ logger

logger = logging.getLogger(__name__)

Definition at line 36 of file list.py.