epythet.config_parser¶
Legacy configuration accessor kept for the frozen docsrc/conf.py copies.
Over a hundred projects committed a docsrc/conf.py that does:
project, copyright, author, release, display_name = parse_config(
Path(__file__).absolute().parent.parent / "setup.cfg"
)
That 5-tuple is a published contract, so it stays. New code should use
epythet.config.load_config(), which returns the full
DocsConfig.
Functions
|
Project metadata for Sphinx's |
- epythet.config_parser.parse_config(config_file)[source]¶
Project metadata for Sphinx’s
conf.py, as a 5-tuple.config_filemay be asetup.cfgpath, apyproject.tomlpath or the project directory itself. Whatever is passed, the project directory is what gets resolved:pyproject.toml(with a[project]table) wins oversetup.cfgwhen both exist. Seeepythet.configfor the keys.copyrightis an empty string when unset, and the generated docs render no copyright line in that case.- Parameters:
config_file –
PROJECT_DIR/setup.cfg,PROJECT_DIR/pyproject.tomlorPROJECT_DIR- Returns:
(name, copyright, author, version, display_name)- Raises:
FileNotFoundError – when neither configuration file exists