:py:mod:`anod.buildspace` ========================= .. py:module:: anod.buildspace .. autoapi-nested-parse:: Build space management for Anod sandboxes. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: anod.buildspace.BuildSpace Attributes ~~~~~~~~~~ .. autoapisummary:: anod.buildspace.logger .. py:data:: logger .. py:class:: BuildSpace(root_dir: str) Build space located inside a sandbox. .. py:property:: dirs :type: list[str] Return the list of all build space directory paths. :return: list of absolute directory paths .. py:attribute:: DIRS :value: ('artifacts', 'binary', 'build', 'install', 'log', 'pkg', 'results', 'src', 'test', 'tmp') .. py:method:: exists() -> bool Return True if the build space exists on disk. This function just checks the contents of self.root_dir, and verifies that it appears to be a build space. It does so, irrespective of whether self.initialize is True or not. :return: True if self.root_dir is a buildspace, False otherwise. .. py:method:: subdir(name: str) -> str Get the absolute path of a subdirectory. :param name: the subdirectory name .. py:method:: __getattr__(name: str) -> str Get a directory attribute dynamically. :param name: the attribute name .. py:method:: __getitem__(key: str) -> str | None Get a directory path using dictionary-style access. :param key: the key name (should be uppercase ending with _DIR) .. py:method:: create(quiet: bool = False) -> None Create a build space. The function create all the necessary directories and files to have a valid build space. If the build space already exists, only tmp directory content is reset. :param quiet: do not print info messages .. py:method:: reset(keep: list[str] | None = None) -> None Reset build space. The function delete the complete buildspace. The only elements that are not deleted are the logs, the testsuite results and any subdirectories in keep parameter A call to self.create() is needed after calling this function. :param keep: a list of directory to keep in addition to results and log. Each element should be part of BuildSpace.DIRS