build_status

Functionality using the gh CLI to check the CI status of repos contained within a cloned Adafruit CircuitPython Bundle

  • Author(s): Alec Delaney

Module Contents

Functions

run_gh_cli_check(user: Optional[str] = None, workflow_name: Optional[str] = 'Build CI') → bool

Runs the gh CLI in the current working directory

check_build_status(lib_path: cpy_scripts.lib_funcs.StrPath, user: Optional[str] = None, workflow_name: Optional[str] = 'Build CI', debug: bool = False) → Literal[Success, Failed, Error]

Uses the gh CLI client to check the build statuses of the Adafruit

check_build_statuses(bundle_path: cpy_scripts.lib_funcs.StrPath, user: Optional[str] = None, workflow_name: Optional[str] = 'Build CI', *, debug: bool = False) → List[Tuple[cpy_scripts.lib_funcs.StrPath, List[Literal[Success, Failed, Error]]]]

Checks all the libraries in a cloned Adafruit CircuitPython Bundle

save_build_statuses(build_results: List[Tuple[cpy_scripts.lib_funcs.StrPath, List[Literal[Success, Failed, Error]]]], failure_filepath: cpy_scripts.lib_funcs.StrPath = 'failures.txt', error_filepath: cpy_scripts.lib_funcs.StrPath = 'errors.txt') → None

Save the list of failed and/or errored libraries to files

Attributes

DEFAULT_BUNDLE_PATH

The default assumed path to the bundle, which is that it is within the

build_status.DEFAULT_BUNDLE_PATH :str

The default assumed path to the bundle, which is that it is within the current working directory

build_status.run_gh_cli_check(user: Optional[str] = None, workflow_name: Optional[str] = 'Build CI') bool

Runs the gh CLI in the current working directory

Parameters
  • user (str|None) – The user that triggered the run; if None is provided, any user is acceptable

  • workflow_name (str|None) – The name of the workflow; if None is provided, any workflow name is acceptable; the defail is “Build CI”

Returns

Whether the requested build was successful

Return type

bool

build_status.check_build_status(lib_path: cpy_scripts.lib_funcs.StrPath, user: Optional[str] = None, workflow_name: Optional[str] = 'Build CI', debug: bool = False) Literal[Success, Failed, Error]

Uses the gh CLI client to check the build statuses of the Adafruit CircuitPython Bundle

Parameters
  • lib_path (StrPath) – The path to the Adafruit library

  • user (str|None) – The user that triggered the run; if None is provided, any user is acceptable

  • workflow_name (str|None) – The name of the workflow; if None is provided, any workflow name is acceptable; the defail is “Build CI”

  • debug (bool) – Whether debug statements should be printed to the standard output

Returns

Whether the requested build was successful, failed, or had and error occur during the check

Return type

str

build_status.check_build_statuses(bundle_path: cpy_scripts.lib_funcs.StrPath, user: Optional[str] = None, workflow_name: Optional[str] = 'Build CI', *, debug: bool = False) List[Tuple[cpy_scripts.lib_funcs.StrPath, List[Literal[Success, Failed, Error]]]]

Checks all the libraries in a cloned Adafruit CircuitPython Bundle to get the latest build status with the requested infomration

Parameters
  • bundle_oath (StrPath) – The path to the cloned bundle

  • user (str|None) – The user that triggered the run; if None is provided, any user is acceptable

  • workflow_name (str|None) – The name of the workflow; if None is provided, any workflow name is acceptable; the defail is “Build CI”

  • debug (bool) – Whether debug statements should be printed to the standard output

Returns

A list of tuples containing paired library paths and build statuses

Return type

list

build_status.save_build_statuses(build_results: List[Tuple[cpy_scripts.lib_funcs.StrPath, List[Literal[Success, Failed, Error]]]], failure_filepath: cpy_scripts.lib_funcs.StrPath = 'failures.txt', error_filepath: cpy_scripts.lib_funcs.StrPath = 'errors.txt') None

Save the list of failed and/or errored libraries to files

Parameters
  • failed_builds (list[str]|None) – The list of failed libraries; if None is provided, it will not create a file for this

  • error_builds (list[str]|None) – The list of libraries that had errors during the gh CLI check; if None is provided, it will not create a file for this

  • failure_filepath (StrPath) – The filename/filepath to write the list of failed libraries to; the default is “failures.txt”

  • error_filepath (StrPath) – The filename/filepath to write the list of libraries with errored checks to; the default is “errors.txt”