Skip to content

Refactor _config module to use pydantic #3466

Open
@Viicos

Description

@Viicos

Following #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

Metadata

Metadata

Assignees

Labels

new featureEnhancement specifically adding a new feature (feature request should be used for issues instead)

Type

No type

Projects

Status

🆕 New

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions