seutil.project package

Submodules

seutil.project.Project module

class seutil.project.Project.Project[source]

Bases: object

DOWNLOADS_DIR = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/seutil/checkouts/latest/docs/source/_downloads')
RESULTS_DIR = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/seutil/checkouts/latest/docs/source/_results')
checkout(revision: str, is_forced: bool = False) None[source]

Checks out to the given revision. :requires: the project to be cloned. :param revision: the target revision. :param is_forced: if do force checkout or not.

clean() None[source]

Cleans any extra files in the repository that is not indexed by git (either git-ignored or not). :requires: the project to be cloned.

clone(checkout_dir: Optional[pathlib.Path] = None, is_force_update: bool = False)[source]

Clones the project to path. The project will be checked-out to the default branch, latest revision. If the project is already cloned, then will only move the project to the given path, and check out to the default branch, latest revision. :param checkout_dir: the location to clone and checkout the project. :param is_force_update: if true, then will re-clone regardless of whether the project is cloned before.

property default_branch
property default_checkout_dir
property default_results_dir
classmethod deserialize(data) seutil.project.Project.Project[source]
for_each_revision(func_revision: Callable[[seutil.project.Project.Project, str], None], revisions: Iterable[str], is_auto_checkout: bool = True) None[source]

Runs the func_revision for each revision. :param func_revision: the function to run, which takes a Project object and a string revision, and is able to access the ProjectResults. :param revisions: the revisions to run the function. :param is_auto_checkout: if set to False then will not automatically checkout each revision.

classmethod from_projects_database(projects_database: List[Dict]) List[seutil.project.Project.Project][source]
get_all_revisions() List[str][source]

Returns the revisions of the history of the current branch, before (and include) the current revision. The revisions are sorted in chronological order, i.e., latest revision at last.

Updates the results with “all_revisions.json”.

Requires

the project to be cloned.

Returns

the list of revisions of current branch history, sorted in chronological order.

init_results(results_dir: Optional[pathlib.Path] = None)[source]
property is_cloned
property is_connected_to_results
property logger_prefix
remove() None[source]

Removes the project from local disk if it is cloned. Do nothing otherwise.

require_cloned() None[source]

Checks if the project is cloned. :raises Exception: if the project is not cloned.

property revision: str

Returns the current revision of the project. :requires: the project to be cloned. :return: the current revision of the project.

serialize() dict[source]
classmethod set_downloads_dir(path: pathlib.Path)[source]
classmethod set_results_dir(path: pathlib.Path)[source]
update()[source]

Updates the cloned repo to the latest version of default branch.

seutil.project.ProjectResults module

class seutil.project.ProjectResults.ProjectResults[source]

Bases: object

dump_meta_result(file_name: str, data: Any, *args, **kwargs) None[source]
dump_revision_result(revision: str, file_name: str, data: Any, *args, **kwargs) None[source]
classmethod from_base_results_dir(base_results_dir: pathlib.Path) List[seutil.project.ProjectResults.ProjectResults][source]
classmethod get_project_results(full_name: str, results_dir: pathlib.Path) seutil.project.ProjectResults.ProjectResults[source]
get_revision_dir(revision: str) pathlib.Path[source]
load_meta_result(file_name: str, *args, **kwargs) Any[source]
load_revision_result(revision: str, file_name: str, *args, **kwargs) Any[source]
property meta_dir: pathlib.Path

Module contents

class seutil.project.Project[source]

Bases: object

DOWNLOADS_DIR = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/seutil/checkouts/latest/docs/source/_downloads')
RESULTS_DIR = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/seutil/checkouts/latest/docs/source/_results')
checkout(revision: str, is_forced: bool = False) None[source]

Checks out to the given revision. :requires: the project to be cloned. :param revision: the target revision. :param is_forced: if do force checkout or not.

checkout_dir: pathlib.Path
clean() None[source]

Cleans any extra files in the repository that is not indexed by git (either git-ignored or not). :requires: the project to be cloned.

clone(checkout_dir: Optional[pathlib.Path] = None, is_force_update: bool = False)[source]

Clones the project to path. The project will be checked-out to the default branch, latest revision. If the project is already cloned, then will only move the project to the given path, and check out to the default branch, latest revision. :param checkout_dir: the location to clone and checkout the project. :param is_force_update: if true, then will re-clone regardless of whether the project is cloned before.

data: Dict
property default_branch
property default_checkout_dir
property default_results_dir
classmethod deserialize(data) seutil.project.Project.Project[source]
for_each_revision(func_revision: Callable[[seutil.project.Project.Project, str], None], revisions: Iterable[str], is_auto_checkout: bool = True) None[source]

Runs the func_revision for each revision. :param func_revision: the function to run, which takes a Project object and a string revision, and is able to access the ProjectResults. :param revisions: the revisions to run the function. :param is_auto_checkout: if set to False then will not automatically checkout each revision.

classmethod from_projects_database(projects_database: List[Dict]) List[seutil.project.Project.Project][source]
full_name: str
get_all_revisions() List[str][source]

Returns the revisions of the history of the current branch, before (and include) the current revision. The revisions are sorted in chronological order, i.e., latest revision at last.

Updates the results with “all_revisions.json”.

Requires

the project to be cloned.

Returns

the list of revisions of current branch history, sorted in chronological order.

init_results(results_dir: Optional[pathlib.Path] = None)[source]
property is_cloned
property is_connected_to_results
property logger_prefix
remove() None[source]

Removes the project from local disk if it is cloned. Do nothing otherwise.

require_cloned() None[source]

Checks if the project is cloned. :raises Exception: if the project is not cloned.

results: seutil.project.ProjectResults.ProjectResults
property revision: str

Returns the current revision of the project. :requires: the project to be cloned. :return: the current revision of the project.

serialize() dict[source]
classmethod set_downloads_dir(path: pathlib.Path)[source]
classmethod set_results_dir(path: pathlib.Path)[source]
update()[source]

Updates the cloned repo to the latest version of default branch.

url: str
class seutil.project.ProjectResults[source]

Bases: object

dump_meta_result(file_name: str, data: Any, *args, **kwargs) None[source]
dump_revision_result(revision: str, file_name: str, data: Any, *args, **kwargs) None[source]
classmethod from_base_results_dir(base_results_dir: pathlib.Path) List[seutil.project.ProjectResults.ProjectResults][source]
classmethod get_project_results(full_name: str, results_dir: pathlib.Path) seutil.project.ProjectResults.ProjectResults[source]
get_revision_dir(revision: str) pathlib.Path[source]
load_meta_result(file_name: str, *args, **kwargs) Any[source]
load_revision_result(revision: str, file_name: str, *args, **kwargs) Any[source]
property meta_dir: pathlib.Path