Coverage for /home/runner/work/coxbuild/coxbuild/src/coxbuild/schema.py: 0%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1import importlib
2import pathlib
3from dataclasses import asdict
4from datetime import timedelta
5from types import ModuleType
6from typing import Awaitable, Callable
8from .configurations import Configuration
9from .configurations.builders import (ConfigurationBuilderCollection,
10 JsonConfigurationBuilder,
11 YamlConfigurationBuilder)
12from .extensions import Extension, ProjectSettings, withProject
13from .invocation import CommandExecutionArgs, CommandExecutionResult, run
14from .managers import Manager
15from .pipelines import (Pipeline, PipelineContext, PipelineHook,
16 PipelineResult, TaskContext, TaskHook, afterPipeline,
17 afterTask, beforePipeline, beforeTask)
18from .runtime import (ExecutionState, withConfig, withEvent,
19 withExecutionState, withHandler, withManager,
20 withPipeline, withService, withTask)
21from .services import EventHandler, Service, on
22from .tasks import (after, asafter, asbefore, aspostcond, asprecond, assetup,
23 asteardown, before, continueOnError, depend, group, named,
24 postcond, precond, setup, task, teardown)
26manager = Manager()
27execute = manager.execute
28executeAsync = manager.executeAsync
31def ext(extension: ModuleType | str) -> Extension:
32 from .extensions.loader import fromModule
33 from .extensions.loader import load as loadext
35 if isinstance(extension, str):
36 print(f"Loading extension from {extension}")
37 extension = loadext(extension)
38 else:
39 print(f"Loading extension from module {extension.__name__}")
40 extension = fromModule(extension)
41 manager.register(extension)
42 return extension