MCPcopy Index your code
hub / github.com/pathwaycom/pathway / checkout_repository

Function checkout_repository

python/pathway/cli.py:187–203  ·  view source on GitHub ↗
(
    repository_url: str | None, branch: str | None
)

Source from the content-addressed store, hash-verified

185
186
187def checkout_repository(
188 repository_url: str | None, branch: str | None
189) -> tempfile.TemporaryDirectory | None:
190 if repository_url is None:
191 return None
192 try:
193 import git
194 except ImportError:
195 logging.error("To run the code from Git repository please have git installed")
196 exit(1)
197 temp_root_directory = tempfile.TemporaryDirectory()
198 repository_path, venv_path = get_temporary_paths(temp_root_directory)
199 repository = git.Repo.clone_from(repository_url, repository_path)
200 if branch is not None:
201 repository.git.checkout(branch)
202 venv.create(venv_path, with_pip=True)
203 return temp_root_directory
204
205
206def spawn_program(

Callers 1

spawn_programFunction · 0.85

Calls 2

get_temporary_pathsFunction · 0.85
createMethod · 0.45

Tested by

no test coverage detected