Module ds.parsers.composer_json
composer.json parser.
Global variables
var RE_PHP_CALL-
Detect a PHP call.
var PHP_CALL-
PHP call.
var PHP_REFER-
Reference symbol.
Functions
def loads(s, *, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)-
Deserialize
s(astr,bytesorbytearrayinstance containing a JSON document) to a Python object.object_hookis an optional function that will be called with the result of any object literal decode (adict). The return value ofobject_hookwill be used instead of thedict. This feature can be used to implement custom decoders (e.g. JSON-RPC class hinting).object_pairs_hookis an optional function that will be called with the result of any object literal decoded with an ordered list of pairs. The return value ofobject_pairs_hookwill be used instead of thedict. This feature can be used to implement custom decoders. Ifobject_hookis also defined, theobject_pairs_hooktakes priority.parse_float, if specified, will be called with the string of every JSON float to be decoded. By default this is equivalent to float(num_str). This can be used to use another datatype or parser for JSON floats (e.g. decimal.Decimal).parse_int, if specified, will be called with the string of every JSON int to be decoded. By default this is equivalent to int(num_str). This can be used to use another datatype or parser for JSON integers (e.g. float).parse_constant, if specified, will be called with one of the following strings: -Infinity, Infinity, NaN. This can be used to raise an exception if invalid JSON numbers are encountered.To use a custom
JSONDecodersubclass, specify it with theclskwarg; otherwiseJSONDecoderis used. def parse_workspace(config: Config, key: str = '') ‑> Dict[pathlib.Path, bool]-
Workspaces are not officially supported by
composer.json. def parse_tasks(config: Config, key: str = 'scripts') ‑> Dict[str, Task]-
Tasks are defined in
scripts.See: https://getcomposer.org/doc/articles/scripts.md#writing-custom-commands
Features: - Supported (non-standard): disabled task - Supported:
task.help- task description - Supported:task.cmd- basic task - Supported:task.args- argument interpolation - Not Supported:task.cwd- working directory - Supported:task.depends- Supported:task.env- environments - Not Supported:task.keep_going- error suppression def php_call(cmd: str) ‑> str-
Format a PHP call.
def parse_cmd(task: Task, cmd: str) ‑> Task-
Parse a command.