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

Settings: Remove environment groups from settings #3115

Merged
merged 7 commits into from
Apr 29, 2022

Conversation

iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented Apr 28, 2022

Brief description

Removed logic related to environment groups which were implemented at the beginning of settings implementation but are not used anymore.

Description

Environment groups were stored using metadata to easily find their values in whole settings but the approach had a lot of limitations and was more magical then practical. Goal of PR is to make clearer api and remove unused code (that should not be used). All removed functions were kept for backwards compatibility of older builds but it is not needed for more then 2 minor releases. Also removed backwards compatibily of removed functions from start.py .

Additional info

Removed functions

  • openpype.lib.env_tools.get_global_environments - was replaced by openpype.settings.get_general_environments
  • openpype.settings.get_environments - was replaced by openpype.settings.get_general_environments
  • openpype.settings.lib.find_environments - not used anymore

Testing notes:

  1. Environments should be loaded as they did.

@iLLiCiTiT iLLiCiTiT self-assigned this Apr 28, 2022
@iLLiCiTiT iLLiCiTiT added type: enhancement Enhancements to existing functionality Bump Minor Pull requests that update a dependency file labels Apr 28, 2022
Copy link
Member

@mkolar mkolar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unable to start

>>> Reading Poetry ... OK
>>> run disk mapping command ...
disk mapping args:: ['subst', 'P:', 'C:\\']
>>> Logging to server is turned ON
>>> loading environments ...
  - for Avalon ...
  - global OpenPype ...
Traceback (most recent call last):
  File "C:\Users\milan\code\OpenPype\start.py", line 1175, in <module>
    boot()
  File "C:\Users\milan\code\OpenPype\start.py", line 1086, in boot
    set_openpype_global_environments()
  File "C:\Users\milan\code\OpenPype\start.py", line 269, in set_openpype_global_environments
    from openpype.settings import get_general_environments
  File "C:\Users\milan\code\OpenPype\openpype\settings\__init__.py", line 27, in <module>
    from .entities import (
  File "C:\Users\milan\code\OpenPype\openpype\settings\entities\__init__.py", line 73, in <module>
    from .base_entity import (
  File "C:\Users\milan\code\OpenPype\openpype\settings\entities\base_entity.py", line 18, in <module>
    from openpype.lib import PypeLogger
  File "C:\Users\milan\code\OpenPype\openpype\lib\__init__.py", line 47, in <module>
    from .env_tools import (
ImportError: cannot import name 'get_global_environments' from 'openpype.lib.env_tools' (C:\Users\milan\code\OpenPype\openpype\lib\env_tools.py)

@iLLiCiTiT iLLiCiTiT requested a review from mkolar April 29, 2022 08:39
@iLLiCiTiT iLLiCiTiT merged commit fc55ad3 into develop Apr 29, 2022
@iLLiCiTiT iLLiCiTiT deleted the enhancement/remove_env_groups_from_settings branch April 29, 2022 14:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bump Minor Pull requests that update a dependency file type: enhancement Enhancements to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants