cli

cli.REPO_PATH = '/root/rolling-pin'

A CLI for developing and deploying a service deeply integrated with this repository’s structure. Written to be python version agnostic.

cli.get_architecture_diagram_command(info)[source]

Generates a svg file detailing this repository’s module structure.

Parameters

info (dict) – Info dictionary.

Returns

Command.

Return type

str

cli.get_bash_command(info)[source]

Opens a bash session inside a running container.

Parameters

info (dict) – Info dictionary.

Returns

Command.

Return type

str

cli.get_container_id_command()[source]

Gets current container id.

Returns

Command.

Return type

str

cli.get_coverage_command(info)[source]

Runs pytest coverage.

Parameters

info (dict) – Info dictionary.

Returns

Command.

Return type

str

cli.get_docker_command(info)[source]

Get misc docker command.

Args:age

info (dict): Info dictionary.

Returns

Command.

Return type

str

cli.get_docker_compose_command(info)[source]

Gets docker-compose command.

Parameters

info (dict) – Info dictionary.

Returns

Command.

Return type

str

cli.get_docker_exec_command(info, working_directory=None)[source]

Gets docker exec command.

Parameters
  • info (dict) – Info dictionary.

  • working_directory (str, optional) – Working directory.

Returns

Command.

Return type

str

cli.get_docs_command(info)[source]

Build documentation.

Parameters

info (dict) – Info dictionary.

Returns

Fully resolved build docs command.

Return type

str

cli.get_fix_permissions_command(info, directory)[source]

Recursively reverts permissions of given directory from root:root.

Parameters

directory (str) – Directory to be recursively chowned.

Returns

Command.

Return type

str

cli.get_image_id_command()[source]

Gets currently built image id.

Returns

Command.

Return type

str

cli.get_info()[source]
Returns

System args and environment as a dict.

Return type

str

cli.get_lab_command(info)[source]

Start a jupyter lab server.

Parameters

info (dict) – Info dictionary.

Returns

Command.

Return type

str

cli.get_lint_command(info)[source]

Runs flake8 linting on python code.

Parameters

info (dict) – Info dictionary.

Returns

Command.

Return type

str

cli.get_publish_command(info)[source]

Publish repository to python package index.

Parameters

info (dict) – Info dictionary.

Returns

Command.

Return type

str

cli.get_python_command(info)[source]

Opens a python interpreter inside a running container.

Parameters

info (dict) – Info dictionary.

Returns

Command.

Return type

str

cli.get_radon_metrics_command(info)[source]

Generates radon metrics of this repository as html files.

Parameters

info (dict) – Info dictionary.

Returns

Command.

Return type

str

cli.get_remove_image_command(info)[source]

Removes docker image.

Parameters

info (dict) – Info dictionary.

Returns

Command.

Return type

str

cli.get_requirements_command(info)[source]

Writes a pip frozen requirements command to docker directory.

Parameters

info (dict) – Info dictionary.

Returns

Command.

Return type

str

cli.get_start_command(info)[source]

Starts up container.

Parameters

info (dict) – Info dictionary.

Returns

Fully resolved docker-compose up command.

Return type

str

cli.get_stop_command(info)[source]

Shuts down container.

Parameters

info (dict) – Info dictionary.

Returns

Fully resolved docker-compose down command.

Return type

str

cli.get_test_command(info)[source]

Runs pytest.

Parameters

info (dict) – Info dictionary.

Returns

Command.

Return type

str

cli.get_tox_command(info)[source]

Run tox tests.

Parameters

info (dict) – Info dictionary.

Returns

Command.

Return type

str

cli.main()[source]

Print different commands to stdout depending on mode provided to command.