remove duplicate versions, print path

This commit is contained in:
Ondrej Samohel 2021-05-26 18:49:15 +02:00 committed by Ondrej Samohel
parent fe701ab0bd
commit 556975854b
No known key found for this signature in database
GPG key ID: 02376E18990A97C6
2 changed files with 15 additions and 8 deletions

View file

@ -203,6 +203,12 @@ class OpenPypeVersion(semver.VersionInfo):
openpype_version.staging = True
return openpype_version
def __hash__(self):
if self.path:
return hash(self.path)
else:
return hash(str(self))
class BootstrapRepos:
"""Class for bootstrapping local OpenPype installation.
@ -650,6 +656,9 @@ class BootstrapRepos:
v for v in openpype_versions if v.path.suffix != ".zip"
]
# remove duplicates
openpype_versions = list(set(openpype_versions))
return openpype_versions
def process_entered_location(self, location: str) -> Union[Path, None]:

View file

@ -496,10 +496,9 @@ def _find_frozen_openpype(use_version: str = None,
if openpype_versions:
print(" - found: ")
for v in openpype_versions:
print(f" - {v}")
print(f" - {local_version}")
else:
print(f" - local version {local_version}")
print(f" - {v}: {v.path}")
print(f" - local version {local_version}")
sys.exit(1)
# test if latest detected is installed (in user data dir)
@ -577,10 +576,9 @@ def _bootstrap_from_code(use_version):
if openpype_versions:
print(" - found: ")
for v in openpype_versions:
print(f" - {v}")
print(f" - {local_version}")
else:
print(f" - local version {local_version}")
print(f" - {v}: {v.path}")
print(f" - local version {local_version}")
sys.exit(1)
else:
os.environ["OPENPYPE_VERSION"] = local_version