Module ds.parsers.pyproject_rye

pyproject.toml parser for rye.

Global variables

var PYTHON_CALL

Format for a python call.

Functions

def loads(s: str, /, *, parse_float: ParseFloat = builtins.float) ‑> dict[str, typing.Any]

Parse TOML from a string.

def parse_workspace(config: Config, key: str = 'tool.rye.workspace') ‑> Dict[pathlib.Path, bool]
def parse_tasks(config: Config, key: str = 'tool.rye.scripts') ‑> Dict[str, Task]

Tasks are in tool.rye.scripts.

See: - https://rye.astral.sh/guide/pyproject/#toolryescripts - https://rye.astral.sh/guide/commands/run/

Features: - Supported (non-standard): disabled task - Supported (non-standard): task.help - task description - Supported: task.cmd - basic task - Supported: task.args - argument interpolation - Supported: task.cwd - working directory - Supported: task.depends - composite task - Supported: task.env - environments - Not Supported: task.keep_going - error suppression

def python_call(call: str) ‑> str

Return a formatted call string.

See: https://rye.astral.sh/guide/pyproject/#call

>>> python_call("http.server")
'python -m http.server'
>>> python_call("builtins:help") == PYTHON_CALL.format(pkg="builtins", fn="help()")
True
>>> python_call("builtins:print('Hello World!')") == PYTHON_CALL.format(
...     pkg="builtins", fn="print('Hello World!')")
True