-
Notifications
You must be signed in to change notification settings - Fork 352
Description
Hi Rez folks!
I'm interested in overriding the built-in behavior of the os.py
and arch.py
bind modules, so I added custom versions to bind_module_path in rezconfig.
Unfortunately, search path ordering in package_bind.py
means that the builtin bind modules end up taking priority over user-defined modules.
I would expect the user-defined modules to override the builtins (this is how plugin_path works, for example -- a custom env.py overrides the builtin env.py command).
Line 25 in 73e7493
searchpaths = config.bind_module_path + [builtin_path] |
Environment
- macOS 13
- Rez 2.111.3
- Python 3.9.10
To Reproduce
- Create a custom
bind_modules
directory - Create a file named "bind_modules/os.py"
- Add a custom bind module creation script to os.py
- Add
bind_modules
directory toREZ_BIND_MODULE_PATH
- Delete current os package, and call
rez-bind os
Expected behavior
My expectation is that my custom os.py module will be called.
Actual behavior
The builtin os.py is called.
Related Issues/PRs
Happy to file a PR for this one - I think it's a matter of changing:
searchpaths = config.bind_module_path + [builtin_path]
to:
searchpaths = [builtin_path] + config.bind_module_path