Skip to content

Commit

Permalink
Merge pull request #342 from andyk/fix_repo_test
Browse files Browse the repository at this point in the history
  • Loading branch information
andyk authored Mar 25, 2022
2 parents 9336c0d + 752843e commit f3409e5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 3 additions & 1 deletion pcs/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
)
Expand Down
6 changes: 1 addition & 5 deletions pcs/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

0 comments on commit f3409e5

Please sign in to comment.