Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
HashCommand Class Reference
Inheritance diagram for HashCommand:
Collaboration diagram for HashCommand:

Public Member Functions

None add_options (self)
 
int run (self, Values options, List[str] args)
 
- Public Member Functions inherited from Command
None __init__ (self, str name, str summary, bool isolated=False)
 
None handle_pip_version_check (self, Values options)
 
Tuple[Values, List[str]] parse_args (self, List[str] args)
 
int main (self, List[str] args)
 
- Public Member Functions inherited from CommandContextMixIn
Generator[None, None, Nonemain_context (self)
 
_T enter_context (self, ContextManager[_T] context_provider)
 

Data Fields

 cmd_opts
 
- Data Fields inherited from Command
 name
 
 summary
 
 parser
 
 cmd_opts
 
 tempdir_registry
 
 verbosity
 

Static Public Attributes

str usage = "%prog [options] <file> ..."
 
bool ignore_require_venv = True
 
- Static Public Attributes inherited from Command
str usage = ""
 
bool ignore_require_venv = False
 

Additional Inherited Members

- Protected Member Functions inherited from Command
int _main (self, List[str] args)
 
- Protected Attributes inherited from CommandContextMixIn
 _in_main_context
 
 _main_context
 

Detailed Description

Compute a hash of a local package archive.

These can be used with --hash in a requirements file to do repeatable
installs.

Definition at line 15 of file hash.py.

Member Function Documentation

◆ add_options()

None add_options (   self)

Reimplemented from Command.

Definition at line 26 of file hash.py.

26 def add_options(self) -> None:
27 self.cmd_opts.add_option(
28 "-a",
29 "--algorithm",
30 dest="algorithm",
31 choices=STRONG_HASHES,
32 action="store",
33 default=FAVORITE_HASH,
34 help="The hash algorithm to use: one of {}".format(
35 ", ".join(STRONG_HASHES)
36 ),
37 )
38 self.parser.insert_option_group(0, self.cmd_opts)
39
for i

References Command.cmd_opts, CacheCommand.cmd_opts, CompletionCommand.cmd_opts, ConfigurationCommand.cmd_opts, DebugCommand.cmd_opts, DownloadCommand.cmd_opts, FreezeCommand.cmd_opts, HashCommand.cmd_opts, IndexCommand.cmd_opts, InspectCommand.cmd_opts, InstallCommand.cmd_opts, ListCommand.cmd_opts, SearchCommand.cmd_opts, ShowCommand.cmd_opts, UninstallCommand.cmd_opts, WheelCommand.cmd_opts, and i.

◆ run()

int run (   self,
Values  options,
List[str]  args 
)

Reimplemented from Command.

Definition at line 40 of file hash.py.

40 def run(self, options: Values, args: List[str]) -> int:
41 if not args:
42 self.parser.print_usage(sys.stderr)
43 return ERROR
44
45 algorithm = options.algorithm
46 for path in args:
47 write_output(
48 "%s:\n--hash=%s:%s", path, algorithm, _hash_of_file(path, algorithm)
49 )
50 return SUCCESS
51
52

References pip._internal.commands.hash._hash_of_file(), i, Command.parser, PrettyHelpFormatter.parser, UpdatingDefaultsHelpFormatter.parser, DownloadCommand.parser, IndexCommand.parser, InstallCommand.parser, and WheelCommand.parser.

Here is the call graph for this function:

Field Documentation

◆ cmd_opts

◆ ignore_require_venv

bool ignore_require_venv = True
static

Definition at line 24 of file hash.py.

◆ usage

str usage = "%prog [options] <file> ..."
static

Definition at line 23 of file hash.py.


The documentation for this class was generated from the following file: