fix: expand user home in anatomy roots - #1882
Closed
Viodmian wants to merge 3 commits into
Closed
Conversation
Member
|
May I ask what is the use-case to use home directory in roots? |
iLLiCiTiT
reviewed
Jun 30, 2026
| try: | ||
| self.value = lowered_platform_keys[current_platform].format_map( | ||
| os.environ | ||
| self.value = self._expand_root_value( |
Member
There was a problem hiding this comment.
Shouldn't the _expand_root_value also handle format_map with os.environ?
iLLiCiTiT
reviewed
Jun 30, 2026
| self._log = None | ||
| lowered_platform_keys = { | ||
| key.lower(): value | ||
| key.lower(): self._expand_root_value(value) |
Member
There was a problem hiding this comment.
I think the expand should happen only for current platform. BTW if someone would use the ~ in roots the remapping of roots probably won't work as expected.
If there is calculated path on different machine/user (e.g. in workfile) you can't remap it on different machine.
Member
|
Closing in favor of #1884 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog Description
Expand
~in anatomy root definitions so paths like~/foo/barresolve to the current user's home directory before root values are cleaned and exposed through helpers.Fixes #1874.
Additional info
This keeps the existing environment-variable formatting behavior for current-platform roots and applies home expansion to configured root values before they are stored in
raw_data/cleaned_data.Testing notes:
python -m pytest tests\client\ayon_core\pipeline\anatomy\test_roots.py -qgit diff --checkpython -m py_compile client\ayon_core\pipeline\anatomy\roots.py tests\client\ayon_core\pipeline\anatomy\test_roots.py