Pre-commit autoupdate
This commit is contained in:
parent
2a013bbd69
commit
4b94618f34
6 changed files with 12 additions and 11 deletions
|
|
@ -2,14 +2,14 @@ default_language_version:
|
||||||
python: python3
|
python: python3
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.5.0
|
rev: v4.6.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-toml
|
- id: check-toml
|
||||||
- id: check-yaml
|
- id: check-yaml
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
||||||
rev: v0.1.6
|
rev: v0.5.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
- id: ruff-format
|
- id: ruff-format
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,3 @@
|
||||||
"""A simple Odoo runbot lookalike using kubernetes."""
|
"""A simple Odoo runbot lookalike using kubernetes."""
|
||||||
|
|
||||||
__version__ = "0.2"
|
__version__ = "0.2"
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,7 @@ class SortOrder(Enum):
|
||||||
|
|
||||||
|
|
||||||
class BuildListener(Protocol):
|
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:
|
class BuildsDb:
|
||||||
|
|
|
||||||
|
|
@ -193,9 +193,10 @@ def _get_kubefiles_path(kubefiles_path: Path | None) -> Generator[Path, None, No
|
||||||
def _render_kubefiles(
|
def _render_kubefiles(
|
||||||
kubefiles_path: Path | None, deployment_vars: DeploymentVars
|
kubefiles_path: Path | None, deployment_vars: DeploymentVars
|
||||||
) -> Generator[Path, None, None]:
|
) -> Generator[Path, None, None]:
|
||||||
with _get_kubefiles_path(
|
with (
|
||||||
kubefiles_path
|
_get_kubefiles_path(kubefiles_path) as kubefiles_path,
|
||||||
) as kubefiles_path, tempfile.TemporaryDirectory() as tmp_dir:
|
tempfile.TemporaryDirectory() as tmp_dir,
|
||||||
|
):
|
||||||
tmp_path = Path(tmp_dir)
|
tmp_path = Path(tmp_dir)
|
||||||
_logger.debug("kubefiles path: %s", kubefiles_path)
|
_logger.debug("kubefiles path: %s", kubefiles_path)
|
||||||
# TODO async copytree, or make this whole _render_kubefiles run_in_executor
|
# TODO async copytree, or make this whole _render_kubefiles run_in_executor
|
||||||
|
|
|
||||||
|
|
@ -59,13 +59,13 @@ class Settings(BaseSettings):
|
||||||
# The wildcard domain where the builds will be reacheable.
|
# The wildcard domain where the builds will be reacheable.
|
||||||
build_domain: str
|
build_domain: str
|
||||||
# A dictionary of environment variables to set in the build container and jobs.
|
# 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
|
# A dictionary of secret environment variables to set in the build container and
|
||||||
# jobs.
|
# 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
|
# A dictionary of variables to be set in the jinja rendering context for the
|
||||||
# kubefiles.
|
# kubefiles.
|
||||||
build_template_vars: dict[str, str] = {} # noqa: RUF012
|
build_template_vars: dict[str, str] = {}
|
||||||
# The path of the default kubefiles to be used.
|
# The path of the default kubefiles to be used.
|
||||||
build_default_kubefiles_path: Annotated[
|
build_default_kubefiles_path: Annotated[
|
||||||
Path | None, BeforeValidator(validate_path)
|
Path | None, BeforeValidator(validate_path)
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ def sync_to_async(func: Callable[P, R]) -> Callable[P, Awaitable[R]]:
|
||||||
|
|
||||||
|
|
||||||
def sync_to_async_iterator(
|
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]]:
|
) -> Callable[P, AsyncGenerator[R, None]]:
|
||||||
@sync_to_async
|
@sync_to_async
|
||||||
def async_next(iterator: Iterator[R]) -> R:
|
def async_next(iterator: Iterator[R]) -> R:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue