hatch_build.py
raw| 1 | import os |
| 2 | |
| 3 | from hatchling.builders.hooks.plugin.interface import BuildHookInterface |
| 4 | |
| 5 | |
| 6 | class CustomBuildHook(BuildHookInterface): |
| 7 | def initialize(self, version, build_data): |
| 8 | from babel.messages.frontend import compile_catalog |
| 9 | |
| 10 | for theme in 'mkdocs', 'readthedocs': |
| 11 | cmd = compile_catalog() |
| 12 | cmd.directory = os.path.join('mkdocs', 'themes', theme, 'locales') |
| 13 | cmd.finalize_options() |
| 14 | cmd.run() |