-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend plugin sorting logic #369
Conversation
Ensure that ContextPlugin are sorted before InstancePlugin when plugins have the same order
Thanks for this, it does look fine as far as tests go, which is a plus. The only thing left to consider is whether it will make debugging more or less difficult in the future. Having Which reminds me, and I'd have to check, but it's possible that because plug-ins are coming from disk (e.g. Here's what I think we could do. Currently, there are a few changes made to Pyblish that break compatibility in similar, subtle ways. And they've been put behind an environment variable where they can be "innocent until proven guilty", so to speak. They enable anyone to use Pyblish as though the feature was persistent, without affecting those that do not need it.
If we could make this change only apply to those with the Then you could also include it under the Let me know what you think. |
Yeah that sounds like a good idea. I'm gonna update the PR accordingly.
Yeah it would definitely be an additional convention that might not suit everyone. We might as well add a way to register a different sorting logic as you suggested in the related issue? Would you like me to add this in the PR?
Hmm not sure about this logic, order resulting from os.listdir is an artifact of the filesystem and cannot be relied upon, so you cannot really expect alphabetical order. Also the current order before sorting is not only dependent on os.listdir, it depends on: |
… code If PYBLISH_SORT_PER_ORDER_AND_TYPE is set, plugins will be sorted per order and per type. PYBLISH_EARLY_ADOPTER will also apply the new plugin sorting rule.
Plugin updated as you suggested. I named the environment variable |
Ensure that ContextPlugin are sorted before InstancePlugin when plugins have the same order.
This resolves #368