diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7dd1a74..bfa0d15 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,7 +35,7 @@ jobs: - name: Install just uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0 with: - just-version: "1.43.1" + just-version: "1.58.0" - run: just typing run-tests: @@ -62,7 +62,7 @@ jobs: - name: Install just uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0 with: - just-version: "1.43.1" + just-version: "1.58.0" - name: Run tests shell: bash -l {0} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 02aaf6e..5a555ce 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,15 +18,6 @@ repos: - id: no-commit-to-branch args: [--branch, main] - id: trailing-whitespace -- repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.10.0 - hooks: - - id: python-check-blanket-noqa - - id: python-check-mock-methods - - id: python-no-eval - - id: python-no-log-warn - - id: python-use-type-annotations - - id: text-unicode-replacement-char - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.16.7 hooks: @@ -45,7 +36,7 @@ repos: - mdformat-black args: [--wrap, "88"] - repo: https://github.com/crate-ci/typos - rev: v1 + rev: v1.49.0 hooks: - id: typos - repo: meta diff --git a/CHANGELOG.md b/CHANGELOG.md index c05daeb..222aba8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ chronological order. Releases follow [semantic versioning](https://semver.org/) releases are available on [PyPI](https://pypi.org/project/pytask-stata) and [Anaconda.org](https://anaconda.org/conda-forge/pytask-stata). +## 0.6.0 - 2026-09-19 + +- {pull}`107` adds YAML configuration files for passing dependencies, products, and + other task arguments to Stata. YAML is now the default interface; explicitly supplying + `options` selects the command-line compatibility interface. +- {pull}`107` expands the mock Stata runtime with YAML parsing and validation support. +- {pull}`114` uses the canonical `pytask-stata` distribution name in package metadata. + ## 0.5.1 - 2026-06-14 - {pull}`50` drops support for Python 3.8 and 3.9 and adds support for Python 3.14. diff --git a/README.md b/README.md index c9f7621..e78a387 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,18 @@ ______________________________________________________________________ Run Stata's do-files with pytask. +## Table of Contents + +- [Installation](#installation) +- [Usage](#usage) + - [Dependencies and Products](#dependencies-and-products) + - [Accessing dependencies and products in the script](#accessing-dependencies-and-products-in-the-script) + - [YAML Configuration Files](#yaml-configuration-files) + - [Command Line Arguments](#command-line-arguments) + - [Repeating tasks with different scripts or inputs](#repeating-tasks-with-different-scripts-or-inputs) +- [Configuration](#configuration) +- [Changes](#changes) + ## Installation pytask-stata is available on [PyPI](https://pypi.org/project/pytask-stata) and @@ -99,9 +111,65 @@ def task_run_do_file(produces: Path = Path("auto.dta")): ### Accessing dependencies and products in the script Dependencies and products registered in the task function signature are used by pytask -to order tasks and track whether they are up-to-date. They are not automatically passed -to the Stata script. Use the `options` argument of the decorator to pass paths or other -values as command line arguments to your Stata executable. +to order tasks and track whether they are up-to-date. pytask-stata offers two modes to +pass these paths and other task data to the Stata script. + +1. Use the default YAML configuration file. This is the recommended mode if your Stata + installation can use the user-written [`yaml`](https://github.com/jpazvd/yaml) + package, which is compatible with Stata 14+. +1. Use the `options` argument of the decorator to pass command line arguments. This is + the compatibility mode for Stata installations where `yaml.ado` is not available or + not supported. + +Do not combine both interfaces. If `options` is supplied, pytask-stata assumes the +do-file receives all required values through command line arguments and does not create +a YAML configuration file. Pass `options=None` to select this mode without passing any +command line arguments. + +#### YAML Configuration Files + +By default, pytask-stata serializes all task keyword arguments and passes the path to +the generated YAML file as the first argument to the do-file. To read the file inside +Stata, install the user-written [`yaml`](https://github.com/jpazvd/yaml) package, which +is compatible with Stata 14+. + +See [YAML Data Passed to Stata](docs/yaml.md) for the supported data types and how they +are represented in Stata. + +```stata +ssc install yaml +``` + +Then read the configuration file in the Stata task. + +```python +from pathlib import Path + +from pytask import mark + + +@mark.stata(script=Path("script.do")) +def task_run_do_file( + depends_on: Path = Path("input.dta"), + produces: Path = Path("auto.dta"), +): + pass +``` + +```do +args config +yaml read using "`config'", locals replace +local depends_on = r(yaml_depends_on) +local produces = r(yaml_produces) + +use "`depends_on'", clear +save "`produces'" +``` + +#### Command Line Arguments + +Use the `options` argument of the decorator to pass paths or other values as command +line arguments to your Stata executable. This mode does not require the `yaml` package. For example, pass paths for the dependency and product with @@ -119,13 +187,13 @@ def task_run_do_file( pass ``` -And in your `script.do`, you can intercept the value with +And in your `script.do`, you can intercept the values with ```do * Intercept command line arguments and save them to macros. args depends_on produces -sysuse auto, clear +use "`depends_on'", clear save "`produces'" ``` @@ -133,8 +201,8 @@ The relative path inside the do-file works only because pytask-stata switches th current working directory to the directory of the task module before the task is executed. -To make the task independent from the current working directory, pass the full path as -an command line argument. Here is an example. +To make the task independent from the current working directory, pass the full path as a +command line argument. Here is an example. ```python # Absolute path to the build directory. @@ -153,7 +221,7 @@ def task_run_do_file(produces: Path = BLD / "auto.dta"): ### Repeating tasks with different scripts or inputs You can also parametrize the execution of scripts, meaning executing multiple do-files -as well as passing different command line arguments to the same do-file. +as well as passing different inputs or task data to the same do-file. The following task executes two do-files which produce different outputs. diff --git a/docs/yaml.md b/docs/yaml.md new file mode 100644 index 0000000..9b92437 --- /dev/null +++ b/docs/yaml.md @@ -0,0 +1,38 @@ +# YAML Data Passed to Stata + +pytask-stata serializes task keyword arguments with PyYAML and passes the path to the +generated YAML file as the first command line argument to the do-file. Inside Stata, +read the file with the user-written `yaml` package. + +```stata +args config +yaml read using "`config'", locals replace +``` + +The `yaml` package stores parsed YAML in a Stata dataset with `key`, `value`, `level`, +`parent`, and `type` columns. With `locals`, scalar leaves are also available as +`r(yaml_)` macros. Nested keys are flattened with underscores. + +## Supported Types + +| Python value | YAML shape | Stata representation | Access pattern | +| -------------------------------- | ----------------------------- | -------------------------------------------------------------------- | ----------------------------------------- | +| Non-empty `str` | `name: hello` | `type=string`, `value=hello` | `r(yaml_name)` | +| `int` | `count: 42` | `type=numeric`, `value=42` | `r(yaml_count)` | +| `float` | `ratio: 3.14` | `type=numeric`, `value=3.14` | `r(yaml_ratio)` | +| `bool` | `enabled: true` | `type=boolean`, `value=1` or `0` | `r(yaml_enabled)` | +| `None` | `missing: null` | `type=null`, empty value | validate as `null`; no useful macro value | +| `pathlib.Path` | `path: build/out.dta` | `type=string`, POSIX-style path | `r(yaml_path)` | +| Flat `list` / `tuple` of scalars | `items:` plus `- value` lines | parent row plus `items_1`, `items_2`, ... rows with `type=list_item` | use flattened keys such as `items_1` | +| Nested `dict` with scalar leaves | nested mapping | flattened keys such as `config_child` | `yaml get config, attributes(child)` | + +## Recommended Limits + +Keep the YAML bridge to configuration-like data: scalar values, paths, flat scalar +lists, and nested dictionaries with scalar leaves. + +Avoid empty mappings and lists, empty strings, lists of dictionaries, sets, bytes, +decimals, and arbitrary Python objects. Empty collections use YAML flow syntax, which is +outside the Stata parser's supported subset. PyYAML may also emit YAML tags such as +`!!set` or `!!binary`, or fail with a `RepresenterError`; those forms are not useful as +a stable Stata interface. diff --git a/justfile b/justfile index 483e4e3..d4dee13 100644 --- a/justfile +++ b/justfile @@ -12,7 +12,7 @@ test-ci: # Run type checking typing: - uv run --group typing --group test --isolated ty check + uv run --group typing --group test --group test-mock-stata --isolated ty check # Run linting and formatting lint: diff --git a/packages/stata_mock/src/stata_mock/cli.py b/packages/stata_mock/src/stata_mock/cli.py index 43370a6..529cc22 100644 --- a/packages/stata_mock/src/stata_mock/cli.py +++ b/packages/stata_mock/src/stata_mock/cli.py @@ -4,7 +4,10 @@ import re import sys +from dataclasses import dataclass +from dataclasses import field from pathlib import Path +from typing import Any INVALID_SYNTAX = 198 UNKNOWN_COMMAND = 199 @@ -44,38 +47,95 @@ def _parse_invocation(args: list[str]) -> tuple[Path, list[str], Path] | None: def _run_script(script: Path, options: list[str]) -> tuple[list[str], int | None]: lines = [f"running mock Stata for {script.name}"] - macros: dict[str, str] = {} + state = RuntimeState() - for raw_line in script.read_text().splitlines(): + for raw_line in _iter_stata_lines(script): line = raw_line.strip() if not line or line.startswith("*"): continue - line = _expand_local_macros(line, macros) + line = _expand_macros(line, state) lines.append(f". {line}") - error_code = _execute_line(line, macros, options) + error_code = _execute_line(line, state, options) if error_code is not None: return lines, error_code return lines, None -def _execute_line(line: str, macros: dict[str, str], options: list[str]) -> int | None: +def _iter_stata_lines(script: Path) -> list[str]: + lines: list[str] = [] + continued = "" + for raw_line in script.read_text().splitlines(): + stripped = raw_line.rstrip() + if stripped.endswith("///"): + continued += stripped.removesuffix("///").rstrip() + " " + continue + lines.append(continued + raw_line if continued else raw_line) + continued = "" + if continued: + lines.append(continued) + return lines + + +@dataclass +class YamlEntry: + """A flattened YAML key/value record.""" + + key: str + value: str + level: int + parent: str + type: str + + +@dataclass +class RuntimeState: + """Mutable state for a mock Stata do-file run.""" + + macros: dict[str, str] = field(default_factory=dict) + returns: dict[str, str] = field(default_factory=dict) + yaml_entries: dict[str, YamlEntry] = field(default_factory=dict) + + +def _execute_line(line: str, state: RuntimeState, options: list[str]) -> int | None: command, _, rest = line.partition(" ") command = command.lower() rest = rest.strip() if command == "args": - macros.update(dict(zip(rest.split(), options, strict=False))) + state.macros.update(dict(zip(rest.split(), options, strict=False))) + error_code = None + elif command == "local": + error_code = _set_local_macro(rest, state) elif command == "sysuse": - return None + error_code = None elif command == "save": - return _save_dataset(rest) + error_code = _save_dataset(rest) + elif command == "yaml": + error_code = _execute_yaml(rest, state) elif command in {"error", "exit"}: - return int(rest.split()[0]) + error_code = int(rest.split()[0]) else: - return UNKNOWN_COMMAND + error_code = UNKNOWN_COMMAND + + return error_code + +def _set_local_macro(rest: str, state: RuntimeState) -> int | None: + name, separator, value = rest.partition("=") + name = name.strip() + if not name: + return INVALID_SYNTAX + if separator: + value = value.strip() + if match := re.fullmatch(r"r\(([^)]+)\)", value): + state.macros[name] = state.returns.get(match.group(1), "") + else: + state.macros[name] = value.strip("\"'") + else: + value_parts = rest.split(maxsplit=1) + state.macros[value_parts[0]] = value_parts[1] if len(value_parts) > 1 else "" return None @@ -94,8 +154,366 @@ def _save_dataset(rest: str) -> int | None: return None -def _expand_local_macros(line: str, macros: dict[str, str]) -> str: - return re.sub(r"`([^']+)'", lambda match: macros.get(match.group(1), ""), line) +def _execute_yaml(rest: str, state: RuntimeState) -> int | None: + match = re.match(r"(?P\w+)(?P.*)", rest) + if match is None: + return INVALID_SYNTAX + subcommand = match.group("subcommand") + remaining = match.group("remaining") + subcommand = {"check": "validate", "desc": "describe"}.get( + subcommand.lower(), + subcommand.lower(), + ) + remaining = remaining.strip() + + if subcommand == "read": + return _yaml_read(remaining, state) + if subcommand == "get": + return _yaml_get(remaining, state) + if subcommand == "validate": + return _yaml_validate(remaining, state) + if subcommand in {"describe", "list", "dir", "frames", "clear"}: + return None + return UNKNOWN_COMMAND + + +def _yaml_read(rest: str, state: RuntimeState) -> int | None: + match = re.match( + r'^using\s+("?)(?P.+?)\1(?:\s*,\s*(?P.*))?$', + rest, + ) + if match is None: + return INVALID_SYNTAX + + path = Path(match.group("filename")) + if not path.is_absolute(): + path = Path.cwd() / path + try: + data = _parse_yaml_subset(path.read_text(encoding="utf-8")) + except (OSError, TypeError, ValueError): + return INVALID_SYNTAX + + entries = _flatten_yaml(data) + state.yaml_entries = {entry.key: entry for entry in entries} + options = _parse_options(match.group("options") or "") + prefix = options.get("prefix", "yaml_") + + state.returns.update( + { + "filename": path.as_posix(), + "n_keys": str(len(entries)), + "max_level": str(max((entry.level for entry in entries), default=0)), + "yaml_mode": "canonical", + "cache_hit": "0", + } + ) + if "locals" in options: + state.returns.update( + { + f"{prefix}{entry.key}": entry.value + for entry in entries + if entry.type != "parent" + } + ) + return None + + +def _yaml_get(rest: str, state: RuntimeState) -> int | None: + query, options = _split_command_options(rest) + query = query.strip() + if not query: + return INVALID_SYNTAX + + parent, _, key = query.partition(":") + search_key = f"{parent}_{key}" if key else parent + + entry = state.yaml_entries.get(search_key) + children = _get_yaml_child_attributes(search_key, state) + state.returns.update( + { + "key": key or parent, + "parent": parent if key else "", + "found": "1" if entry is not None or children else "0", + "n_attrs": str(len(children) or int(entry is not None)), + } + ) + if children: + attributes = str(options.get("attributes", "")).split() + allowed = set(attributes) if attributes else set(children) + state.returns.update( + {attr: value for attr, value in children.items() if attr in allowed} + ) + elif entry is not None: + state.returns["value"] = entry.value + return None + + +def _get_yaml_child_attributes( + search_key: str, + state: RuntimeState, +) -> dict[str, str]: + prefix = f"{search_key}_" + attributes: dict[str, str] = {} + for key, entry in state.yaml_entries.items(): + if entry.parent != search_key or entry.type == "parent": + continue + attribute = key.removeprefix(prefix) + attributes[attribute] = entry.value + return attributes + + +def _yaml_validate(rest: str, state: RuntimeState) -> int | None: + _, options = _split_command_options(rest) + valid = True + + required = str(options.get("required", "")).split() + for key in required: + valid = valid and key in state.yaml_entries + + for spec in str(options.get("types", "")).split(): + key, separator, expected_type = spec.partition(":") + if not separator: + return INVALID_SYNTAX + entry = state.yaml_entries.get(key) + valid = valid and entry is not None and entry.type == expected_type + + state.returns["valid"] = "1" if valid else "0" + return None if valid else INVALID_SYNTAX + + +def _parse_yaml_subset(text: str) -> dict[str, Any]: + if _contains_unsupported_yaml_syntax(text): + msg = "Unsupported YAML syntax." + raise ValueError(msg) + + root: dict[str, Any] = {} + stack: list[tuple[int, dict[str, Any] | list[Any]]] = [(-1, root)] + + lines = text.splitlines() + for line_number, raw_line in enumerate(lines): + parsed_line = _parse_yaml_line(raw_line) + if parsed_line is None: + continue + + indent, stripped = parsed_line + if stripped.startswith("- "): + _parse_yaml_list_item(stripped, indent, stack) + continue + + _parse_yaml_mapping_item(stripped, indent, lines, line_number, stack) + + return root + + +def _contains_unsupported_yaml_syntax(text: str) -> bool: + """Detect unsupported structural YAML without inspecting scalar contents.""" + for raw_line in text.splitlines(): + stripped = raw_line.strip() + if not stripped or stripped.startswith("#"): + continue + if stripped == "---" or stripped.startswith(("{", "[")): + return True + + if stripped.startswith("- "): + value = stripped.removeprefix("- ").lstrip() + else: + _, separator, value = stripped.partition(":") + if not separator: + continue + value = value.lstrip() + + if value.startswith(("{", "[", "&", "*")): + return True + + return False + + +def _parse_yaml_line(raw_line: str) -> tuple[int, str] | None: + if not raw_line.strip() or raw_line.lstrip().startswith("#"): + return None + + indent = len(raw_line) - len(raw_line.lstrip(" ")) + if indent % 2: + msg = "Only two-space indentation is supported." + raise ValueError(msg) + + return indent, raw_line.strip() + + +def _parse_yaml_list_item( + stripped: str, + indent: int, + stack: list[tuple[int, dict[str, Any] | list[Any]]], +) -> None: + while stack and indent < stack[-1][0]: + stack.pop() + parent = stack[-1][1] + if not isinstance(parent, list): + msg = "List item without list parent." + raise TypeError(msg) + + item = stripped.removeprefix("- ").strip() + is_quoted = len(item) > 1 and item[0] == item[-1] and item[0] in "\"'" + if ":" in item and not is_quoted and re.search(r":(?:\s|$)", item): + msg = "List items must be scalar values." + raise ValueError(msg) + parent.append(_parse_yaml_scalar(item)) + + +def _parse_yaml_mapping_item( + stripped: str, + indent: int, + lines: list[str], + line_number: int, + stack: list[tuple[int, dict[str, Any] | list[Any]]], +) -> None: + key, separator, value = stripped.partition(":") + if not separator or not key or " " in key: + msg = "Invalid YAML mapping key." + raise ValueError(msg) + + while stack and indent <= stack[-1][0]: + stack.pop() + parent = stack[-1][1] + if not isinstance(parent, dict): + msg = "Mapping key inside list is not supported." + raise TypeError(msg) + + if value.strip(): + parent[key] = _parse_yaml_scalar(value.strip()) + return + + next_line = _find_next_content_line(lines, line_number) + next_stripped = next_line.strip() if next_line is not None else "" + next_container: dict[str, Any] | list[Any] = ( + [] if next_stripped.startswith("- ") else {} + ) + parent[key] = next_container + stack.append((indent, next_container)) + + +def _find_next_content_line(lines: list[str], line_number: int) -> str | None: + """Return the next non-empty, non-comment line after ``current_line``.""" + for line in lines[line_number + 1 :]: + if line.strip() and not line.lstrip().startswith("#"): + return line + return None + + +def _parse_yaml_scalar(value: str) -> str | int | float | bool | None: + value = value.strip() + if len(value) > 1 and value[0] == value[-1] and value[0] in "\"'": + unquoted = value[1:-1] + return unquoted.replace("''", "'") if value[0] == "'" else unquoted + if value.lower() in {"true", "false"}: + return value.lower() == "true" + if value.lower() in {"null", "~"}: + return None + try: + return int(value) + except ValueError: + try: + return float(value) + except ValueError: + return value + + +def _flatten_yaml(data: dict[str, Any]) -> list[YamlEntry]: + entries: list[YamlEntry] = [] + + def recurse(value: Any, prefix: str, level: int, parent: str) -> None: + if isinstance(value, dict): + if prefix: + entries.append(YamlEntry(prefix, "", level, parent, "parent")) + for key, child in value.items(): + child_key = f"{prefix}_{key}" if prefix else key + recurse(child, child_key, level + 1, prefix) + return + if isinstance(value, list): + entries.append(YamlEntry(prefix, "", level, parent, "parent")) + for index, item in enumerate(value, start=1): + entries.append( + YamlEntry( + key=f"{prefix}_{index}", + value=_format_yaml_list_item(item), + level=level, + parent=prefix, + type="list_item", + ) + ) + return + + entries.append( + YamlEntry( + key=prefix, + value=_format_yaml_value(value), + level=level, + parent=parent, + type=_yaml_value_type(value), + ) + ) + + recurse(data, "", 0, "") + return entries + + +def _format_yaml_value(value: Any) -> str: + if isinstance(value, bool): + return "1" if value else "0" + if value is None: + return "" + return str(value) + + +def _format_yaml_list_item(value: Any) -> str: + if isinstance(value, bool): + return "true" if value else "false" + if value is None: + return "null" + return str(value) + + +def _yaml_value_type(value: Any) -> str: + if isinstance(value, bool): + return "boolean" + if isinstance(value, int | float): + return "numeric" + if value is None: + return "null" + return "string" + + +def _split_command_options(rest: str) -> tuple[str, dict[str, str | bool]]: + command, separator, options = rest.partition(",") + return command.strip(), _parse_options(options if separator else "") + + +def _parse_options(options: str) -> dict[str, str | bool]: + parsed: dict[str, str | bool] = {} + for option in _split_options(options): + if match := re.match(r"(?P\w+)\((?P.*)\)$", option): + parsed[_normalize_option_name(match.group("name"))] = match.group("value") + elif option: + parsed[_normalize_option_name(option)] = True + return parsed + + +def _split_options(options: str) -> list[str]: + return re.findall(r"\w+\([^)]*\)|\w+", options) + + +def _normalize_option_name(name: str) -> str: + return {"l": "locals", "s": "scalars", "q": "quiet"}.get(name, name) + + +def _expand_macros(line: str, state: RuntimeState) -> str: + def replace(match: re.Match[str]) -> str: + name = match.group(1) + if r_match := re.fullmatch(r"r\(([^)]+)\)", name): + return state.returns.get(r_match.group(1), "") + return state.macros.get(name, "") + + return re.sub(r"`([^']+)'", replace, line) def _parse_save_target(rest: str) -> str: diff --git a/pyproject.toml b/pyproject.toml index 087696e..b3223f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ classifiers = [ "Programming Language :: Python :: 3 :: Only", ] requires-python = ">=3.10" -dependencies = ["click>=8.1.8,!=8.2.0", "pytask>=0.5.2"] +dependencies = ["click>=8.1.8,!=8.2.0", "pytask>=0.5.2", "pyyaml>=6.0.2"] dynamic = ["version"] [project.readme] diff --git a/src/pytask_stata/collect.py b/src/pytask_stata/collect.py index 04c4e13..45cfe97 100644 --- a/src/pytask_stata/collect.py +++ b/src/pytask_stata/collect.py @@ -24,6 +24,8 @@ from pytask import parse_products_from_task_function from pytask import remove_marks +from pytask_stata.serialization import SERIALIZERS +from pytask_stata.serialization import create_path_to_serialized from pytask_stata.shared import convert_task_id_to_name_of_log_file from pytask_stata.shared import stata @@ -32,12 +34,22 @@ def run_stata_script( _executable: str, _script: Path, _options: list[str], + _serialized: Path | None, _log_name: str, _cwd: Path, **_kwargs: Any, ) -> None: - """Run an R script.""" - cmd = [_executable, "-e", "do", _script.as_posix(), *_options, f"-{_log_name}"] + """Run a Stata do-file.""" + serialized_option = [] if _serialized is None else [_serialized.as_posix()] + cmd = [ + _executable, + "-e", + "do", + _script.as_posix(), + *_options, + *serialized_option, + f"-{_log_name}", + ] print("Executing " + " ".join(cmd) + ".") # noqa: T201 subprocess.run(cmd, cwd=_cwd, check=True) # noqa: S603 @@ -64,7 +76,8 @@ def pytask_collect_task( raise ValueError(msg) mark = _parse_stata_mark(mark=marks[0]) - script, options = stata(**marks[0].kwargs) + script = mark.kwargs["script"] + options = mark.kwargs["options"] or [] cast("Any", obj).pytask_meta.markers.append(mark) # Collect the nodes in @pytask.mark.julia and validate them. @@ -183,12 +196,73 @@ def pytask_collect_task( ) task.depends_on["_log_name"] = log_name_node + suffix = mark.kwargs["suffix"] + serialized = None if suffix is None else create_path_to_serialized(task, suffix) + task.depends_on["_serialized"] = _collect_serialized_node( + session=session, + path_nodes=path_nodes, + node_info=NodeInfo( + arg_name="_serialized", + path=(), + value=PythonNode(value=serialized), + task_path=path, + task_name=name, + ), + ) + return task return None +def _collect_serialized_node( + *, + session: Session, + path_nodes: Path, + node_info: NodeInfo, +) -> PythonNode: + """Collect the node for the serialized task configuration.""" + serialized_node = session.hook.pytask_collect_node( + session=session, + path=path_nodes, + node_info=node_info, + ) + return cast("PythonNode", serialized_node) + + def _parse_stata_mark(mark: Mark) -> Mark: """Parse a Stata mark.""" - script, options = stata(**mark.kwargs) - parsed_kwargs = {"script": script or None, "options": options or []} + script, options, serializer, suffix = stata(**mark.kwargs) + + if options is not None and (serializer is not None or suffix is not None): + msg = ( + "The @pytask.mark.stata interfaces cannot be mixed. Use either " + "'options' for command line arguments or 'serializer'/'suffix' for " + "serialized task arguments." + ) + raise ValueError(msg) + + if options is None and serializer is None: + serializer = "yaml" + + if isinstance(serializer, str) and serializer not in SERIALIZERS: + msg = ( + f"Serializer {serializer!r} is not known. Available serializers are " + f"{sorted(SERIALIZERS)}." + ) + raise ValueError(msg) + + proposed_suffix = ( + SERIALIZERS[serializer]["suffix"] + if isinstance(serializer, str) and serializer in SERIALIZERS and suffix is None + else suffix + ) + if serializer is not None and proposed_suffix is None: + msg = "Missing suffix for serialized Stata task." + raise ValueError(msg) + parsed_kwargs = { + "script": script or None, + "options": options, + "serializer": serializer, + "suffix": proposed_suffix, + } return Mark("stata", (), parsed_kwargs) diff --git a/src/pytask_stata/execute.py b/src/pytask_stata/execute.py index 07b4925..24b4dbc 100644 --- a/src/pytask_stata/execute.py +++ b/src/pytask_stata/execute.py @@ -4,18 +4,31 @@ import re from pathlib import Path +from typing import Any from typing import cast from pytask import PathNode +from pytask import PPathNode from pytask import PTask from pytask import PTaskWithPath from pytask import PythonNode from pytask import Session from pytask import has_mark from pytask import hookimpl +from pytask.tree_util import tree_map +from pytask_stata.serialization import serialize_keyword_arguments from pytask_stata.shared import STATA_COMMANDS +_INTERNAL_ARGUMENTS = { + "_script", + "_options", + "_cwd", + "_executable", + "_log_name", + "_serialized", +} + @hookimpl def pytask_execute_task_setup(session: Session, task: PTask) -> None: @@ -29,6 +42,52 @@ def pytask_execute_task_setup(session: Session, task: PTask) -> None: ) raise RuntimeError(msg) + marks = list(task.markers) + stata_marks = [mark for mark in marks if mark.name == "stata"] + if stata_marks: + serializer = stata_marks[0].kwargs.get("serializer") + if serializer is None: + return + + serialized_node = task.depends_on["_serialized"] + if not isinstance(serialized_node, PythonNode): + msg = "Expected '_serialized' dependency to be a PythonNode." + raise TypeError(msg) + + kwargs = _collect_stata_keyword_arguments(task) + if not kwargs: + serialized_node.value = None + return + + if not isinstance(serialized_node.value, Path): + msg = "Expected '_serialized' dependency to contain a pathlib.Path." + raise TypeError(msg) + + path_to_serialized = serialized_node.value + path_to_serialized.parent.mkdir(parents=True, exist_ok=True) + serialize_keyword_arguments(serializer, path_to_serialized, kwargs) + + +def _collect_stata_keyword_arguments(task: PTask) -> dict[str, Any]: + """Collect keyword arguments passed to the Stata config file.""" + kwargs: dict[str, Any] = { + **tree_map( + lambda node: ( + node.path.as_posix() if isinstance(node, PPathNode) else node.value + ), + task.depends_on, # ty: ignore[invalid-argument-type] + ), + **tree_map( + lambda node: ( + node.path.as_posix() if isinstance(node, PPathNode) else node.value + ), + task.produces, # ty: ignore[invalid-argument-type] + ), + } + return { + key: value for key, value in kwargs.items() if key not in _INTERNAL_ARGUMENTS + } + @hookimpl def pytask_execute_task_teardown(session: Session, task: PTask) -> None: diff --git a/src/pytask_stata/serialization.py b/src/pytask_stata/serialization.py new file mode 100644 index 0000000..b0aa36e --- /dev/null +++ b/src/pytask_stata/serialization.py @@ -0,0 +1,101 @@ +"""Serialize task keyword arguments for Stata do-files.""" + +from __future__ import annotations + +import uuid +from collections.abc import Callable +from pathlib import Path +from typing import TYPE_CHECKING +from typing import Any +from typing import TypedDict + +import yaml + +if TYPE_CHECKING: + from pytask import PTask + +__all__ = ["SERIALIZERS", "create_path_to_serialized", "serialize_keyword_arguments"] + +_HIDDEN_FOLDER = ".pytask/pytask-stata" + +SerializerFunc = Callable[..., str] + + +class SerializerEntry(TypedDict): + """Describe a serializer function and its output suffix.""" + + serializer: SerializerFunc + suffix: str + + +def _dump_yaml(kwargs: dict[str, Any]) -> str: + """Serialize task keyword arguments as YAML.""" + _validate_yaml_collections(kwargs) + return yaml.safe_dump(kwargs, sort_keys=False, allow_unicode=True) + + +def _validate_yaml_collections(value: Any, path: str = "") -> None: + """Reject empty collections unsupported by the Stata YAML parser.""" + if isinstance(value, dict): + if not value: + msg = f"Empty YAML mapping at {path} is not supported." + raise ValueError(msg) + for key, item in value.items(): + _validate_yaml_collections(item, f"{path}.{key}") + elif isinstance(value, (list, tuple)): + if not value: + msg = f"Empty YAML list at {path} is not supported." + raise ValueError(msg) + for index, item in enumerate(value): + _validate_yaml_collections(item, f"{path}[{index}]") + + +SERIALIZERS: dict[str, SerializerEntry] = { + "yaml": {"serializer": _dump_yaml, "suffix": ".yaml"}, + "yml": {"serializer": _dump_yaml, "suffix": ".yml"}, +} + + +def create_path_to_serialized(task: PTask, suffix: str) -> Path: + """Create path to serialized task data.""" + from pytask import PTaskWithPath # noqa: PLC0415 + + return ( + (task.path.parent if isinstance(task, PTaskWithPath) else Path.cwd()) + .joinpath(_HIDDEN_FOLDER, str(uuid.uuid4())) + .with_suffix(suffix) + ) + + +def serialize_keyword_arguments( + serializer: str | SerializerFunc, + path_to_serialized: Path, + kwargs: dict[str, Any], +) -> None: + """Serialize keyword arguments.""" + if isinstance(serializer, str): + if serializer not in SERIALIZERS: + msg = f"Serializer {serializer!r} is not known." + raise ValueError(msg) + serializer_func = SERIALIZERS[serializer]["serializer"] + elif callable(serializer): + serializer_func = serializer + else: + msg = f"Serializer {serializer!r} is not known." + raise TypeError(msg) + + serialized = serializer_func(_normalize_for_stata(kwargs)) + path_to_serialized.write_text(serialized, encoding="utf-8") + + +def _normalize_for_stata(value: Any) -> Any: + """Normalize values to objects supported by common config serializers.""" + if isinstance(value, Path): + return value.as_posix() + if isinstance(value, dict): + return {str(key): _normalize_for_stata(item) for key, item in value.items()} + if isinstance(value, list): + return [_normalize_for_stata(item) for item in value] + if isinstance(value, tuple): + return tuple(_normalize_for_stata(item) for item in value) + return value diff --git a/src/pytask_stata/shared.py b/src/pytask_stata/shared.py index bf8d1d3..2d79255 100644 --- a/src/pytask_stata/shared.py +++ b/src/pytask_stata/shared.py @@ -3,6 +3,7 @@ from __future__ import annotations import sys +from collections.abc import Callable from collections.abc import Iterable from collections.abc import Sequence from typing import TYPE_CHECKING @@ -44,21 +45,44 @@ STATA_COMMANDS = [] +_DEFAULT_OPTIONS = object() + + def stata( *, script: str | Path, - options: str | Iterable[str] | None = None, -) -> tuple[str | Path | None, str | Iterable[str] | None]: + options: str | Iterable[str] | object | None = _DEFAULT_OPTIONS, + serializer: str | Callable[..., str] | None = None, + suffix: str | None = None, +) -> tuple[ + str | Path | None, + list[str] | None, + str | Callable[..., str] | None, + str | None, +]: """Specify command line options for Stata. Parameters ---------- + script : str | Path + The path to the Stata do-file which is executed. options : str | Iterable[str] | None One or multiple command line options passed to Stata. + serializer : str | Callable[..., str] | None + A function to serialize data for the task. If ``None`` and ``options`` is not + explicitly supplied, use the default YAML serializer. Supplying ``options`` + selects the command-line interface and disables serialization. + suffix : str | None + A suffix for the serialized file. If ``None``, infer it from known serializers. """ - options = [] if options is None else list(map(str, _to_list(options))) - return script, options + if options is _DEFAULT_OPTIONS: + parsed_options = None + elif options is None: + parsed_options = [] + else: + parsed_options = list(map(str, _to_list(options))) + return script, parsed_options, serializer, suffix def convert_task_id_to_name_of_log_file(task: PTask) -> str: diff --git a/tests/test_collect.py b/tests/test_collect.py index 4a7ca3b..b85ec02 100644 --- a/tests/test_collect.py +++ b/tests/test_collect.py @@ -16,13 +16,25 @@ (), {"script": "script.do", "options": "--option"}, does_not_raise(), - ("script.do", ["--option"]), + ("script.do", ["--option"], None, None), ), ( (), {"script": "script.do", "options": [1]}, does_not_raise(), - ("script.do", ["1"]), + ("script.do", ["1"], None, None), + ), + ( + (), + {"script": "script.do", "options": None}, + does_not_raise(), + ("script.do", [], None, None), + ), + ( + (), + {"script": "script.do"}, + does_not_raise(), + ("script.do", None, None, None), ), ], ) @@ -38,7 +50,30 @@ def test_stata(args, kwargs, expectation, expected): ( Mark("stata", (), {"script": "script.do"}), does_not_raise(), + Mark( + "stata", + (), + { + "script": "script.do", + "options": None, + "serializer": "yaml", + "suffix": ".yaml", + }, + ), + ), + ( Mark("stata", (), {"script": "script.do", "options": []}), + does_not_raise(), + Mark( + "stata", + (), + { + "script": "script.do", + "options": [], + "serializer": None, + "suffix": None, + }, + ), ), ], ) @@ -50,3 +85,58 @@ def test_parse_stata_mark( with expectation: out = _parse_stata_mark(mark) assert out == expected + + +def test_parse_stata_mark_with_yaml(): + mark = Mark("stata", (), {"script": "script.do", "serializer": "yaml"}) + + out = _parse_stata_mark(mark) + + assert out == Mark( + "stata", + (), + { + "script": "script.do", + "options": None, + "serializer": "yaml", + "suffix": ".yaml", + }, + ) + + +def test_parse_stata_mark_with_explicit_none_uses_default_yaml(): + mark = Mark("stata", (), {"script": "script.do", "serializer": None}) + + out = _parse_stata_mark(mark) + + assert out == Mark( + "stata", + (), + { + "script": "script.do", + "options": None, + "serializer": "yaml", + "suffix": ".yaml", + }, + ) + + +def test_parse_stata_mark_raises_for_json(): + mark = Mark("stata", (), {"script": "script.do", "serializer": "json"}) + + with pytest.raises(ValueError, match="Serializer 'json' is not known"): + _parse_stata_mark(mark) + + +@pytest.mark.parametrize( + "kwargs", + [ + {"script": "script.do", "options": [], "serializer": "yaml"}, + {"script": "script.do", "options": [], "suffix": ".yaml"}, + ], +) +def test_parse_stata_mark_raises_for_mixed_interfaces(kwargs): + mark = Mark("stata", (), kwargs) + + with pytest.raises(ValueError, match="interfaces cannot be mixed"): + _parse_stata_mark(mark) diff --git a/tests/test_execute.py b/tests/test_execute.py index d622ad0..3cdedf5 100644 --- a/tests/test_execute.py +++ b/tests/test_execute.py @@ -8,6 +8,7 @@ import pytest from pytask import ExitCode from pytask import Mark +from pytask import PythonNode from pytask import Session from pytask import Task from pytask import build @@ -40,6 +41,153 @@ def test_pytask_execute_task_setup_raise_error(stata, platform, expectation): pytask_execute_task_setup(session, task) +def test_pytask_execute_task_setup_serializes_keyword_arguments(tmp_path): + path_to_serialized = tmp_path / "config.txt" + product = tmp_path / "out.dta" + + def serializer(kwargs): + return f"produces={kwargs['produces']};_input={kwargs['_input']}" + + task = Task( + base_name="task_example", + path=tmp_path / "task_example.py", + function=lambda: None, + depends_on={ + "_serialized": PythonNode(value=path_to_serialized), + "_script": PythonNode(value=tmp_path / "script.do"), + "_options": PythonNode(value=[]), + "_log_name": PythonNode(value=""), + "_input": PythonNode(value="input.dta"), + "produces": PythonNode(value=product), + }, + markers=[ + Mark( + "stata", + (), + { + "script": "script.do", + "serializer": serializer, + "suffix": ".txt", + }, + ) + ], + ) + session = Session(config={"stata": "stata", "platform": sys.platform}) + + pytask_execute_task_setup(session, task) + + assert path_to_serialized.read_text() == ( + f"produces={product.as_posix()};_input=input.dta" + ) + + +@needs_stata +def test_run_do_file_with_yaml_config(runner, tmp_path): + task_source = """ + import pytask + from pathlib import Path + + @pytask.mark.stata(script="script.do") + def task_run_do_file(produces=Path("auto.dta")): + pass + """ + tmp_path.joinpath("task_example.py").write_text(textwrap.dedent(task_source)) + + do_file = """ + args config + yaml read using "`config'", locals replace + local produces = r(yaml_produces) + sysuse auto, clear + save "`produces'", replace + """ + tmp_path.joinpath("script.do").write_text(textwrap.dedent(do_file)) + + result = runner.invoke(cli, [tmp_path.as_posix()]) + + assert result.exit_code == ExitCode.OK + assert tmp_path.joinpath("auto.dta").exists() + + +@needs_stata +def test_run_do_file_without_task_arguments(runner, tmp_path): + task_source = """ + import pytask + + @pytask.mark.stata(script="script.do") + def task_run_do_file(): + pass + """ + tmp_path.joinpath("task_example.py").write_text(textwrap.dedent(task_source)) + + do_file = """ + sysuse auto, clear + save "auto.dta", replace + """ + tmp_path.joinpath("script.do").write_text(textwrap.dedent(do_file)) + + result = runner.invoke(cli, [tmp_path.as_posix()]) + + assert result.exit_code == ExitCode.OK + assert tmp_path.joinpath("auto.dta").exists() + assert not tmp_path.joinpath(".pytask", "pytask-stata").exists() + + +@needs_stata +def test_run_do_file_with_supported_yaml_values(runner, tmp_path): + task_source = """ + from pathlib import Path + + import pytask + + + @pytask.task( + kwargs={ + "string_value": "hello", + "integer_value": 42, + "float_value": 3.14, + "bool_value": True, + "none_value": None, + "path_value": Path("input.txt"), + "list_numbers": [1, 2], + "tuple_strings": ("a", "b"), + "nested_mapping": { + "child_int": 1, + "child_bool": False, + "child_string": "value", + }, + } + ) + @pytask.mark.stata(script="script.do") + def task_run_do_file(produces=Path("supported.dta")): + pass + """ + tmp_path.joinpath("task_example.py").write_text(textwrap.dedent(task_source)) + tmp_path.joinpath("input.txt").write_text("input") + + do_file = """ + args config + yaml read using "`config'", locals replace + yaml validate, /// + required(string_value integer_value float_value bool_value none_value /// + path_value list_numbers list_numbers_1 list_numbers_2 /// + tuple_strings tuple_strings_1 tuple_strings_2 nested_mapping /// + nested_mapping_child_int nested_mapping_child_bool /// + nested_mapping_child_string produces) /// + types(integer_value:numeric float_value:numeric bool_value:boolean /// + none_value:null nested_mapping_child_bool:boolean) + yaml get nested_mapping, attributes(child_int child_bool child_string) quiet + local produces = r(yaml_produces) + sysuse auto, clear + save "`produces'", replace + """ + tmp_path.joinpath("script.do").write_text(textwrap.dedent(do_file)) + + result = runner.invoke(cli, [tmp_path.as_posix()]) + + assert result.exit_code == ExitCode.OK + assert tmp_path.joinpath("supported.dta").exists() + + @needs_stata def test_run_do_file(runner, tmp_path): task_source = """ diff --git a/tests/test_serialization.py b/tests/test_serialization.py new file mode 100644 index 0000000..a8343a0 --- /dev/null +++ b/tests/test_serialization.py @@ -0,0 +1,48 @@ +from __future__ import annotations + +import subprocess +import sys +from pathlib import Path + +import pytest + +from pytask_stata.serialization import serialize_keyword_arguments + + +def test_serialization_can_be_imported_directly(): + result = subprocess.run( + [sys.executable, "-c", "import pytask_stata.serialization"], + check=False, + capture_output=True, + text=True, + ) + + assert result.returncode == 0, result.stderr + + +def test_yaml_serialization_preserves_unicode(tmp_path): + path_to_serialized = tmp_path / "config.yaml" + + serialize_keyword_arguments( + "yaml", + path_to_serialized, + {"path": Path("J\u00f6rg")}, + ) + + serialized = path_to_serialized.read_text(encoding="utf-8") + assert "J\u00f6rg" in serialized + assert r"\xF6" not in serialized + + +@pytest.mark.parametrize( + "kwargs", + [ + {}, + {"items": []}, + {"nested": {"items": []}}, + {"nested": {}}, + ], +) +def test_yaml_serialization_rejects_empty_collections(tmp_path, kwargs): + with pytest.raises(ValueError, match="Empty YAML"): + serialize_keyword_arguments("yaml", tmp_path / "config.yaml", kwargs) diff --git a/tests/test_stata_mock.py b/tests/test_stata_mock.py new file mode 100644 index 0000000..fc7239d --- /dev/null +++ b/tests/test_stata_mock.py @@ -0,0 +1,367 @@ +from __future__ import annotations + +import sys +import textwrap + +import pytest +import yaml +from stata_mock.cli import _flatten_yaml +from stata_mock.cli import _parse_yaml_subset +from stata_mock.cli import main + +NESTED_CHILD_LEVEL = 2 + + +def test_yaml_read_with_locals_exposes_r_macros_and_saves_product( + tmp_path, monkeypatch +): + monkeypatch.chdir(tmp_path) + config = tmp_path / "config.yaml" + config.write_text( + textwrap.dedent( + """ + produces: out.dta + database: + host: localhost + port: 5432 + debug: true + """ + ) + ) + script = tmp_path / "script.do" + script.write_text( + textwrap.dedent( + """ + args config + yaml read using "`config'", locals replace + save "`r(yaml_produces)'" + """ + ) + ) + + monkeypatch.setattr( + sys, + "argv", + ["Stata", "-e", "do", script.as_posix(), config.as_posix(), "-mock"], + ) + + assert main() == 0 + assert (tmp_path / "out.dta").exists() + assert "end of mock do-file" in (tmp_path / "mock.log").read_text() + + +def test_yaml_read_decodes_utf8(tmp_path, monkeypatch): + monkeypatch.chdir(tmp_path) + config = tmp_path / "config.yaml" + config.write_text("produces: Jörg.dta\n", encoding="utf-8") + script = tmp_path / "script.do" + script.write_text( + textwrap.dedent( + """ + args config + yaml read using "`config'", locals replace + save "`r(yaml_produces)'" + """ + ) + ) + + monkeypatch.setattr( + sys, + "argv", + ["Stata", "-e", "do", script.as_posix(), config.as_posix(), "-mock"], + ) + + assert main() == 0 + assert (tmp_path / "Jörg.dta").exists() + + +def test_yaml_subset_matches_stata_for_supported_scalar_and_nested_types(): + config = textwrap.dedent( + """ + string_value: hello + quoted_number: "42" + quoted_bool: "true" + quoted_null: "null" + integer_value: 42 + float_value: 3.14 + bool_true: true + bool_false: false + none_value: null + path_value: build/output file.dta + list_numbers: + - 1 + - 2 + list_mixed: + - 1 + - two + - true + - null + list_colons: + - 'a: b' + - https://example.com + nested_mapping: + child_int: 1 + child_bool: false + child_string: value + """ + ) + + entries = {entry.key: entry for entry in _flatten_yaml(_parse_yaml_subset(config))} + + assert entries["string_value"].value == "hello" + assert entries["string_value"].type == "string" + assert entries["quoted_number"].value == "42" + assert entries["quoted_number"].type == "string" + assert entries["quoted_bool"].value == "true" + assert entries["quoted_bool"].type == "string" + assert entries["quoted_null"].value == "null" + assert entries["quoted_null"].type == "string" + assert entries["integer_value"].value == "42" + assert entries["integer_value"].type == "numeric" + assert entries["float_value"].value == "3.14" + assert entries["float_value"].type == "numeric" + assert entries["bool_true"].value == "1" + assert entries["bool_true"].type == "boolean" + assert entries["bool_false"].value == "0" + assert entries["bool_false"].type == "boolean" + assert entries["none_value"].value == "" + assert entries["none_value"].type == "null" + assert entries["path_value"].value == "build/output file.dta" + assert entries["path_value"].type == "string" + + assert entries["list_numbers"].type == "parent" + assert entries["list_numbers_1"].value == "1" + assert entries["list_numbers_1"].parent == "list_numbers" + assert entries["list_numbers_1"].type == "list_item" + assert entries["list_mixed_3"].value == "true" + assert entries["list_mixed_3"].type == "list_item" + assert entries["list_mixed_4"].value == "null" + assert entries["list_mixed_4"].type == "list_item" + assert entries["list_colons_1"].value == "a: b" + assert entries["list_colons_1"].type == "list_item" + assert entries["list_colons_2"].value == "https://example.com" + assert entries["list_colons_2"].type == "list_item" + + assert entries["nested_mapping"].type == "parent" + assert entries["nested_mapping_child_int"].value == "1" + assert entries["nested_mapping_child_int"].level == NESTED_CHILD_LEVEL + assert entries["nested_mapping_child_int"].parent == "nested_mapping" + assert entries["nested_mapping_child_bool"].value == "0" + assert entries["nested_mapping_child_bool"].type == "boolean" + + +def test_yaml_subset_unescapes_apostrophes_from_pyyaml(): + config = yaml.safe_dump({"value": "a'b: c"}, sort_keys=False) + + assert _parse_yaml_subset(config) == {"value": "a'b: c"} + + +@pytest.mark.parametrize( + "value", + [ + "a [bracketed] value", + "https://example.com/path[1]/data", + "a {braced} value", + ], +) +def test_yaml_subset_preserves_brackets_and_braces_in_scalar_strings(value): + config = yaml.safe_dump({"value": value}, sort_keys=False) + + assert _parse_yaml_subset(config) == {"value": value} + + +@pytest.mark.parametrize( + "config", + [ + "items: [1, 2]\n", + "mapping: {key: value}\n", + "items:\n- [1, 2]\n", + ], +) +def test_yaml_subset_rejects_flow_collections(config): + with pytest.raises(ValueError, match="Unsupported YAML syntax"): + _parse_yaml_subset(config) + + +def test_yaml_read_supports_custom_prefix_for_r_macros(tmp_path, monkeypatch): + monkeypatch.chdir(tmp_path) + config = tmp_path / "config.yaml" + config.write_text("produces: prefixed.dta\n") + script = tmp_path / "script.do" + script.write_text( + textwrap.dedent( + """ + args config + yaml read using "`config'", locals prefix(cfg_) replace + save "`r(cfg_produces)'" + """ + ) + ) + + monkeypatch.setattr( + sys, + "argv", + ["Stata", "-e", "do", script.as_posix(), config.as_posix(), "-mock"], + ) + + assert main() == 0 + assert (tmp_path / "prefixed.dta").exists() + + +def test_yaml_get_returns_attributes_for_nested_mapping(tmp_path, monkeypatch): + monkeypatch.chdir(tmp_path) + config = tmp_path / "config.yaml" + config.write_text( + textwrap.dedent( + """ + database: + host: localhost + port: 5432 + """ + ) + ) + script = tmp_path / "script.do" + script.write_text( + textwrap.dedent( + """ + args config + yaml read using "`config'", replace + yaml get database:host, quiet + save "`r(value)'" + """ + ) + ) + + monkeypatch.setattr( + sys, + "argv", + ["Stata", "-e", "do", script.as_posix(), config.as_posix(), "-mock"], + ) + + assert main() == 0 + assert (tmp_path / "localhost.dta").exists() + + +def test_yaml_get_returns_child_attributes_for_parent_key(tmp_path, monkeypatch): + monkeypatch.chdir(tmp_path) + config = tmp_path / "config.yaml" + config.write_text( + textwrap.dedent( + """ + indicators: + CME_MRY0T4: + label: mortality + unit: deaths + data_flow: CME + """ + ) + ) + script = tmp_path / "script.do" + script.write_text( + textwrap.dedent( + """ + args config + yaml read using "`config'", replace + yaml get indicators:CME_MRY0T4, attributes(label unit data_flow) quiet + save "`r(data_flow)'" + """ + ) + ) + + monkeypatch.setattr( + sys, + "argv", + ["Stata", "-e", "do", script.as_posix(), config.as_posix(), "-mock"], + ) + + assert main() == 0 + assert (tmp_path / "CME.dta").exists() + + +def test_yaml_validate_required_and_types_success(tmp_path, monkeypatch): + monkeypatch.chdir(tmp_path) + config = tmp_path / "config.yaml" + config.write_text( + textwrap.dedent( + """ + name: project + version: 1 + debug: false + """ + ) + ) + script = tmp_path / "script.do" + script.write_text( + textwrap.dedent( + """ + args config + yaml read using "`config'", replace + yaml validate, required(name version debug) /// + types(version:numeric debug:boolean) + sysuse auto, clear + """ + ) + ) + + monkeypatch.setattr( + sys, + "argv", + ["Stata", "-e", "do", script.as_posix(), config.as_posix(), "-mock"], + ) + + assert main() == 0 + assert "end of mock do-file" in (tmp_path / "mock.log").read_text() + + +def test_yaml_validate_required_failure_returns_stata_syntax_error( + tmp_path, monkeypatch +): + monkeypatch.chdir(tmp_path) + config = tmp_path / "config.yaml" + config.write_text("name: project\n") + script = tmp_path / "script.do" + script.write_text( + textwrap.dedent( + """ + args config + yaml read using "`config'", replace + yaml validate, required(name version) + sysuse auto, clear + """ + ) + ) + + monkeypatch.setattr( + sys, + "argv", + ["Stata", "-e", "do", script.as_posix(), config.as_posix(), "-mock"], + ) + + assert main() == 0 + assert "r(198)" in (tmp_path / "mock.log").read_text() + + +def test_yaml_read_rejects_unsupported_yaml_syntax(tmp_path, monkeypatch): + monkeypatch.chdir(tmp_path) + config = tmp_path / "config.yaml" + config.write_text("produces: &target out.dta\ncopy: *target\n") + script = tmp_path / "script.do" + script.write_text( + textwrap.dedent( + """ + args config + yaml read using "`config'", locals replace + save "`r(yaml_produces)'" + """ + ) + ) + + monkeypatch.setattr( + sys, + "argv", + ["Stata", "-e", "do", script.as_posix(), config.as_posix(), "-mock"], + ) + + assert main() == 0 + assert "r(198)" in (tmp_path / "mock.log").read_text() + assert not (tmp_path / "out.dta").exists() diff --git a/uv.lock b/uv.lock index 479b34b..648b1d4 100644 --- a/uv.lock +++ b/uv.lock @@ -23,11 +23,14 @@ wheels = [ [[package]] name = "click" -version = "8.5.0" +version = "8.4.2" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/c7/0e/7fa0ef50764b67090eca4114772a2abf8b6148198475e54c660b97caeee6/click-8.5.0.tar.gz", hash = "sha256:ba0d2089de75ea0310e2dde03160e6ca10009947fb95a182f9b54021bb272e34", size = 382235, upload-time = "2026-08-26T13:33:14.56Z" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/76/d4/81420972a676e8ffea40450d8c8c92943e7218a78fe9b64359836cc9876b/click-8.4.2.tar.gz", hash = "sha256:9a6cea6e60b17ebe0a44c5cc636d94f09bd66142c1cd7d8b4cd731c4917a15f6", size = 338000, upload-time = "2026-06-24T17:45:15.148Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/58/50/6c0d534c5f134586a8e1ba4e330569e32f057e33372ae556463212fb4cd3/click-8.5.0-py3-none-any.whl", hash = "sha256:255bc9599cf7748b4b1a446ccc735421bd08a2ae529a8b88597d3de5664ee360", size = 125251, upload-time = "2026-08-26T13:33:12.928Z" }, + { url = "https://files.pythonhosted.org/packages/fb/e2/79c688af8b210d232694e31e59da9f6ec747bae31c3f5946e4e9b98860d5/click-8.4.2-py3-none-any.whl", hash = "sha256:e6f9f66136c816745b9d65817da91d61d957fb16e02e4dcd0552553c5a197b76", size = 119243, upload-time = "2026-06-24T17:45:13.73Z" }, ] [[package]] @@ -486,7 +489,7 @@ wheels = [ [[package]] name = "pytask-parallel" -version = "0.5.5" +version = "0.5.4" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "attrs" }, @@ -497,9 +500,9 @@ dependencies = [ { name = "pytask" }, { name = "rich" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/c8/97/1d2e75e90a72bb4effcb7663d34db738318b7c3cfc9f1289f949eca71216/pytask_parallel-0.5.5.tar.gz", hash = "sha256:50af5e3733d60ae41a38c2294e52572c19154a10e97b8858f107e3a4afd07a47", size = 14536, upload-time = "2026-08-23T13:36:29.363Z" } +sdist = { url = "https://files.pythonhosted.org/packages/dc/e8/ec67465ac3237508ce8f2b4e765fdfb0ae3d7c41d3acfe6fc46d8fe50804/pytask_parallel-0.5.4.tar.gz", hash = "sha256:75c96cc57ebfa68b63b33b7e8691f3ad2c8911236a9b600c33dbe896fe28d321", size = 14354, upload-time = "2026-05-01T17:22:19.491Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/80/e5/7e37396b6da575d4085bd7f8afadc9803f4fda4b07a1d3e30fe6d8b00467/pytask_parallel-0.5.5-py3-none-any.whl", hash = "sha256:88ec676b085cc945a58675f5e6372344d010763b2d21e8820c7daf6c9845c408", size = 19272, upload-time = "2026-08-23T13:36:28.327Z" }, + { url = "https://files.pythonhosted.org/packages/5b/f2/44a7dd795a52d34d033b1cb1a6b1162eada650079e557e236fb6b88943be/pytask_parallel-0.5.4-py3-none-any.whl", hash = "sha256:f05ca8e3251e25621b260659e01bceec43875155afa3dab84a912e1bbd9971d0", size = 19110, upload-time = "2026-05-01T17:22:18.339Z" }, ] [[package]] @@ -508,6 +511,7 @@ source = { editable = "." } dependencies = [ { name = "click" }, { name = "pytask" }, + { name = "pyyaml" }, ] [package.dev-dependencies] @@ -528,6 +532,7 @@ typing = [ requires-dist = [ { name = "click", specifier = ">=8.1.8,!=8.2.0" }, { name = "pytask", specifier = ">=0.5.2" }, + { name = "pyyaml", specifier = ">=6.0.2" }, ] [package.metadata.requires-dev] @@ -587,6 +592,70 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ca/31/d4e37e9e550c2b92a9cbc2e4d0b7420a27224968580b5a447f420847c975/pytest_xdist-3.8.0-py3-none-any.whl", hash = "sha256:202ca578cfeb7370784a8c33d6d05bc6e13b4f25b5053c30a152269fd10f0b88", size = 46396, upload-time = "2025-07-01T13:30:56.632Z" }, ] +[[package]] +name = "pyyaml" +version = "6.0.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f4/a0/39350dd17dd6d6c6507025c0e53aef67a9293a6d37d3511f23ea510d5800/pyyaml-6.0.3-cp310-cp310-macosx_10_13_x86_64.whl", hash = "sha256:214ed4befebe12df36bcc8bc2b64b396ca31be9304b8f59e25c11cf94a4c033b", size = 184227, upload-time = "2025-09-25T21:31:46.04Z" }, + { url = "https://files.pythonhosted.org/packages/05/14/52d505b5c59ce73244f59c7a50ecf47093ce4765f116cdb98286a71eeca2/pyyaml-6.0.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:02ea2dfa234451bbb8772601d7b8e426c2bfa197136796224e50e35a78777956", size = 174019, upload-time = "2025-09-25T21:31:47.706Z" }, + { url = "https://files.pythonhosted.org/packages/43/f7/0e6a5ae5599c838c696adb4e6330a59f463265bfa1e116cfd1fbb0abaaae/pyyaml-6.0.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b30236e45cf30d2b8e7b3e85881719e98507abed1011bf463a8fa23e9c3e98a8", size = 740646, upload-time = "2025-09-25T21:31:49.21Z" }, + { url = "https://files.pythonhosted.org/packages/2f/3a/61b9db1d28f00f8fd0ae760459a5c4bf1b941baf714e207b6eb0657d2578/pyyaml-6.0.3-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:66291b10affd76d76f54fad28e22e51719ef9ba22b29e1d7d03d6777a9174198", size = 840793, upload-time = "2025-09-25T21:31:50.735Z" }, + { url = "https://files.pythonhosted.org/packages/7a/1e/7acc4f0e74c4b3d9531e24739e0ab832a5edf40e64fbae1a9c01941cabd7/pyyaml-6.0.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9c7708761fccb9397fe64bbc0395abcae8c4bf7b0eac081e12b809bf47700d0b", size = 770293, upload-time = "2025-09-25T21:31:51.828Z" }, + { url = "https://files.pythonhosted.org/packages/8b/ef/abd085f06853af0cd59fa5f913d61a8eab65d7639ff2a658d18a25d6a89d/pyyaml-6.0.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:418cf3f2111bc80e0933b2cd8cd04f286338bb88bdc7bc8e6dd775ebde60b5e0", size = 732872, upload-time = "2025-09-25T21:31:53.282Z" }, + { url = "https://files.pythonhosted.org/packages/1f/15/2bc9c8faf6450a8b3c9fc5448ed869c599c0a74ba2669772b1f3a0040180/pyyaml-6.0.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:5e0b74767e5f8c593e8c9b5912019159ed0533c70051e9cce3e8b6aa699fcd69", size = 758828, upload-time = "2025-09-25T21:31:54.807Z" }, + { url = "https://files.pythonhosted.org/packages/a3/00/531e92e88c00f4333ce359e50c19b8d1de9fe8d581b1534e35ccfbc5f393/pyyaml-6.0.3-cp310-cp310-win32.whl", hash = "sha256:28c8d926f98f432f88adc23edf2e6d4921ac26fb084b028c733d01868d19007e", size = 142415, upload-time = "2025-09-25T21:31:55.885Z" }, + { url = "https://files.pythonhosted.org/packages/2a/fa/926c003379b19fca39dd4634818b00dec6c62d87faf628d1394e137354d4/pyyaml-6.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:bdb2c67c6c1390b63c6ff89f210c8fd09d9a1217a465701eac7316313c915e4c", size = 158561, upload-time = "2025-09-25T21:31:57.406Z" }, + { url = "https://files.pythonhosted.org/packages/6d/16/a95b6757765b7b031c9374925bb718d55e0a9ba8a1b6a12d25962ea44347/pyyaml-6.0.3-cp311-cp311-macosx_10_13_x86_64.whl", hash = "sha256:44edc647873928551a01e7a563d7452ccdebee747728c1080d881d68af7b997e", size = 185826, upload-time = "2025-09-25T21:31:58.655Z" }, + { url = "https://files.pythonhosted.org/packages/16/19/13de8e4377ed53079ee996e1ab0a9c33ec2faf808a4647b7b4c0d46dd239/pyyaml-6.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:652cb6edd41e718550aad172851962662ff2681490a8a711af6a4d288dd96824", size = 175577, upload-time = "2025-09-25T21:32:00.088Z" }, + { url = "https://files.pythonhosted.org/packages/0c/62/d2eb46264d4b157dae1275b573017abec435397aa59cbcdab6fc978a8af4/pyyaml-6.0.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:10892704fc220243f5305762e276552a0395f7beb4dbf9b14ec8fd43b57f126c", size = 775556, upload-time = "2025-09-25T21:32:01.31Z" }, + { url = "https://files.pythonhosted.org/packages/10/cb/16c3f2cf3266edd25aaa00d6c4350381c8b012ed6f5276675b9eba8d9ff4/pyyaml-6.0.3-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:850774a7879607d3a6f50d36d04f00ee69e7fc816450e5f7e58d7f17f1ae5c00", size = 882114, upload-time = "2025-09-25T21:32:03.376Z" }, + { url = "https://files.pythonhosted.org/packages/71/60/917329f640924b18ff085ab889a11c763e0b573da888e8404ff486657602/pyyaml-6.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b8bb0864c5a28024fac8a632c443c87c5aa6f215c0b126c449ae1a150412f31d", size = 806638, upload-time = "2025-09-25T21:32:04.553Z" }, + { url = "https://files.pythonhosted.org/packages/dd/6f/529b0f316a9fd167281a6c3826b5583e6192dba792dd55e3203d3f8e655a/pyyaml-6.0.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1d37d57ad971609cf3c53ba6a7e365e40660e3be0e5175fa9f2365a379d6095a", size = 767463, upload-time = "2025-09-25T21:32:06.152Z" }, + { url = "https://files.pythonhosted.org/packages/f2/6a/b627b4e0c1dd03718543519ffb2f1deea4a1e6d42fbab8021936a4d22589/pyyaml-6.0.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:37503bfbfc9d2c40b344d06b2199cf0e96e97957ab1c1b546fd4f87e53e5d3e4", size = 794986, upload-time = "2025-09-25T21:32:07.367Z" }, + { url = "https://files.pythonhosted.org/packages/45/91/47a6e1c42d9ee337c4839208f30d9f09caa9f720ec7582917b264defc875/pyyaml-6.0.3-cp311-cp311-win32.whl", hash = "sha256:8098f252adfa6c80ab48096053f512f2321f0b998f98150cea9bd23d83e1467b", size = 142543, upload-time = "2025-09-25T21:32:08.95Z" }, + { url = "https://files.pythonhosted.org/packages/da/e3/ea007450a105ae919a72393cb06f122f288ef60bba2dc64b26e2646fa315/pyyaml-6.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:9f3bfb4965eb874431221a3ff3fdcddc7e74e3b07799e0e84ca4a0f867d449bf", size = 158763, upload-time = "2025-09-25T21:32:09.96Z" }, + { url = "https://files.pythonhosted.org/packages/d1/33/422b98d2195232ca1826284a76852ad5a86fe23e31b009c9886b2d0fb8b2/pyyaml-6.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196", size = 182063, upload-time = "2025-09-25T21:32:11.445Z" }, + { url = "https://files.pythonhosted.org/packages/89/a0/6cf41a19a1f2f3feab0e9c0b74134aa2ce6849093d5517a0c550fe37a648/pyyaml-6.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0", size = 173973, upload-time = "2025-09-25T21:32:12.492Z" }, + { url = "https://files.pythonhosted.org/packages/ed/23/7a778b6bd0b9a8039df8b1b1d80e2e2ad78aa04171592c8a5c43a56a6af4/pyyaml-6.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28", size = 775116, upload-time = "2025-09-25T21:32:13.652Z" }, + { url = "https://files.pythonhosted.org/packages/65/30/d7353c338e12baef4ecc1b09e877c1970bd3382789c159b4f89d6a70dc09/pyyaml-6.0.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5fdec68f91a0c6739b380c83b951e2c72ac0197ace422360e6d5a959d8d97b2c", size = 844011, upload-time = "2025-09-25T21:32:15.21Z" }, + { url = "https://files.pythonhosted.org/packages/8b/9d/b3589d3877982d4f2329302ef98a8026e7f4443c765c46cfecc8858c6b4b/pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc", size = 807870, upload-time = "2025-09-25T21:32:16.431Z" }, + { url = "https://files.pythonhosted.org/packages/05/c0/b3be26a015601b822b97d9149ff8cb5ead58c66f981e04fedf4e762f4bd4/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8dc52c23056b9ddd46818a57b78404882310fb473d63f17b07d5c40421e47f8e", size = 761089, upload-time = "2025-09-25T21:32:17.56Z" }, + { url = "https://files.pythonhosted.org/packages/be/8e/98435a21d1d4b46590d5459a22d88128103f8da4c2d4cb8f14f2a96504e1/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:41715c910c881bc081f1e8872880d3c650acf13dfa8214bad49ed4cede7c34ea", size = 790181, upload-time = "2025-09-25T21:32:18.834Z" }, + { url = "https://files.pythonhosted.org/packages/74/93/7baea19427dcfbe1e5a372d81473250b379f04b1bd3c4c5ff825e2327202/pyyaml-6.0.3-cp312-cp312-win32.whl", hash = "sha256:96b533f0e99f6579b3d4d4995707cf36df9100d67e0c8303a0c55b27b5f99bc5", size = 137658, upload-time = "2025-09-25T21:32:20.209Z" }, + { url = "https://files.pythonhosted.org/packages/86/bf/899e81e4cce32febab4fb42bb97dcdf66bc135272882d1987881a4b519e9/pyyaml-6.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:5fcd34e47f6e0b794d17de1b4ff496c00986e1c83f7ab2fb8fcfe9616ff7477b", size = 154003, upload-time = "2025-09-25T21:32:21.167Z" }, + { url = "https://files.pythonhosted.org/packages/1a/08/67bd04656199bbb51dbed1439b7f27601dfb576fb864099c7ef0c3e55531/pyyaml-6.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:64386e5e707d03a7e172c0701abfb7e10f0fb753ee1d773128192742712a98fd", size = 140344, upload-time = "2025-09-25T21:32:22.617Z" }, + { url = "https://files.pythonhosted.org/packages/d1/11/0fd08f8192109f7169db964b5707a2f1e8b745d4e239b784a5a1dd80d1db/pyyaml-6.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8da9669d359f02c0b91ccc01cac4a67f16afec0dac22c2ad09f46bee0697eba8", size = 181669, upload-time = "2025-09-25T21:32:23.673Z" }, + { url = "https://files.pythonhosted.org/packages/b1/16/95309993f1d3748cd644e02e38b75d50cbc0d9561d21f390a76242ce073f/pyyaml-6.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:2283a07e2c21a2aa78d9c4442724ec1eb15f5e42a723b99cb3d822d48f5f7ad1", size = 173252, upload-time = "2025-09-25T21:32:25.149Z" }, + { url = "https://files.pythonhosted.org/packages/50/31/b20f376d3f810b9b2371e72ef5adb33879b25edb7a6d072cb7ca0c486398/pyyaml-6.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ee2922902c45ae8ccada2c5b501ab86c36525b883eff4255313a253a3160861c", size = 767081, upload-time = "2025-09-25T21:32:26.575Z" }, + { url = "https://files.pythonhosted.org/packages/49/1e/a55ca81e949270d5d4432fbbd19dfea5321eda7c41a849d443dc92fd1ff7/pyyaml-6.0.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a33284e20b78bd4a18c8c2282d549d10bc8408a2a7ff57653c0cf0b9be0afce5", size = 841159, upload-time = "2025-09-25T21:32:27.727Z" }, + { url = "https://files.pythonhosted.org/packages/74/27/e5b8f34d02d9995b80abcef563ea1f8b56d20134d8f4e5e81733b1feceb2/pyyaml-6.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0f29edc409a6392443abf94b9cf89ce99889a1dd5376d94316ae5145dfedd5d6", size = 801626, upload-time = "2025-09-25T21:32:28.878Z" }, + { url = "https://files.pythonhosted.org/packages/f9/11/ba845c23988798f40e52ba45f34849aa8a1f2d4af4b798588010792ebad6/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f7057c9a337546edc7973c0d3ba84ddcdf0daa14533c2065749c9075001090e6", size = 753613, upload-time = "2025-09-25T21:32:30.178Z" }, + { url = "https://files.pythonhosted.org/packages/3d/e0/7966e1a7bfc0a45bf0a7fb6b98ea03fc9b8d84fa7f2229e9659680b69ee3/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:eda16858a3cab07b80edaf74336ece1f986ba330fdb8ee0d6c0d68fe82bc96be", size = 794115, upload-time = "2025-09-25T21:32:31.353Z" }, + { url = "https://files.pythonhosted.org/packages/de/94/980b50a6531b3019e45ddeada0626d45fa85cbe22300844a7983285bed3b/pyyaml-6.0.3-cp313-cp313-win32.whl", hash = "sha256:d0eae10f8159e8fdad514efdc92d74fd8d682c933a6dd088030f3834bc8e6b26", size = 137427, upload-time = "2025-09-25T21:32:32.58Z" }, + { url = "https://files.pythonhosted.org/packages/97/c9/39d5b874e8b28845e4ec2202b5da735d0199dbe5b8fb85f91398814a9a46/pyyaml-6.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:79005a0d97d5ddabfeeea4cf676af11e647e41d81c9a7722a193022accdb6b7c", size = 154090, upload-time = "2025-09-25T21:32:33.659Z" }, + { url = "https://files.pythonhosted.org/packages/73/e8/2bdf3ca2090f68bb3d75b44da7bbc71843b19c9f2b9cb9b0f4ab7a5a4329/pyyaml-6.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:5498cd1645aa724a7c71c8f378eb29ebe23da2fc0d7a08071d89469bf1d2defb", size = 140246, upload-time = "2025-09-25T21:32:34.663Z" }, + { url = "https://files.pythonhosted.org/packages/9d/8c/f4bd7f6465179953d3ac9bc44ac1a8a3e6122cf8ada906b4f96c60172d43/pyyaml-6.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:8d1fab6bb153a416f9aeb4b8763bc0f22a5586065f86f7664fc23339fc1c1fac", size = 181814, upload-time = "2025-09-25T21:32:35.712Z" }, + { url = "https://files.pythonhosted.org/packages/bd/9c/4d95bb87eb2063d20db7b60faa3840c1b18025517ae857371c4dd55a6b3a/pyyaml-6.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:34d5fcd24b8445fadc33f9cf348c1047101756fd760b4dacb5c3e99755703310", size = 173809, upload-time = "2025-09-25T21:32:36.789Z" }, + { url = "https://files.pythonhosted.org/packages/92/b5/47e807c2623074914e29dabd16cbbdd4bf5e9b2db9f8090fa64411fc5382/pyyaml-6.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:501a031947e3a9025ed4405a168e6ef5ae3126c59f90ce0cd6f2bfc477be31b7", size = 766454, upload-time = "2025-09-25T21:32:37.966Z" }, + { url = "https://files.pythonhosted.org/packages/02/9e/e5e9b168be58564121efb3de6859c452fccde0ab093d8438905899a3a483/pyyaml-6.0.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b3bc83488de33889877a0f2543ade9f70c67d66d9ebb4ac959502e12de895788", size = 836355, upload-time = "2025-09-25T21:32:39.178Z" }, + { url = "https://files.pythonhosted.org/packages/88/f9/16491d7ed2a919954993e48aa941b200f38040928474c9e85ea9e64222c3/pyyaml-6.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c458b6d084f9b935061bc36216e8a69a7e293a2f1e68bf956dcd9e6cbcd143f5", size = 794175, upload-time = "2025-09-25T21:32:40.865Z" }, + { url = "https://files.pythonhosted.org/packages/dd/3f/5989debef34dc6397317802b527dbbafb2b4760878a53d4166579111411e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7c6610def4f163542a622a73fb39f534f8c101d690126992300bf3207eab9764", size = 755228, upload-time = "2025-09-25T21:32:42.084Z" }, + { url = "https://files.pythonhosted.org/packages/d7/ce/af88a49043cd2e265be63d083fc75b27b6ed062f5f9fd6cdc223ad62f03e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5190d403f121660ce8d1d2c1bb2ef1bd05b5f68533fc5c2ea899bd15f4399b35", size = 789194, upload-time = "2025-09-25T21:32:43.362Z" }, + { url = "https://files.pythonhosted.org/packages/23/20/bb6982b26a40bb43951265ba29d4c246ef0ff59c9fdcdf0ed04e0687de4d/pyyaml-6.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:4a2e8cebe2ff6ab7d1050ecd59c25d4c8bd7e6f400f5f82b96557ac0abafd0ac", size = 156429, upload-time = "2025-09-25T21:32:57.844Z" }, + { url = "https://files.pythonhosted.org/packages/f4/f4/a4541072bb9422c8a883ab55255f918fa378ecf083f5b85e87fc2b4eda1b/pyyaml-6.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:93dda82c9c22deb0a405ea4dc5f2d0cda384168e466364dec6255b293923b2f3", size = 143912, upload-time = "2025-09-25T21:32:59.247Z" }, + { url = "https://files.pythonhosted.org/packages/7c/f9/07dd09ae774e4616edf6cda684ee78f97777bdd15847253637a6f052a62f/pyyaml-6.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:02893d100e99e03eda1c8fd5c441d8c60103fd175728e23e431db1b589cf5ab3", size = 189108, upload-time = "2025-09-25T21:32:44.377Z" }, + { url = "https://files.pythonhosted.org/packages/4e/78/8d08c9fb7ce09ad8c38ad533c1191cf27f7ae1effe5bb9400a46d9437fcf/pyyaml-6.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c1ff362665ae507275af2853520967820d9124984e0f7466736aea23d8611fba", size = 183641, upload-time = "2025-09-25T21:32:45.407Z" }, + { url = "https://files.pythonhosted.org/packages/7b/5b/3babb19104a46945cf816d047db2788bcaf8c94527a805610b0289a01c6b/pyyaml-6.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6adc77889b628398debc7b65c073bcb99c4a0237b248cacaf3fe8a557563ef6c", size = 831901, upload-time = "2025-09-25T21:32:48.83Z" }, + { url = "https://files.pythonhosted.org/packages/8b/cc/dff0684d8dc44da4d22a13f35f073d558c268780ce3c6ba1b87055bb0b87/pyyaml-6.0.3-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a80cb027f6b349846a3bf6d73b5e95e782175e52f22108cfa17876aaeff93702", size = 861132, upload-time = "2025-09-25T21:32:50.149Z" }, + { url = "https://files.pythonhosted.org/packages/b1/5e/f77dc6b9036943e285ba76b49e118d9ea929885becb0a29ba8a7c75e29fe/pyyaml-6.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:00c4bdeba853cc34e7dd471f16b4114f4162dc03e6b7afcc2128711f0eca823c", size = 839261, upload-time = "2025-09-25T21:32:51.808Z" }, + { url = "https://files.pythonhosted.org/packages/ce/88/a9db1376aa2a228197c58b37302f284b5617f56a5d959fd1763fb1675ce6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:66e1674c3ef6f541c35191caae2d429b967b99e02040f5ba928632d9a7f0f065", size = 805272, upload-time = "2025-09-25T21:32:52.941Z" }, + { url = "https://files.pythonhosted.org/packages/da/92/1446574745d74df0c92e6aa4a7b0b3130706a4142b2d1a5869f2eaa423c6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:16249ee61e95f858e83976573de0f5b2893b3677ba71c9dd36b9cf8be9ac6d65", size = 829923, upload-time = "2025-09-25T21:32:54.537Z" }, + { url = "https://files.pythonhosted.org/packages/f0/7a/1c7270340330e575b92f397352af856a8c06f230aa3e76f86b39d01b416a/pyyaml-6.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4ad1906908f2f5ae4e5a8ddfce73c320c2a1429ec52eafd27138b7f1cbe341c9", size = 174062, upload-time = "2025-09-25T21:32:55.767Z" }, + { url = "https://files.pythonhosted.org/packages/f1/12/de94a39c2ef588c7e6455cfbe7343d3b2dc9d6b6b2f40c4c6565744c873d/pyyaml-6.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b", size = 149341, upload-time = "2025-09-25T21:32:56.828Z" }, +] + [[package]] name = "rich" version = "14.1.0" @@ -700,27 +769,27 @@ wheels = [ [[package]] name = "ty" -version = "0.0.78" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d8/c7/2ba0861384c5b5097ac354383abb98188112cb330208c21d5197e98a29e5/ty-0.0.78.tar.gz", hash = "sha256:770b45854f85fa11595208f08c0f28df80943164d10a2832d86be6ac29f135b2", size = 7050609, upload-time = "2026-09-02T22:41:33.92Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/ea/ed/f34cfc06a9ba72979df219e48dae1a0b6a6c74a340763ccd30a547edf913/ty-0.0.78-py3-none-linux_armv6l.whl", hash = "sha256:122700b98f9d45785c1ce91a9418154562e7f64f4bf34679f6f7b38c5b97453f", size = 13304624, upload-time = "2026-09-02T22:40:56.649Z" }, - { url = "https://files.pythonhosted.org/packages/1c/28/5576e2a08b57676d9b2a736d528f077a6c6e32c3d1de2d75dbbe28346966/ty-0.0.78-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:cbe7e3709ccf29ef3d9f58f5914cc30ec36fb647008a5a4ff8483abe401bfe8d", size = 12928383, upload-time = "2026-09-02T22:40:59.162Z" }, - { url = "https://files.pythonhosted.org/packages/8e/e0/027d49c3da5235e634da3d3fc52c4874ec89f50830388c9c259f8fb71e0e/ty-0.0.78-py3-none-macosx_11_0_arm64.whl", hash = "sha256:c3528897b3ab9d3589561bc2b5e61a4d5d686de527a4400bb09a439b922a6c70", size = 12730058, upload-time = "2026-09-02T22:41:01.235Z" }, - { url = "https://files.pythonhosted.org/packages/bb/bc/6bf8ffefd8063730a70ae889cf85def72bc155fd1453135ebf8a09c2f1c2/ty-0.0.78-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8bfba4c44a06484093f527b8ef43a317abcf91395b49396170266629eedf74aa", size = 12813321, upload-time = "2026-09-02T22:41:03.251Z" }, - { url = "https://files.pythonhosted.org/packages/6d/c0/b3cdf26f82108908d92fdb7ddb741019c446ceb666cf204d4dbf611bde33/ty-0.0.78-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f903c06fdee17baf8373173039ab28f1bce28e66b1c734929a5f50b37eb54d9", size = 13072219, upload-time = "2026-09-02T22:41:05.225Z" }, - { url = "https://files.pythonhosted.org/packages/4d/36/16bfb0abdd178dae11dbc4b57b9a86c2b62642a18c1103fd2c2930aa5879/ty-0.0.78-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dd83e5fe3f07291d1bd4e591f8d2607c204f3eab53bcb1b8060c40e876e1aa61", size = 13903958, upload-time = "2026-09-02T22:41:07.333Z" }, - { url = "https://files.pythonhosted.org/packages/0f/0c/74d3b1f0344b13156c719dd68a7edf7e48c2051718c9f326ba3cbf45ea53/ty-0.0.78-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:325285377319cf7168a2b8b771ae5027f411530e3c7eab1faf4583cdd72fd7c9", size = 14355581, upload-time = "2026-09-02T22:41:09.56Z" }, - { url = "https://files.pythonhosted.org/packages/8d/d7/7ca0359e1e61b15b8b02328c8d120db3c507876b9b7c6bd9f26935353e0e/ty-0.0.78-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:54b7846a404da6492697b524a769755ee9bee157d67674063ecd9c5f69dc52ff", size = 14044749, upload-time = "2026-09-02T22:41:11.678Z" }, - { url = "https://files.pythonhosted.org/packages/3b/6a/731f16ff42c5fc96e742c2f4e0a6915356bae114ae02ae4af6f33502175f/ty-0.0.78-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:169d3b9d134c0b48fe1af8a844142d374655552054a9d6c15a4b6e51bb0382ea", size = 13391647, upload-time = "2026-09-02T22:41:13.928Z" }, - { url = "https://files.pythonhosted.org/packages/0c/af/250cc29daf310e837188509ea4d78460c495d8a74c4fb84b4152d9ef2d4f/ty-0.0.78-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:6108cb3b2d28dac5981d4e25008a0a5547d8c877a67f6da9e8c38e7e946be44f", size = 13945020, upload-time = "2026-09-02T22:41:15.968Z" }, - { url = "https://files.pythonhosted.org/packages/b8/f9/96aab1dee4535e66554e8dc7657c69f6c61c181d8e70b9c3527908e93ef4/ty-0.0.78-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:589ad03608d9d2975ef4b23c41c4f847e325bcc7686f51d4c66066b8dbc18a2a", size = 12851149, upload-time = "2026-09-02T22:41:18.06Z" }, - { url = "https://files.pythonhosted.org/packages/85/b0/53d8fe9a847534ef5fe2165c7d5292cb853b29dfd7011cbfb1cdb90a8012/ty-0.0.78-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:b3fa0786edc1af06030f872d83499c0cea7c261dbbb651e0aee8306bf2c8a869", size = 13091464, upload-time = "2026-09-02T22:41:20.227Z" }, - { url = "https://files.pythonhosted.org/packages/21/65/94a4e5a02de559f6c6c0ee7a14b88660b4eee058ec6fec5c0ff6ecfbf5cc/ty-0.0.78-py3-none-musllinux_1_2_i686.whl", hash = "sha256:92c5639befc577578c8abd4e5a7fccf98d828db98b09e8d4dd81605dc0e54aef", size = 13389389, upload-time = "2026-09-02T22:41:22.27Z" }, - { url = "https://files.pythonhosted.org/packages/2e/b6/d0c7fe6be64ca5a15100c4b1f0e39c19660d53bc544f609fa117b346e661/ty-0.0.78-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:0dce70bc51652b2775debd1d1e422fb0179f5207c73deb4d5d0aca37e5f61695", size = 13691928, upload-time = "2026-09-02T22:41:24.292Z" }, - { url = "https://files.pythonhosted.org/packages/0a/5d/36081205611ba3fa802efc4ad63e4b1e949bda2f7bb37b34ac9bb6c00db0/ty-0.0.78-py3-none-win32.whl", hash = "sha256:1c80976ca9185d7a9d1baab1fb57240331b8dac58d3b11e46200284086a6de8d", size = 12647346, upload-time = "2026-09-02T22:41:26.699Z" }, - { url = "https://files.pythonhosted.org/packages/f1/89/b925fe1ea1bc56fc7f11d2496e29072fdd2ceb7b389884fc7b2d07cf0c41/ty-0.0.78-py3-none-win_amd64.whl", hash = "sha256:32e82b704471eab34f67b51c151660ca8a00815977b28278905d76fba54f7415", size = 13241810, upload-time = "2026-09-02T22:41:28.857Z" }, - { url = "https://files.pythonhosted.org/packages/91/f1/090ef7b52355bcedfbfbff6ce70fa81ba5bd5f6ed3f8d99ae05e6f2fe75b/ty-0.0.78-py3-none-win_arm64.whl", hash = "sha256:3a14d641a3c04fa9a80f2a46be1531d915f60d4fb79d4b894627bbe46bb35d64", size = 13077433, upload-time = "2026-09-02T22:41:31.525Z" }, +version = "0.0.65" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cf561927e8e9ab5c1892a833b664aa9cd6f051a75f6280c66d8047246bda/ty-0.0.65.tar.gz", hash = "sha256:b7134bffcc00b715fa8291e84d845782ced810a998dc1f7f11d71c85c4046325", size = 6460098, upload-time = "2026-07-29T18:31:03.27Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7b/4e/71e2d325d2b53a1afad81624ad076b2ede413213fc4a18cb05b78c568571/ty-0.0.65-py3-none-linux_armv6l.whl", hash = "sha256:dc556c9f05408bef4c4ef02b2cc382e4e5f797b4b20d64410289848f0d76705f", size = 12298466, upload-time = "2026-07-29T18:30:12.744Z" }, + { url = "https://files.pythonhosted.org/packages/57/77/fec8f29647c55794efa430a7f365e44f5ce7ffb6459d9445a87fac569bec/ty-0.0.65-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:29d2e0d34cc0a28a17ef0cf81135c5ebabc3562131f9079138ba5e7bae0f56bd", size = 11942421, upload-time = "2026-07-29T18:30:16.076Z" }, + { url = "https://files.pythonhosted.org/packages/13/09/7f3766aef9dc627e2698cf4e3e59cf53389dcae3812040d33c1aa931230f/ty-0.0.65-py3-none-macosx_11_0_arm64.whl", hash = "sha256:685f49a9312bbf69d5b65bbb66384fed1f927403ea030c217b9289092d7e46c4", size = 11451922, upload-time = "2026-07-29T18:30:19.155Z" }, + { url = "https://files.pythonhosted.org/packages/cb/7b/1a77cd50e0befb50f55b8bf9bd3ed3eddf184bf28c61b56727039e0774fc/ty-0.0.65-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6f564b5ebe78e2f3a8e7b8eacb1292eb88b7c0f3c8630671cfca31abc0709cd9", size = 11994999, upload-time = "2026-07-29T18:30:22.315Z" }, + { url = "https://files.pythonhosted.org/packages/63/7b/feda16f3a4a0a99be27431e0c9598eeeec0db1eb2fec9a15976698209418/ty-0.0.65-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c983e156fe9e113fb56389e13d327b6b8549fe866de9b269684723a88e9b732d", size = 12090662, upload-time = "2026-07-29T18:30:24.93Z" }, + { url = "https://files.pythonhosted.org/packages/ed/3e/3f69bf9c9307dbdc0771719f65ce5b556e7bdeeaccbdd599d4f57866d801/ty-0.0.65-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e3663b7396e8b1a9954e20e732de7ccb0192bf4118473069b4945920d6923921", size = 12822094, upload-time = "2026-07-29T18:30:28.012Z" }, + { url = "https://files.pythonhosted.org/packages/90/38/8fa791b3bb503ee2b46ad81690cd1bdd54519582df6d805cee57fe143e85/ty-0.0.65-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:306ed01f29d6e108e98feb233dbbf5878a027603b71bd3743b343977933a9f16", size = 13357833, upload-time = "2026-07-29T18:30:31.122Z" }, + { url = "https://files.pythonhosted.org/packages/c1/73/4dda396a201e1dd0ed3594a9b48e559cb41c4bc048c6cd4c4d1b39eb4313/ty-0.0.65-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28bcfc8898c94f079a9100e684bcf312b6a64ad3a7d4ebb35a4591546030a2cd", size = 12977303, upload-time = "2026-07-29T18:30:33.944Z" }, + { url = "https://files.pythonhosted.org/packages/a5/26/c250c2c569adc53a8591716641388397bcb2a442e4a30b952ae81b50c0e0/ty-0.0.65-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5a75bd0c245c38802a8f488378e74f92feb7dd33db7d63fbdd6fdf82791ba730", size = 12579338, upload-time = "2026-07-29T18:30:37.199Z" }, + { url = "https://files.pythonhosted.org/packages/d3/94/4a5647d44753ca218fc930d7e4d9bf468d0ed4a0ad4b3d57588bc1bbacf7/ty-0.0.65-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:9e5e1bdea9662d2b5312b4e99f319f4e6e2ea427511b5fbc546141b79ec53f76", size = 12957731, upload-time = "2026-07-29T18:30:39.937Z" }, + { url = "https://files.pythonhosted.org/packages/36/b6/1e22fa11a1e0dfb20b1c7f3cbfd8170273aada2a82f9ecd3055275370c44/ty-0.0.65-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:03a88493d4842889f65280ae241e06b399d57eb3c63571054cad21a4c33b3b69", size = 11938625, upload-time = "2026-07-29T18:30:42.603Z" }, + { url = "https://files.pythonhosted.org/packages/5c/0a/fe5f22ef62b193201bc5566762e22049762cd485bfafb5095a7050760054/ty-0.0.65-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:600b8bf6f4940cf7ffb2f43d3716faaf38dcb97cd8617c55771451bc0276408f", size = 12105592, upload-time = "2026-07-29T18:30:45.419Z" }, + { url = "https://files.pythonhosted.org/packages/76/fd/922b3a6e9d697452cdbb4b7e3f636868add5ec652154518a736e4364f3b7/ty-0.0.65-py3-none-musllinux_1_2_i686.whl", hash = "sha256:0c28007bc79d648c1ddaf1e65885d07baec48eb87240da442f608e4107c1b7d8", size = 12387335, upload-time = "2026-07-29T18:30:48.405Z" }, + { url = "https://files.pythonhosted.org/packages/77/22/a1a08ebc84c083db2fb55e3b5cd186db0c067692f4921146f601360231e2/ty-0.0.65-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:c852da96091ad22361e6586b7c7ba98e1334dcd4d8ffb67e47f4fb673de33f77", size = 12682710, upload-time = "2026-07-29T18:30:51.364Z" }, + { url = "https://files.pythonhosted.org/packages/81/14/eaaa410a25bbdea19722109b5422380a0e211b3afcf3071d15953ddbd5db/ty-0.0.65-py3-none-win32.whl", hash = "sha256:cf529d538f1403b14b0511e6ec3cdb95d3d974adabf24cc76cedc533368c3edc", size = 11692341, upload-time = "2026-07-29T18:30:54.35Z" }, + { url = "https://files.pythonhosted.org/packages/bc/0f/6d48f206dce9d7e53fe3b5ea0f0ab5800dd9d2365b2b48f736783436c43f/ty-0.0.65-py3-none-win_amd64.whl", hash = "sha256:234a321e33c7cbbfbd67bfa0b01b685dd9c21f1841781a21e5ca1fa0b25f1d5d", size = 12729355, upload-time = "2026-07-29T18:30:57.275Z" }, + { url = "https://files.pythonhosted.org/packages/96/aa/7446f7725e303cf78e058c893af1f0552b9451895454908706f4c6c3494b/ty-0.0.65-py3-none-win_arm64.whl", hash = "sha256:b9424be1ec56d93ff18609fb1c0a0a2283fe1282cd6d1c7604f97d73b94d61f2", size = 12051375, upload-time = "2026-07-29T18:31:00.579Z" }, ] [[package]]