Patch pyproject reading¶
In module pyproject_reading code function read_pyproject is too strict, monkeypatch it!
Without the patch, pyproject.toml [tool.setuptools-scm] section is
missing, raises LookupError.
Warning
tool_name ordering
tool_name requires 1st [tool.x] section to be the package name, in this case, drain-swamp. e.g. [tool.drain-swamp] section
CHANGES
tool_name (str -> str | Sequence[str]) from “setuptools-scm” to [“drain-swamp”]
the tool_name becomes the first element
combines contents of sections
- wreck.monkey.patch_pyproject_reading.__all__: tuple[str, str] = ("ReadPyproject", "ReadPyprojectStrict")¶
Module exports
- class wreck.monkey.patch_pyproject_reading.ReadPyproject¶
Do not confine data fields. Accept whatever the section(s) contains.
- update(mixed_target, d_other, key_name: str | None = None, key_value: str | None = None)¶
Update a ReadPyprojectBase subclass instance. Which is either a dict or a list[dict].
For list[dict] also supply a key / value pair. So know which dict to update.
- Parameters:
mixed_target¶ (dict[str, Any] | list[dict[str, Any]]) – parent dict
key_name¶ (str | None) – None if not a
collections.abc.Sequence[dict]. To identify which dict to update, a known dict key is searched for.key_value¶ (str | None) – None if not a
collections.abc.Sequence[dict]. To identify which dict to update, a known dict key / value pair are used to find a match.
- class wreck.monkey.patch_pyproject_reading.ReadPyprojectStrict¶
Confine data fields to acceptable by setuptools_scm._config.Configuration.