poethepoet.helpers.python

src/poethepoet/helpers/python.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import ast
from collections.abc import Container
from typing import Any, NamedTuple

Substitution = tuple[tuple[int, int], str]

class FunctionCall(NamedTuple):
    expression: str
    function_ref: str
    referenced_args: tuple[str, ...] = ...
    referenced_globals: tuple[str, ...] = ...
    @classmethod
    def parse(
        cls, source: str, arguments: Container[str], *, args_prefix: str = '__args.', allowed_vars: Container[str] = ...
    ) -> FunctionCall: ...

def resolve_expression(
    source: str, arguments: Container[str], *, args_prefix: str = '__args.', allowed_vars: Container[str] = ...
) -> str: ...
def parse_and_validate(source: str, call_only: bool = True, task_type: str = 'script') -> ast.AST: ...
def format_class(attrs: dict[str, Any] | None, classname: str = '__args') -> str: ...

class NoInstance: ...

IDENTIFIER_PATTERN: str