ManimCommunity / ManimCommunity/manim

Refactor `_config` module to use `pydantic`

Open
#3,466 2 comments 0 reactions 1 assignee View on GitHub

@Viicos is already working on this.

Since Oct 21, 2024.

new feature
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-settings to make use of settings related features: creating a custom source to parse .cfg files (and be able to parse env vars as well?)
    • default.cfg will 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 to configparser.

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.