AcademySoftwareFoundation / AcademySoftwareFoundation/rez
RezPluginError: Unrecognised package repository plugin: 'filesystem'
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 374
- Avg merge
- 9d 12h
- Merged PRs (30d)
- 5
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 :
```python
> ..\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 "", line 2, in
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 :
```python
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 ?
Contributor guide
Research direction
Start by reading the plugin-loading paths shown in rez/plugin_managers.py and the repository lookup in rez/package_repository.py. Reproduce the failure from a package directory, then determine the intended handling of the current working directory; done means the built-in filesystem repository plugin loads correctly there or the resulting error clearly identifies the cause.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100