API#
Opinionated, declarative tasks for doit from well-known TOML and JSON files.
- class doitoml.DoiTOML(config_paths=None, *, cwd=None, update_env=None, fail_quietly=None, log=None, log_level=None, discover_config_paths=None, validate=None, safe_paths=None) None[source]#
Bases:
objectAn opinionated pyproject.toml-based doit task generator.
Initialize a
doitomltask generator.- build_one_action(action, execution_context) List[str | List[str] | List[str | Path] | Callable[[], bool | None] | Callable[[...], bool | None] | Tuple[Callable[[...], bool | None], List[Any]] | Tuple[Callable[[...], bool | None], List[Any], Dict[str, Any]]] | None[source]#
Build up a single action definition.
- build_subtask_actions(task, execution_context) List[str | List[str] | List[str | Path] | Callable[[], bool | None] | Callable[[...], bool | None] | Tuple[Callable[[...], bool | None], List[Any]] | Tuple[Callable[[...], bool | None], List[Any], Dict[str, Any]]][source]#
Build all actions in a subtask.
- Parameters:
task (
Task) –execution_context (
ExecutionContext) –
- Return type:
List[Union[str,List[str],List[Union[str,Path]],Callable[[],Optional[bool]],Callable[...,Optional[bool]],Tuple[Callable[...,Optional[bool]],List[Any]],Tuple[Callable[...,Optional[bool]],List[Any],Dict[str,Any]]]]
- build_subtask_uptodates(task, execution_context) List[Any][source]#
Expand custom updaters into actual functions.
- Parameters:
task (
Task) –execution_context (
ExecutionContext) –
- Return type:
- build_task_group(prefix, subtasks) Callable[[], Task | Generator[Task, None, None]][source]#
Build a nested
doittask group.
-
entry_points:
EntryPoints#
- get_env(key, default=None) str[source]#
Get an environment variable from the real (or in-progress) environment.
- group_tasks(tasks) Dict[str, Dict[Tuple[str, ...], Task]][source]#
Group tasks by their first prefix.
- init_config(config_paths, update_env=None, fail_quietly=None, discover_config_paths=None, validate=None, safe_paths=None) Config[source]#
Initialize configuration.
- Parameters:
- Return type:
- logged_action(args, popen_kwargs, execution_context) bool[source]#
Run a process, capturing the output to files.
Constants#
Constants for doitoml.
- class doitoml.constants.DEFAULTS[source]#
Bases:
objectdoitomlconfig values.- ALL_FROM_FIRST_CONFIG = ('update_env', 'fail_quietly', 'validate', './pyproject.toml')#
the values that will be read from the first config file
- class doitoml.constants.DOITOML_META[source]#
Bases:
objectKeys of the
doitomlmap indoittaskmeta.
- class doitoml.constants.DOIT_TASK[source]#
Bases:
objectA collection of well-known
doitkeys.- LIST_KEYS = ('file_dep', 'task_dep', 'targets', 'actions', 'clean')#
doittask items known to be lists
- RELATIVE_LISTS = ('file_dep', 'targets', 'clean')#
doitkeys that are always paths
- class doitoml.constants.ENTRY_POINTS[source]#
Bases:
objectdoitomlextension points.-
CONFIG:
Literal['doitoml.config-parser.v0'] = 'doitoml.config-parser.v0'# extend the
doitomlconfig parser vocabulary
-
PARSER:
Literal['doitoml.parser.v0'] = 'doitoml.parser.v0'# extend the
doitomlsource parser vocabulary
-
CONFIG:
- doitoml.constants.FALSEY = ['', 'false', '0', '0.0', '{}', '[]', 'null', 'none']#
all the false things
- doitoml.constants.FNMATCH_WILDCARDS = '*?['#
fnmatch triggers
- doitoml.constants.NAME = 'doitoml'#
package/config name
Types#
Types for doitoml (but mostly doit).
- class doitoml.types.ExecutionContext(cwd: Path, env: Dict[str, str], log_paths: Tuple[Path | None, Path | None], log_mode: str)[source]#
Bases:
NamedTupleA collection of data relevant to starting a process or calling a function.
Create new instance of ExecutionContext(cwd, env, log_paths, log_mode)
- class doitoml.types.Task[source]#
Bases:
TypedDicta mostly-inaccurate, but well-intentioned definition of some doit task.
-
actions:
List[Union[str,List[str],List[Union[str,Path]],Callable[[],Optional[bool]],Callable[...,Optional[bool]],Tuple[Callable[...,Optional[bool]],List[Any]],Tuple[Callable[...,Optional[bool]],List[Any],Dict[str,Any]]]]#
-
meta:
TaskMetadata#
-
actions:
- class doitoml.types.TaskMetadata[source]#
Bases:
TypedDictWell-known values in task metadata.
-
doitoml:
DoitomlTaskMetadata#
-
doitoml:
Schema#
optional schema for doitoml.
Schema Types#
- doitoml.schema._gen._doit_v0_schema.Action#
action.
Aggregation type: oneOf
alias of
Union[ShellAction,TokenAction,ActorAction]
- doitoml.schema._gen._doit_v0_schema.ActorAction = ForwardRef('_ActorActionAnyof0')#
actor action.
a custom action
Aggregation type: anyOf
- doitoml.schema._gen._doit_v0_schema.CommandTokens#
command tokens.
command tokens which may be expanded as paths
- class doitoml.schema._gen._doit_v0_schema.DoitomlMetadata[source]#
Bases:
TypedDictdoitoml Metadata.
- class doitoml.schema._gen._doit_v0_schema.DoitomlSchema[source]#
Bases:
TypedDictdoitoml schema.
schema for
doitomlconfiguration-
env:
Dict[str,str]# environment variables.
environment variables shared among all tasks
Required property
-
env:
- doitoml.schema._gen._doit_v0_schema.EnvironmentVariables#
environment variables.
environment variables shared among all tasks
- class doitoml.schema._gen._doit_v0_schema.Metadata[source]#
Bases:
TypedDictMetadata.
-
doitoml:
DoitomlMetadata# doitoml Metadata.
-
doitoml:
- doitoml.schema._gen._doit_v0_schema.PathTokens#
path tokens.
paths to expand and normalize, relative to the current working directory
- doitoml.schema._gen._doit_v0_schema.ShellAction#
shell action.
Errors#
Custom exceptions for doitoml.
- exception doitoml.errors.ActorError[source]#
Bases:
ActionErrorAn error related to custom actor actions.
- exception doitoml.errors.ConfigError[source]#
Bases:
DoitomlErrorAn error related to configuration.
- exception doitoml.errors.DoitomlError[source]#
Bases:
ValueErrorSome kind of error in
doitoml.
- exception doitoml.errors.DslError[source]#
Bases:
ConfigErrorAn error related to a domain-specific language plugin during configuration.
- exception doitoml.errors.EntryPointError[source]#
Bases:
DoitomlErrorAn error related to initializing entry points.
- exception doitoml.errors.EnvVarError[source]#
Bases:
ConfigErrorAn error related to an environment variable during configuration.
- exception doitoml.errors.Jinja2Error[source]#
Bases:
ActorErrorAn error related to Jinja2 templates.
- exception doitoml.errors.JsonEError[source]#
Bases:
ConfigErrorAn error related to JSON-e.
- exception doitoml.errors.MetaError[source]#
Bases:
TaskErrorAn error related to
doitomltask metadata.
- exception doitoml.errors.MissingDependencyError[source]#
Bases:
ValueErrorAn error related to a missing (optional) dependency.
- exception doitoml.errors.NoActorError[source]#
Bases:
ActorErrorAn error related to a missing actor.
- exception doitoml.errors.NoConfigError[source]#
Bases:
ConfigErrorAn error when no configuration at all is found.
- exception doitoml.errors.NoTemplaterError[source]#
Bases:
TemplaterErrorAn error related to missing templaters.
- exception doitoml.errors.ParseError[source]#
Bases:
DoitomlErrorAn error related to source parsing.
- exception doitoml.errors.PrefixError[source]#
Bases:
ConfigErrorA config error related to prefixes of configuration files.
- exception doitoml.errors.PyError[source]#
Bases:
DoitomlErrorAn error related to discovering and calling user-defined Python functions.
- exception doitoml.errors.SchemaError[source]#
Bases:
DoitomlErrorAn error related to a non-conforming
doitomlconfiguration.
- exception doitoml.errors.SkipError[source]#
Bases:
ConfigErrorAn error related to an ambiguous skip.
- exception doitoml.errors.TaskError[source]#
Bases:
DoitomlErrorAn error related to generating valid tasks.
- exception doitoml.errors.TemplaterError[source]#
Bases:
ConfigErrorAn error related to templates.
- exception doitoml.errors.UnresolvedError[source]#
Bases:
ConfigErrorA config error related to unresolved values.
- exception doitoml.errors.UnsafePathError[source]#
Bases:
ConfigErrorAn error related to unsafe paths.
Entry Points#
Loads entry points.
- class doitoml.entry_points.EntryPoints(doitoml) None[source]#
Bases:
objectA collection of named
entry_points.- Parameters:
doitoml (
DoiTOML) –
Create a new collection of loaded
entry_points.- Parameters:
doitoml (
DoiTOML) –
-
config_parsers:
Dict[str,ConfigParser]#
- load_entry_point_group(group) Dict[str, Any][source]#
Find and load
entry_pointsfrom installed packages.
- rank_key(key_ep) Tuple[int | float, str][source]#
Return a sort key based on the
entry_point’srankand key.
Loaders#
Custom loaders for doit tasks.
Configuration#
Handles discovering, loading, and normalizing configuration.
- class doitoml.sources._config.ConfigParser(doitoml) None[source]#
Bases:
ParserA parser that knows how to find well-known sources.
- Parameters:
doitoml (
DoiTOML) –
- class doitoml.sources._config.ConfigSource(path) None[source]#
Bases:
SourceA source of
doitomlconfiguration.- Parameters:
path (
Path) –
- doitoml.sources._config.PREFIX = 'prefix'#
the prefix key in
doitomlconfiguration
- class doitoml.sources._config.WrapperConfigSource(child_source, bit_prefix) None[source]#
Bases:
ConfigSourceA config source which wraps another source with a specific root.
Initialize a source, remembering its child and
getbits.-
child_source:
Source#
-
child_source:
Handles discovering, loading, and normalizing configuration.
- class doitoml.config.Config(doitoml, config_paths, *, update_env=None, fail_quietly=None, discover_config_paths=None, validate=None, safe_paths=None) None[source]#
Bases:
objectA composite configuration loaded from multiple ConfigSource.
- Parameters:
Create empty configuration and discover sources.
- Parameters:
- build_log_paths(source, log, cwd) Tuple[Path | None, Path | None][source]#
Set up proper path behavior from log metadata.
- check_log_paths(stderr_path, stdout_path) Tuple[Path | None, Path | None][source]#
Verify log paths.
- claim_prefix(source, sources) None[source]#
Claim a prefix for a source.
- Parameters:
source (
ConfigSource) –sources (
Dict[str,ConfigSource]) –
- Return type:
- find_config_sources() Dict[str, ConfigSource][source]#
Find all directly and referenced configuration sources.
- Return type:
- find_one_config_source(config_source, sources) None[source]#
Discover a config source and its potentially-nested extra sources.
- Parameters:
config_source (
ConfigSource) –sources (
Dict[str,ConfigSource]) –
- Return type:
- get_config_parser(config_path) ConfigParser[source]#
Find the config parser for a path.
- Parameters:
config_path (
Path) –- Return type:
- init_env(unresolved_env, retries) Dict[str, str][source]#
Initialize the global environment variable.
- init_paths(unresolved_paths, retries) Dict[Tuple[str, ...], List[str]][source]#
Find all paths in all sources.
- init_source_env(source, unresolved_env) None[source]#
Initialize the env declared in a single source.
- Parameters:
source (
ConfigSource) –
- Return type:
- init_source_paths(source, unresolved_paths) None[source]#
Find the prefixed paths declared in a single source.
- init_source_tokens(source, unresolved_tokens) None[source]#
Find the prefixed paths declared in a single source.
- init_tokens(unresolved_tokens, retries) Dict[Tuple[str, ...], List[str]][source]#
Find all commands in all sources.
- load_config_source(config_path) ConfigSource[source]#
Maybe load a configuration source.
- Parameters:
config_path (
Path) –- Return type:
- normalize_task_meta(source, task) Task[source]#
Normalize task metadata.
- Parameters:
source (
ConfigSource) –task (
Task) –
- Return type:
- resolve_one_action(source, action) Tuple[List[Any], List[str]][source]#
Expand the members of a single action.
- resolve_one_dict_action(source, action) Tuple[List[Any], List[str]][source]#
Resolve an action by an actor.
- resolve_one_env(source, env_value) str | None[source]#
Resolve a single env member.
- Parameters:
source (
ConfigSource) –env_value (
Any) –
- Return type:
- resolve_one_path_spec(source, spec, source_relative, cwd=None) List[str] | None[source]#
Resolve a single path in a task or one of the special field tables.
If
source_relative, transform unparsed strings into a path.
- resolve_one_skip(source, skip) bool[source]#
Maybe skip discovery of task (and all its children).
- Parameters:
source (
ConfigSource) –skip (
Any) –
- Return type:
- resolve_one_task(source, prefixes, task) Generator[Tuple[Tuple[str, ...], Task], None, None][source]#
Resolve a single simple task.
- resolve_one_task_list_field(source, task, field) List[str][source]#
Expand the members of a single field.
- Parameters:
source (
ConfigSource) –task (
Task) –field (
str) –
- Return type:
- resolve_one_task_or_group(source, prefixes, task_or_group) Generator[Tuple[Tuple[str, ...], Task], None, None][source]#
Resolve a task or task group in a prefix.
- resolve_one_token_action(source, action) Tuple[List[Any], List[str]][source]#
Resolve an action made of shell tokens.
- resolve_one_uptodate(source, uptodate) Tuple[Dict[str, Any], List[str]][source]#
Transform a single uptodate.
- resolve_some_path_specs(source, specs, source_relative) Tuple[List[Any], List[str]][source]#
Resolve a list of path specs.
- resolve_task_actions(source, task) List[str][source]#
Get the new actions (and unresolved paths) for a task.
- Parameters:
source (
ConfigSource) –task (
Task) –
- Return type:
- resolve_task_uptodate(source, task) List[str][source]#
Transform some uptodate values.
- Parameters:
source (
ConfigSource) –task (
Task) –
- Return type:
-
sources:
Dict[str,ConfigSource]#
- to_dict() DoitomlSchema[source]#
Return a normalized subset of config data.
- Return type:
Sources#
Specific task opinions about well-known files.
JSON#
A base class for JSON sources.
- class doitoml.sources.json._json.JsonParser(doitoml) None[source]#
Bases:
ParserA parser for JSON files.
- Parameters:
doitoml (
DoiTOML) –
- class doitoml.sources.json._json.JsonSource(path, encoding=None) None[source]#
Bases:
JsonLikeSource
package.json#
Handles path/task discovery in package.json.
- class doitoml.sources.json.package.PackageJson(path, encoding=None) None[source]#
Bases:
JsonSource,ConfigSourceAn npm-compatible
package.json.
TOML#
TOML sources.
- class doitoml.sources.toml._toml.TomlParser(doitoml) None[source]#
Bases:
ParserA parser for TOML files.
- Parameters:
doitoml (
DoiTOML) –
- class doitoml.sources.toml._toml.TomlSource(path, encoding=None) None[source]#
Bases:
JsonLikeSourceA source of configuration in TOML.
pyproject.toml#
Handles path/task discovery in pyproject.toml.
- class doitoml.sources.toml.pyproject.PyprojectToml(path, encoding=None) None[source]#
Bases:
TomlSource,ConfigSourceFinds tasks and paths in
pyproject.toml.
- class doitoml.sources.toml.pyproject.PyprojectTomlParser(doitoml) None[source]#
Bases:
ConfigParserEntry point for parsing configuration from
pyproject.toml.- Parameters:
doitoml (
DoiTOML) –
- pattern = re.compile('pyproject.toml$')#
- well_known = ('./pyproject.toml',)#
- doitoml.sources.toml.pyproject.TOOL = 'tool'#
the “Wild West” top-level key
YAML#
YAML sources.
doit Specific Language#
Domain-specific language for declarative doit task generation.
- class doitoml.dsl.DSL(doitoml) None[source]#
Bases:
objectA base class for a
doitomlDSL plugin.- Parameters:
doitoml (
DoiTOML) –
Create a DSL and remember its parent.
- Parameters:
doitoml (
DoiTOML) –
- abstract property pattern: Pattern[str]#
Advertise the regular expression that will uniquely identify this DSL.
- rank = 100#
the rank of the DSL
- class doitoml.dsl.EnvReplacer(doitoml) None[source]#
Bases:
DSLA wrapper for UNIX-style variable expansion.
- Parameters:
doitoml (
DoiTOML) –
Create a DSL and remember its parent.
- Parameters:
doitoml (
DoiTOML) –
- pattern = re.compile('\\$\\{([^\\}]+)\\}')#
- rank = 90#
paths go before most other built-in DSL
- class doitoml.dsl.Getter(doitoml) None[source]#
Bases:
DSLA wrapper for known parsers.
- Parameters:
doitoml (
DoiTOML) –
Initialize and pre-calculate the pattern.
- Parameters:
doitoml (
DoiTOML) –
- get_source_with_key(source, match, raw_token) Tuple[Source, List[str]][source]#
Find a raw source and its bits.
- class doitoml.dsl.Globber(doitoml) None[source]#
Bases:
DSLA wrapper for
globandrglob.- Parameters:
doitoml (
DoiTOML) –
Create a DSL and remember its parent.
- Parameters:
doitoml (
DoiTOML) –
- pattern = re.compile('^:(?P<kind>(r?glob))::(?P<rest>:{0,2}.*)$')#
- transform_token(source, match, raw_token, **kwargs) List[str][source]#
Expand a token to zero or more
pathlib.Pathbased on (r)glob(s).Chunks are delimited by
::. The first chunk is a relative path.Each following chunk between
::may be a matcher or have a prefix.!: are.Patternwhich will exclude all matched items/s/: expects two following chunks:the first is a
re.Patternto findthe next is the replacement string
Order does not matter: all excludes an replacers will be applied after all matches are expanded.
- class doitoml.dsl.PathRef(doitoml) None[source]#
Bases:
DSLLook for previously-found paths.
- Parameters:
doitoml (
DoiTOML) –
Create a DSL and remember its parent.
- Parameters:
doitoml (
DoiTOML) –
- pattern = re.compile('^::((?P<prefix>[^:]*)::)?(?P<ref>[^:]+)$')#
- rank = 80#
paths go before all other built-in DSL
Actors#
Base actor for doitoml.
- class doitoml.actors._actor.Actor(doitoml) None[source]#
Bases:
objectA base class for a
doitomlactor plugin.- Parameters:
doitoml (
DoiTOML) –
Create an Actor and remember its parent.
- Parameters:
doitoml (
DoiTOML) –
- abstract knows(action) bool[source]#
Whether the actor knows how to transform and perform an action.
- abstract perform_action(action, execution_context) List[Callable[[], bool | None]][source]#
Build a function that will fully resolve the action during task building.
- rank = 100#
the rank of the action
Custom Python Actor#
Declarative actions for doitoml.
- class doitoml.actors.py.PyActor(doitoml) None[source]#
Bases:
ActorAn actor for user-defined Python functions.
- Parameters:
doitoml (
DoiTOML) –
Create an Actor and remember its parent.
- Parameters:
doitoml (
DoiTOML) –
- perform_action(action, execution_context) List[Callable[[], bool | None]][source]#
Build a python callable.
Updaters#
Uptodate checker base for doitoml.
- class doitoml.updaters._updater.Updater(doitoml) None[source]#
Bases:
objectA base class for uptodate calcluators.
- Parameters:
doitoml (
DoiTOML) –
Create a new updater and remember the parent.
- Parameters:
doitoml (
DoiTOML) –
Custom Python Updater#
Uptodate checkers provided by doit.
- class doitoml.updaters.py.PyUpdater(doitoml) None[source]#
Bases:
UpdaterA wrapper for user-defined Python functions.
- Parameters:
doitoml (
DoiTOML) –
Create a new updater and remember the parent.
- Parameters:
doitoml (
DoiTOML) –
doit.tools Updaters#
Uptodate checkers provided by doit.
- class doitoml.updaters.doit_tools.ConfigChanged(doitoml) None[source]#
Bases:
UpdaterA wrapper for
doit.tools.config_changed.- Parameters:
doitoml (
DoiTOML) –
Create a new updater and remember the parent.
- Parameters:
doitoml (
DoiTOML) –
- get_update_function(uptodate, execution_context) Callable[[], bool | None][source]#
Create a
doit.tools.config_changed.- Parameters:
uptodate (
Any) –execution_context (
ExecutionContext) –
- Return type:
- class doitoml.updaters.doit_tools.RunOnce(doitoml) None[source]#
Bases:
UpdaterA wrapper for
doit.tools.run_once.- Parameters:
doitoml (
DoiTOML) –
Create a new updater and remember the parent.
- Parameters:
doitoml (
DoiTOML) –
Skippers#
Task skipper base for doitoml.
- class doitoml.skippers._skipper.Skipper(doitoml) None[source]#
Bases:
objectA base class for task skippers.
- Parameters:
doitoml (
DoiTOML) –
Create a new skipper and remember the parent.
- Parameters:
doitoml (
DoiTOML) –
Boolean Skippers#
Basic boolean logic for skippers.
- class doitoml.skippers.bools.All(doitoml) None[source]#
Bases:
SkipperA skipper that skips if all given items is truthy.
- Parameters:
doitoml (
DoiTOML) –
Create a new skipper and remember the parent.
- Parameters:
doitoml (
DoiTOML) –
- class doitoml.skippers.bools.Any_(doitoml) None[source]#
Bases:
SkipperA skipper that skips if any given item is truthy.
- Parameters:
doitoml (
DoiTOML) –
Create a new skipper and remember the parent.
- Parameters:
doitoml (
DoiTOML) –
Path Skippers#
Path skippers.
Python Skippers#
User-defined Python skippers.
- class doitoml.skippers.py.Platform(doitoml) None[source]#
Bases:
SkipperA skipper that skips if the given value from Python’s
platformmatches.- Parameters:
doitoml (
DoiTOML) –
Create a new skipper and remember the parent.
- Parameters:
doitoml (
DoiTOML) –
Templates#
Task template base for doitoml.
- class doitoml.templaters._templater.Templater(doitoml) None[source]#
Bases:
objectA base class for task templates.
- Parameters:
doitoml (
DoiTOML) –
Create a new templater and remember the parent.
- Parameters:
doitoml (
DoiTOML) –
JSON-e#
JSON-E templates for doitoml.
Utilities#
JSON Utilities#
JSON utilities for doitoml.
- class doitoml.utils.json.DoitomlEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]#
Bases:
JSONEncoderJSON Encoder aware of
doitomlconventions.always encode
pathlib.Pathas a POSIX-style path (even on Windows).
Constructor for JSONEncoder, with sensible defaults.
If skipkeys is false, then it is a TypeError to attempt encoding of keys that are not str, int, float or None. If skipkeys is True, such items are simply skipped.
If ensure_ascii is true, the output is guaranteed to be str objects with all incoming non-ASCII characters escaped. If ensure_ascii is false, the output can contain non-ASCII characters.
If check_circular is true, then lists, dicts, and custom encoded objects will be checked for circular references during encoding to prevent an infinite recursion (which would cause an RecursionError). Otherwise, no such check takes place.
If allow_nan is true, then NaN, Infinity, and -Infinity will be encoded as such. This behavior is not JSON specification compliant, but is consistent with most JavaScript based encoders and decoders. Otherwise, it will be a ValueError to encode such floats.
If sort_keys is true, then the output of dictionaries will be sorted by key; this is useful for regression tests to ensure that JSON serializations can be compared on a day-to-day basis.
If indent is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. None is the most compact representation.
If specified, separators should be an (item_separator, key_separator) tuple. The default is (’, ‘, ‘: ‘) if indent is
Noneand (‘,’, ‘: ‘) otherwise. To get the most compact JSON representation, you should specify (‘,’, ‘:’) to eliminate whitespace.If specified, default is a function that gets called for objects that can’t otherwise be serialized. It should return a JSON encodable version of the object or raise a
TypeError.
Log#
Utilities for logging..
Paths#
Utilities for working with paths.
Custom Python#
Utilities for using arbitrary python functions in actions, updaters, etc.
- doitoml.utils.py.RE_PY_DOT_FUNC = re.compile('^((?P<py_path>[^:]+?):)?((?P<dotted>[^:]+?):)((?P<func_name>[^:]+?))$')#
a regular expression for parsing
- doitoml.utils.py.base_py_schema(description) Dict[str, Any][source]#
Generate the base schema for a custom python config section.
- doitoml.utils.py.import_dotted(dotted, func_name, execution_context, py_path) Any[source]#
Import a named function from a module.
- doitoml.utils.py.make_py_function(dotted, args, kwargs, execution_context) Callable[[], bool | None][source]#
Build a function that lazily imports a dotted function and calls it.
- doitoml.utils.py.parse_dotted_py(dotted) Tuple[str | None, str | None, str | None][source]#
Parse a python importable function.
- doitoml.utils.py.patched_paths(execution_context, py_path=None) Iterator[source]#
Ensure the
sys.path,Path.cwdare correct.- Parameters:
execution_context (
ExecutionContext) –
- Return type:
- doitoml.utils.py.resolve_one_py_kwarg(doitoml, source, arg_name, arg_value) Any | None[source]#
Resolve a single argument.