Skip to content

Commit

Permalink
Merge pull request #10 from quadproduction/release/4.0.3
Browse files Browse the repository at this point in the history
release/4.0.3
  • Loading branch information
BenSouchet authored Dec 2, 2024
2 parents c01de0f + dfe592a commit a09a501
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
23 changes: 15 additions & 8 deletions src/quadpype/lib/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,29 +226,36 @@ def __init__(self,
install_dir_path = Path(install_dir_path)

self._install_dir_path = install_dir_path
local_version_str = None
local_version = None
if self._install_dir_path:
local_version_str = self.get_package_version_from_dir(self._name, self._install_dir_path)
local_version = PackageVersion(
version=self.get_package_version_from_dir(
self._name,
self._install_dir_path
),
path=self._install_dir_path
)

if not running_version_str:
# If no version specified get the latest version
latest_version = self.get_latest_version()
if latest_version:
is_local_more_recent = local_version and local_version >= latest_version
if latest_version and not is_local_more_recent:
running_version_str = str(latest_version)
elif local_version_str:
running_version_str = local_version_str
elif local_version:
running_version_str = str(local_version)

if not running_version_str:
raise ValueError("Cannot find a version to run, neither locally or remotely.")

if not isinstance(running_version_str, str):
raise ValueError("Running version must be a valid version string.")

# If the installation directory path is specified and
# If there is a local version and
# the version requested is the same as the local one,
# then use the local code version
if local_version_str == running_version_str and self._install_dir_path:
self._running_version = PackageVersion(version=running_version_str, path=self._install_dir_path)
if local_version and str(local_version) == running_version_str:
self._running_version = local_version
else:
# Find (and retrieve if necessary) the specified version to run
running_version = self.find_version(running_version_str, from_local=True)
Expand Down
2 changes: 1 addition & 1 deletion src/quadpype/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
"""File declaring QuadPype version."""
__version__ = "4.0.2"
__version__ = "4.0.3"

0 comments on commit a09a501

Please sign in to comment.