Skip to content
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

Broken procedure for custom package orderers #1904

Open
LedruRollin opened this issue Jan 9, 2025 · 0 comments
Open

Broken procedure for custom package orderers #1904

LedruRollin opened this issue Jan 9, 2025 · 0 comments
Labels

Comments

@LedruRollin
Copy link

Environment

  • OS : Windows 10
  • Rez version : 3.2.1
  • Rez python version : 3.9.10

To Reproduce

  1. Install Rez as recommended in the doc (link)
  2. Add a custom package orderer in the package.py as recommended in the doc (link) :
# package.py
# ...
from rez.version import Version
from rez.package_order import PackageOrder, register_orderer


class MyOrderer(PackageOrder):
    name = "my_orderer"

    def __init__(self, custom_arg: str, **kwargs):
        super().__init__(self, **kwargs)
        self.custom_arg = custom_arg

    def sort_key_implementation(self, package_name: str, version: Version):
        pass

    def __str__(self):
        pass

    def __eq__(self, other):
        pass

    def to_pod(self, other):
        pass

    @classmethod
    def from_pod(cls, data):
        pass


register_orderer(MyOrderer)

package_orderers = [
    {
        "type": "my_orderer",
        "custom_arg": "value here"
    }
]

Expected behavior
Rez should work correctly, for example with a rez-config --source-list

Actual behavior
Rez commands raise errors due to apparent circular dependency. Return of a rez-config --source-list call : error_log.txt

Related Issues/PRs

Regression
Not known

Workaround
Moving the import statement from rez.packages import iter_packages from rez/package_order.py#L13 to rez/package_order.py#L520 solves the issue. However this being a clean solution remain to be looked at.

@LedruRollin LedruRollin added the bug label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant