From 1b6e120470bbe168137d01f1256b9f63abb3e166 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 17 Sep 2024 12:20:02 +0200 Subject: [PATCH 1/5] doc/cmd --- spcd/cmd.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spcd/cmd.py b/spcd/cmd.py index a72287b..02a2b49 100644 --- a/spcd/cmd.py +++ b/spcd/cmd.py @@ -32,7 +32,13 @@ def spcd_check_project() -> None: def spcd_synchronize( target: str | None = None, source: str | None = None ) -> None: - """Synchronize output towards a target.""" + """Synchronize output towards a target. + + :param target: where to deploy to + :type target: str | None + :param source: where to deploy from + :type source: str | None + """ if not target: user = "cd" host = env.SPCD_PROJECT_PATH From 1e14eaf12d9833b3da9aea7d66675ead722ceb00 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 17 Sep 2024 12:22:15 +0200 Subject: [PATCH 2/5] doc/project --- spcd/project.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spcd/project.py b/spcd/project.py index 8cc8181..12afffb 100644 --- a/spcd/project.py +++ b/spcd/project.py @@ -28,7 +28,11 @@ class Project: """Current project.""" def __init__(self, projects: Projects) -> None: - """Set projects, branch, name, root & url.""" + """Set projects, branch, name, root & url. + + :param projects: parent class with environment + :type projects: Projects + """ self.projects = projects # branch for variable in BRANCH: From 6347c0c5c3be9b7be8754fc95dc3f853e85e3339 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 17 Sep 2024 12:28:44 +0200 Subject: [PATCH 3/5] doc/main --- spcd/__init__.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spcd/__init__.py b/spcd/__init__.py index 0df38c4..6ec65f2 100644 --- a/spcd/__init__.py +++ b/spcd/__init__.py @@ -44,7 +44,7 @@ def clone_project_branch() -> None: ) -def install_commands(path: str) -> None: +def install_commands(path: Path) -> None: """Make commands callable in the operating system.""" step("Install commands") user = Path("/usr/local/bin") @@ -92,8 +92,12 @@ def list_environment_variables() -> None: log.info("%s", variable) -def main(main_file: str) -> None: - """Entry point to initialize environment or run a specific command.""" +def main(main_file: Path) -> None: + """Entry point to initialize environment or run a specific command. + + :param main_file: entry point file calling this function + :type main_file: Path + """ paths = environ["PATH"].split(pathsep) if env.SPCD_PYTHON_VENV_BINARIES not in paths: environ["PATH"] = pathsep.join([env.SPCD_PYTHON_VENV_BINARIES, *paths]) From b7e5adfa737cc337e03a9c4ee7e09ec1c9ebcf62 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 17 Sep 2024 12:30:17 +0200 Subject: [PATCH 4/5] fix/main --- spcd/__main__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spcd/__main__.py b/spcd/__main__.py index 520540c..e7cceec 100755 --- a/spcd/__main__.py +++ b/spcd/__main__.py @@ -4,6 +4,7 @@ import importlib import sys +from pathlib import Path if __name__ == "__main__": env = importlib.import_module("env") @@ -11,4 +12,4 @@ if __name__ == "__main__": sys.path.insert(0, env.SPCD_PYTHON_VENV_PACKAGES) from spcd import main - main(__file__) + main(Path(__file__)) From 72133580d0308b0c8674e5bf6468f978163c6bb1 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 17 Sep 2024 12:33:23 +0200 Subject: [PATCH 5/5] doc/commands --- spcd/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spcd/__init__.py b/spcd/__init__.py index 6ec65f2..7e46b51 100644 --- a/spcd/__init__.py +++ b/spcd/__init__.py @@ -45,7 +45,11 @@ def clone_project_branch() -> None: def install_commands(path: Path) -> None: - """Make commands callable in the operating system.""" + """Make commands callable in the operating system. + + :param path: entry point that commands will call + :type path: Path + """ step("Install commands") user = Path("/usr/local/bin") for command in [