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

Apply complex constraints involving all needs #1217

Closed
danielefaugiana opened this issue Aug 13, 2024 · 1 comment
Closed

Apply complex constraints involving all needs #1217

danielefaugiana opened this issue Aug 13, 2024 · 1 comment

Comments

@danielefaugiana
Copy link

Hello,

I have a use case for Sphinx needs in which I would like to apply a set of more complex constraints in my conf.py.

Imagine that I have a function like:

def my_advanced_constraint_function(need, needs):
    # Check something complex in a need 
    # for which I have to check other related needs
    if check_something_on_this_need_and_all_other_needs(need, needs):
         return True
    else:
         return False

And I want to apply it to my set of constraints like:

needs_constraints = {
    "my_advanced_constraint": {
        "check_0": "my_advanced_constraint_function(need, needs)",
    }
}

Obviously, this does not work as-is, but it would be a very important feature for me.

Is there any workaround to achieve the same result or any plan to improve Sphinx-needs in this direction?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants