| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f070136 commit 737ec92
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,12 +25,6 @@ jobs: | |||
| 25 | 25 | persist-credentials: false | |
| 26 | 26 | - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| 27 | 27 | ||
| 28 | - - name: Compile translations | ||
| 29 | - run: | | ||
| 30 | - pip install --upgrade pip | ||
| 31 | - pip install -r requirements.txt | ||
| 32 | - python babel_runner.py compile | ||
| 33 | - | ||
| 34 | 28 | - uses: hynek/build-and-inspect-python-package@fe0a0fb1925ca263d076ca4f2c13e93a6e92a33e # v2.17.0 | |
| 35 | 29 | ||
| 36 | 30 | # Upload to real PyPI on GitHub Releases. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,6 +8,8 @@ | |||
| 8 | 8 | import tomllib | |
| 9 | 9 | from pathlib import Path | |
| 10 | 10 | ||
| 11 | + from hatchling.builders.hooks.plugin.interface import BuildHookInterface | ||
| 12 | + | ||
| 11 | 13 | # Global variables used by pybabel below (paths relative to PROJECT_DIR) | |
| 12 | 14 | DOMAIN = "python-docs-theme" | |
| 13 | 15 | COPYRIGHT_HOLDER = "Python Software Foundation" | |
@@ -106,6 +108,11 @@ def compile_catalogs(locale: str) -> None: | |||
| 106 | 108 | subprocess.run(cmd, cwd=PROJECT_DIR, check=True) | |
| 107 | 109 | ||
| 108 | 110 | ||
| 111 | + class CustomBuildHook(BuildHookInterface): | ||
| 112 | + def initialize(self, version: str, build_data: dict[str, object]) -> None: | ||
| 113 | + compile_catalogs("") | ||
| 114 | + | ||
| 115 | + | ||
| 109 | 116 | def main() -> None: | |
| 110 | 117 | parser = argparse.ArgumentParser(description=__doc__) | |
| 111 | 118 | parser.add_argument( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,8 @@ | |||
| 1 | 1 | [build-system] | |
| 2 | - build-backend = "flit_core.buildapi" | ||
| 2 | + build-backend = "hatchling.build" | ||
| 3 | 3 | requires = [ | |
| 4 | - "flit-core>=3.7", | ||
| 4 | + "babel", | ||
| 5 | + "hatchling", | ||
| 5 | 6 | ] | |
| 6 | 7 | ||
| 7 | 8 | [project] | |
@@ -36,9 +37,12 @@ urls.Download = "https://pypi.org/project/python-docs-theme/" | |||
| 36 | 37 | urls.Homepage = "https://github.com/python/python-docs-theme/" | |
| 37 | 38 | entry-points."sphinx.html_themes".python_docs_theme = "python_docs_theme" | |
| 38 | 39 | ||
| 39 | - [tool.flit] | ||
| 40 | - module.name = "python_docs_theme" | ||
| 41 | - sdist.include = [ "python_docs_theme/" ] | ||
| 40 | + [tool.hatch] | ||
| 41 | + build.artifacts = [ "python_docs_theme/locale/**/*.mo" ] | ||
| 42 | + build.hooks.custom.path = "babel_runner.py" | ||
| 43 | + build.targets.wheel.packages = [ "python_docs_theme" ] | ||
| 44 | + build.targets.wheel.exclude = [ "python_docs_theme/locale/**/*.po" ] | ||
| 45 | + version.path = "python_docs_theme/__init__.py" | ||
| 42 | 46 | ||
| 43 | 47 | [tool.ruff] | |
| 44 | 48 | fix = true | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,6 @@ | |||
| 7 | 7 | # Translators: | |
| 8 | 8 | # Cristián Maureira-Fredes, 2025 | |
| 9 | 9 | # | |
| 10 | - #, fuzzy | ||
| 11 | 10 | msgid "" | |
| 12 | 11 | msgstr "" | |
| 13 | 12 | "Project-Id-Version: python-docs-theme 2025.5\n" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,4 @@ | |||
| 1 | 1 | # for babel_runner.py | |
| 2 | 2 | Babel | |
| 3 | + hatchling | ||
| 3 | 4 | Jinja2 | |
| Back | FazBrowse Home | New Git URL |
0 commit comments