src.helpers module¶
pycompile helper functions.
- class src.helpers.Colors¶
Bases:
object
pycompile colors
- BLUE = '\x1b[94m'¶
- BOLD = '\x1b[1m'¶
- CYAN = '\x1b[96m'¶
- FAIL = '\x1b[91m'¶
- GREEN = '\x1b[92m'¶
- HEADER = '\x1b[95m'¶
- RESET = '\x1b[0m'¶
- UNDERLINE = '\x1b[4m'¶
- WARNING = '\x1b[93m'¶
- src.helpers.change_dir(file_path: Path) Generator[None, None, None] ¶
Context manager to change the current active directory at the file path parents. This is needed to be able to include the compiled files in the same directory as the source files.
- src.helpers.copy_files(from_dir: Path) Generator[Path, None, None] ¶
Copies all files at a temp directory.
- src.helpers.decorate_functions(dec_import: str, dec_name: str, files: Iterable[Path], func_name_pattern: str) None ¶
For each file: add the decorator import at the top level of the file and decorate all the functions with the decorate name
- src.helpers.run_pytest(directory: Path) None ¶
Invoke pytest at the directory.
- src.helpers.run_sub_process(files: list[Path], compile_cmd: str) None ¶
For each file path run in a subprocess the corresponding compiler command.