verify.common¶
What the subcommands of verify share: the output and the project.
UsageError
¶
Bases: Exception
A subcommand cannot run as it was asked to, exit code 2.
ProjectNotLoaded
¶
Bases: UsageError
The project cannot be loaded, exit code 4 as for the kinds of the run layer.
report
¶
Write a line of the result of a subcommand to stdout.
Unlike a log record it is the output of the command, written as it is (no wrapping, markup, emoji or tab expansion), so that it can be redirected and compared.
add_project_arguments
¶
Add --project and --root to the parser of a subcommand.
outside_root
¶
Check that the module of a project was imported from below root.
--root is put first on the python path, but a package which is already
imported (a second call in the same process) or installed in an environment
in which the root does not take effect would silently be dumped from
somewhere else.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project
|
str
|
the reference |
required |
root
|
Path
|
the directory the module must be imported from. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
A message if the module comes from elsewhere, else |
load_project_of
¶
Load the project of the arguments, --project below --root.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args
|
Namespace
|
the parsed arguments with |
required |
Returns:
| Type | Description |
|---|---|
Project
|
The project. |
Raises:
| Type | Description |
|---|---|
ProjectNotLoaded
|
if the project cannot be loaded or is imported from
outside of |