Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Enhancement: Ability to disable version validity check
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyprien CAILLOT committed Sep 11, 2024
1 parent d9731d0 commit c0010cd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions openpype/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@
get_expected_version,
is_running_from_build,
is_running_staging,
is_validity_check_enabled,
is_current_version_studio_latest,
is_current_version_higher_than_expected
)
Expand Down
7 changes: 7 additions & 0 deletions openpype/lib/openpype_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ def is_running_staging():
return is_staging_enabled()


def is_validity_check_enabled():
value = os.getenv("OPENPYPE_VALIDITY_CHECK_ENABLED", 'False').lower()
if value == "true" or value == "1":
return True
return False


# ----------------------------------------
# Functions dependent on OpenPypeVersion
# - Make sense to call only in OpenPype process
Expand Down
3 changes: 2 additions & 1 deletion openpype/tools/tray/pype_tray.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
get_installed_version,
is_current_version_studio_latest,
is_current_version_higher_than_expected,
is_validity_check_enabled,
is_running_from_build,
get_openpype_version,
is_running_staging,
Expand Down Expand Up @@ -372,7 +373,7 @@ def execute_doubleclick(self):

def _on_version_check_timer(self):
# Check if is running from build and stop future validations if yes
if not is_running_from_build() or not op_version_control_available():
if not is_validity_check_enabled() or not is_running_from_build() or not op_version_control_available():
self._version_check_timer.stop()
return

Expand Down
7 changes: 7 additions & 0 deletions start.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,10 @@ def _process_arguments() -> tuple:
commands.append("print_versions")
sys.argv.remove("--list-versions")

if "--disable-validity-check" in sys.argv:
commands.append("disable_validity_check")
sys.argv.remove("--disable-validity-check")

# handle igniter
# this is helper to run igniter before anything else
if "igniter" in sys.argv:
Expand Down Expand Up @@ -1115,6 +1119,9 @@ def boot():
except KeyError:
pass

# Do the program display popups to the users regarding updates or incompatibilities
os.environ["OPENPYPE_VALIDITY_CHECK_ENABLED"] = "False" if "disable_validity_check" in commands else "True"

_print(">>> loading environments ...")
# Avalon environments must be set before avalon module is imported
_print(" - for Avalon ...")
Expand Down

0 comments on commit c0010cd

Please sign in to comment.