Closed 2bndy5 closed 1 year ago
So, I devised a solution for this, but it would mean pinning pydantic to v2+ because there are so many breaking changes that supporting pydantic v1.x and v2.x is rather impossible.
I think they switched their codebase to rust in v2 which yields a performance increase (naturally).
I also found out that there's an optional package to validate color values. Using this as an additional dependency would relax the constraints on the custom admonitions color
config value (which is currently limited to only a 3-tuple of integers).
pydantic just released v2.0.
Now I'm getting errors related to the
CustomAdmonitionConfig
dataclass:Traceback
``` Running Sphinx v7.0.1 Traceback (most recent call last): File "/home/brendan/.local/lib/python3.10/site-packages/sphinx/cmd/build.py", line 280, in build_main app = Sphinx(args.sourcedir, args.confdir, args.outputdir, File "/home/brendan/.local/lib/python3.10/site-packages/sphinx/application.py", line 229, in __init__ self.setup_extension(extension) File "/home/brendan/.local/lib/python3.10/site-packages/sphinx/application.py", line 402, in setup_extension self.registry.load_extension(self, extname) File "/home/brendan/.local/lib/python3.10/site-packages/sphinx/registry.py", line 442, in load_extension metadata = setup(app) File "/home/brendan/.local/lib/python3.10/site-packages/sphinx_immaterial/__init__.py", line 297, in setup app.setup_extension("sphinx_immaterial.custom_admonitions") File "/home/brendan/.local/lib/python3.10/site-packages/sphinx/application.py", line 402, in setup_extension self.registry.load_extension(self, extname) File "/home/brendan/.local/lib/python3.10/site-packages/sphinx/registry.py", line 429, in load_extension mod = import_module(extname) File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "I think we need to simply update the validator for custom admonitions'
color
&classes
config fields. See pydantic's migration guide. However, there could be other breaking changes that haven't surfaced yet.We should also discuss pinning our dependence of pydantic. Although, this idea is subject to a solution to this issue.