[plugins] env: Forward PYTHONPATH and plugins definitions in rez subrequires' environment - #3178
Draft
cbentejac wants to merge 2 commits into
Draft
[plugins] env: Forward PYTHONPATH and plugins definitions in rez subrequires' environment#3178cbentejac wants to merge 2 commits into
PYTHONPATH and plugins definitions in rez subrequires' environment#3178cbentejac wants to merge 2 commits into
Conversation
cbentejac
requested review from
demoulinv,
fabiencastan and
servantftransperfect
August 14, 2026 16:23
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3178 +/- ##
===========================================
- Coverage 86.27% 86.20% -0.08%
===========================================
Files 81 83 +2
Lines 12367 12492 +125
===========================================
+ Hits 10670 10769 +99
- Misses 1697 1723 +26 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…subrequires' environment
cbentejac
force-pushed
the
dev/globalRezEnv
branch
from
August 17, 2026 09:22
7102fae to
e1afbda
Compare
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.
Description
This PR addresses two specific issues related to the resolution of Rez environments during node computations.
Up until now, when resolving a processing environment with Rez (using the plugin's declared "subrequires"), the only thing that was done besides resolving the listed packages was reinjecting Meshroom's folder (to have access to
meshroom_compute) and the plugin's folder (to have access to local imports made in the node descriptions) to thePYTHONPATH. Environment variables that describe which plugins and nodes to load were assumed to be correctly inherited in the subrequires' environment.Although it was minimalist and easy to read (and consequently, easier to debug), the problems that came with that were:
PYTHONPATH), and the node description is rejected. In return, whenmeshroom_computeis loading the graph to evaluate the executed node's dependencies, if such a node is part of it, it is marked as "Unknown node type", which causes the executed node's UID to evaluate differently. As a consequence, the executed node cannot be processed.MESHROOM_PLUGINS_PATH,MESHROOM_USER_PLUGINS_PATH,MESHROOM_REZ_PLUGINS,MESHROOM_USER_REZ_PLUGINS,MESHROOM_NODES_PATH), it automatically resets it in the subrequires' environment, meaning the other plugins/nodes that were contained in it will be lost, causing the node descriptions not to be found, leading to the same erroneous UID evaluation.This PR solves those by reinjecting all the content of the
PYTHONPATHinto the subrequires' environment, as well as all the plugins/nodes-related variables. It ensures all imports are always accessible, and no node description is lost because the plugin was not correctly loaded (or because its description was rejected due to the global imports of local modules).The trade-off is that it makes the subprocess' command line extremely verbose and harder to understand, and it might additionally overload the
PYTHONPATHwith unnecessary modules.