Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
in
{
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.git
pkgs.gh
pkgs.vale
buildInputs = with pkgs; [
git
gh
vale
stdenv.cc.cc.lib
];

shellHook = ''
Expand All @@ -26,6 +27,9 @@
echo " - gh (GitHub CLI): $(gh --version | head -n1)"
echo " - vale (prose linter): $(vale --version)"
'';
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
pkgs.stdenv.cc.cc.lib
];
};
}
);
Expand Down
3 changes: 3 additions & 0 deletions infrahub_sdk/template/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class JinjaTemplateError(Error):
def __init__(self, message: str) -> None:
self.message = message

def __str__(self) -> str:
return str(self.message)


class JinjaTemplateNotFoundError(JinjaTemplateError):
def __init__(self, message: str | None, filename: str, base_template: str | None = None) -> None:
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ lint = [
"mypy==1.11.2",
"ruff==0.14.10",
"astroid>=3.1,<4.0",
"ty==0.0.8",
"ty==0.0.14",
]
types = [
"types-ujson",
Expand Down Expand Up @@ -136,6 +136,7 @@ invalid-await = "ignore"
invalid-type-form = "ignore"
no-matching-overload = "ignore"
unresolved-attribute = "ignore"
unused-ignore-comment = "ignore" # Clashes with mypy's type ignore comments

[[tool.ty.overrides]]
include = ["infrahub_sdk/ctl/config.py"]
Expand All @@ -160,7 +161,7 @@ not-subscriptable = "ignore"
not-iterable = "ignore"
possibly-missing-attribute = "ignore"
unresolved-attribute = "ignore"

unused-ignore-comment = "ignore" # Clashes with mypy's type ignore comments

[[tool.ty.overrides]]
include = ["docs/**"]
Expand Down
15 changes: 15 additions & 0 deletions tasks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import asyncio
import json
import sys
from pathlib import Path
from shutil import which
Expand Down Expand Up @@ -266,3 +267,17 @@ def generate_python_sdk(context: Context) -> None: # noqa: ARG001
"""Generate documentation for the Python SDK."""
_generate_infrahub_sdk_configuration_documentation()
_generate_infrahub_sdk_template_documentation()


@task
def generate_repository_jsonschema(context: Context) -> None:
"""Generate JSON schema file for repository configuration. https://github.com/opsmill/infrahub-jsonschema"""
from infrahub_sdk.schema.repository import InfrahubRepositoryConfig

repository_jsonschema = MAIN_DIRECTORY_PATH / "generated" / "repository-config" / "develop.json"

with context.cd(MAIN_DIRECTORY_PATH):
schema = json.dumps(InfrahubRepositoryConfig.model_json_schema(), indent=4)
repository_jsonschema.parent.mkdir(parents=True, exist_ok=True)
repository_jsonschema.write_text(schema)
print(f"Wrote to {repository_jsonschema}")
45 changes: 22 additions & 23 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.