port matrix-ops-bot to uv and nix flake module

This commit is contained in:
Abel Luck 2026-03-05 15:55:47 +01:00
parent c13d5fc536
commit 3a042155af
17 changed files with 2402 additions and 3476 deletions

View file

@ -13,6 +13,7 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
import os
import os.path
from pathlib import Path
from typing import Any, Callable, Dict, List, Tuple, Union
@ -113,7 +114,11 @@ class PluginTemplateLoader(BaseLoader):
macros: str
def __init__(self, base: str, directory: str) -> None:
base_path = get_project_root() / ".." / "templates" / base
template_root = os.environ.get("OPS_BOT_TEMPLATE_ROOT")
if template_root is None:
template_root = str(get_project_root() / ".." / "templates")
template_root_path = Path(template_root)
base_path = template_root_path / base
self.directory = base_path / directory
self.macros = sync_read_file(base_path / "macros.html")