Pre-commit autoupdate

This commit is contained in:
Stéphane Bidoul 2024-06-30 10:25:24 +02:00
parent 2a013bbd69
commit 4b94618f34
6 changed files with 12 additions and 11 deletions

View file

@ -2,14 +2,14 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.1.6
rev: v0.5.0
hooks:
- id: ruff
- id: ruff-format

View file

@ -1,2 +1,3 @@
"""A simple Odoo runbot lookalike using kubernetes."""
__version__ = "0.2"

View file

@ -19,8 +19,7 @@ class SortOrder(Enum):
class BuildListener(Protocol):
def on_build_event(self, event: BuildEvent, build: Build) -> None:
...
def on_build_event(self, event: BuildEvent, build: Build) -> None: ...
class BuildsDb:

View file

@ -193,9 +193,10 @@ def _get_kubefiles_path(kubefiles_path: Path | None) -> Generator[Path, None, No
def _render_kubefiles(
kubefiles_path: Path | None, deployment_vars: DeploymentVars
) -> Generator[Path, None, None]:
with _get_kubefiles_path(
kubefiles_path
) as kubefiles_path, tempfile.TemporaryDirectory() as tmp_dir:
with (
_get_kubefiles_path(kubefiles_path) as kubefiles_path,
tempfile.TemporaryDirectory() as tmp_dir,
):
tmp_path = Path(tmp_dir)
_logger.debug("kubefiles path: %s", kubefiles_path)
# TODO async copytree, or make this whole _render_kubefiles run_in_executor

View file

@ -59,13 +59,13 @@ class Settings(BaseSettings):
# The wildcard domain where the builds will be reacheable.
build_domain: str
# A dictionary of environment variables to set in the build container and jobs.
build_env: dict[str, str] = {} # noqa: RUF012
build_env: dict[str, str] = {}
# A dictionary of secret environment variables to set in the build container and
# jobs.
build_secret_env: dict[str, str] = {} # noqa: RUF012
build_secret_env: dict[str, str] = {}
# A dictionary of variables to be set in the jinja rendering context for the
# kubefiles.
build_template_vars: dict[str, str] = {} # noqa: RUF012
build_template_vars: dict[str, str] = {}
# The path of the default kubefiles to be used.
build_default_kubefiles_path: Annotated[
Path | None, BeforeValidator(validate_path)

View file

@ -28,7 +28,7 @@ def sync_to_async(func: Callable[P, R]) -> Callable[P, Awaitable[R]]:
def sync_to_async_iterator(
iterator_func: Callable[P, Generator[R, None, None]]
iterator_func: Callable[P, Generator[R, None, None]],
) -> Callable[P, AsyncGenerator[R, None]]:
@sync_to_async
def async_next(iterator: Iterator[R]) -> R: