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

Support for automatically creating need definitions #17

Open
twodrops opened this issue Oct 5, 2022 · 1 comment
Open

Support for automatically creating need definitions #17

twodrops opened this issue Oct 5, 2022 · 1 comment

Comments

@twodrops
Copy link

twodrops commented Oct 5, 2022

Currently, sphinx-modeling allows creation of validations. As I understand, this is already possible with needs_warnings. It is probably a bit more verbose than sphinx-modeling, but in the end one can argue that this is a personal preference of syntax.

The real benefit of sphinx-modeling would be when it can create need definitions automatically out of the model definitions. Then there is no more duplication in the form of "classic" need defintions or as needs_warnings for model integrity checks

I read the hint that this is planned. Just wanted to create a placeholder issue for it :)

Is there anything that we can do now with sphinx-modeling, which is not possible with needs_warnings?

Btw, I do appreciate the efforts put it in so far and does not want to take anything away from the nice work.

@ubmarco
Copy link
Member

ubmarco commented Oct 11, 2022

Generating the config is a valid request. I will try to find the time to implement it.

For needs_warnings, I see some major differences:

  • definition phase: defining models with needs_warnings is not just more verbose, it is tedious, complex and from my POV prone to errors as a lot of code is needed in conf.py for things that does pydantic out of the box.
  • run phase: needs_warnings are emitted on build-finished while sphinx-modeling runs much earlier on doctree-resolved which is a big win for big projects
  • log phase: needs_warnings prints the filter with the violated needs. sphinx-modeling prints each field with specific validation information what went wrong.

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