-
Notifications
You must be signed in to change notification settings - Fork 358
Description
Shoule be a better title for this, but I cannot came up one that is short enough and understandable, so just take the error message for now.
This is an edge case, but the error was confusing so I though this should be worth to report.
Problem (Reproducible)
I have a package that ships a custom package repository plugin, the directory structure looks like this:
my_package
│ package.py
│
└─rezplugins
│ __init__.py
│
└─package_repository
│ __init__.py
└─ my_plugin.py
And in my terminal, cd to my_package, with rez and python pacakge being resolved in the context, run Python and :
> ..\my_package>python
Python 3.7.9 (default, Aug 31 2020, 17:10:11) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
>>> from rez.config import config
>>> from rez.package_repository import package_repository_manager
>>> for path in config.packages_path:
... repo = package_repository_manager.get_repository(path)
...
15:34:06 DEBUG searching plugin path ..\my_package\rezplugins\package_repository...
Traceback (most recent call last):
File "..\pacakges\install\rez\2.67.0\platform-windows\rez\plugin_managers.py", line 176, in get_plugin_class
return self.plugin_classes[plugin_name]
KeyError: 'filesystem'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "..\pacakges\install\rez\2.67.0\platform-windows\rez\package_repository.py", line 441, in get_repository
repository = self._get_repository(normalised_path)
File "..\pacakges\install\rez\2.67.0\platform-windows\rez\package_repository.py", line 512, in _get_repository
cls = plugin_manager.get_plugin_class('package_repository', repo_type)
File "..\pacakges\install\rez\2.67.0\platform-windows\rez\plugin_managers.py", line 297, in get_plugin_class
return plugin.get_plugin_class(plugin_name)
File "..\pacakges\install\rez\2.67.0\platform-windows\rez\plugin_managers.py", line 179, in get_plugin_class
% (self.pretty_type_name, plugin_name))
rez.exceptions.RezPluginError: Unrecognised package repository plugin: 'filesystem'
>>>Notice the debug message :
15:34:06 DEBUG searching plugin path ..\my_package\rezplugins\package_repository...It should look into rezplugins which is inside Rez's installation path or the one that is installed as a package, but it seems only look into the one in my_package.
And everything back to normal once I cd out this dir.
Discussion
Currently, I only found that error when I run the above code in Python, Rez's command-line tool shouldn't have this issue I think, at least I haven't found one.
So, should Rez ignore the current working directory when loading plugins ? Or ?