ManimCommunity / ManimCommunity/manim
Refactor `_config` module to use `pydantic`
@Viicos is already working on this.
Since Oct 21, 2024.
- Dominant language
- Python
- Stars
- 40.9k
- Forks
- 3.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
Description
Following https://github.com/ManimCommunity/manim/pull/3440, we should refactor the _config module (and especially the ManimConfig class), preferably using pydantic to have builtin validation. Here are a few thoughts I had about this:
- use
pydantic-settingsto make use of settings related features: creating a custom source to parse.cfgfiles (and be able to parse env vars as well?)default.cfgwill be removed in favor of model default values (+ Some comments were outdated in this file as well).
- Refactor utils like
make_logger,parse_theme, etc. Ideally, they should be tied toconfigparser.
On this is tackled, we could think of adding support for other config formats (other than .cfg), e.g. TOML which is slowly becoming the standard. However, this introduces extra maintenance cost (especially on the documentation side), so this is still to be discussed.
I'll work on the first part and get an initial implementation this week, that can then be discussed for improvements
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.