diff --git a/pcs/registry.py b/pcs/registry.py index 9fbf34b1..8fcdee47 100644 --- a/pcs/registry.py +++ b/pcs/registry.py @@ -114,7 +114,9 @@ def from_repo_inferred( "file_path": str(relative_path), "instantiate": False, } - if repo.get_local_file_path(requirements_file).is_file(): + if repo.get_local_file_path( + requirements_file, version=c_version + ).is_file(): component_init_kwargs.update( {"requirements_path": str(requirements_file)} ) diff --git a/pcs/repo.py b/pcs/repo.py index 50d9e728..4cacc42f 100644 --- a/pcs/repo.py +++ b/pcs/repo.py @@ -337,11 +337,7 @@ def _clone_repo(self, version: str) -> Path: clone_destination = ( AOS_GLOBAL_REPOS_DIR / org_name / proj_name / version ) - if clone_destination.exists(): - porcelain.fetch( - repo=str(clone_destination), remote_location=self.url - ) - else: + if not clone_destination.exists(): clone_destination.mkdir(parents=True) porcelain.clone( source=self.url, target=str(clone_destination), checkout=True diff --git a/tests/test_registry.py b/tests/test_registry.py index 455f5e24..7cd1c075 100644 --- a/tests/test_registry.py +++ b/tests/test_registry.py @@ -158,5 +158,5 @@ def test_registry_from_repo(): requirements_file="dev-requirements.txt", version=TESTING_BRANCH_NAME, ) - comp_name = f"module:agentos__component.py=={TESTING_BRANCH_NAME}" + comp_name = f"module:pcs__component.py=={TESTING_BRANCH_NAME}" assert comp_name in reg.to_dict()["components"]