diff --git a/CHANGES.md b/CHANGES.md index d08f679..6ff3ff0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,7 @@ releases are available on [PyPI](https://pypi.org/project/pytask-r) and - {pull}`33` deprecates INI configurations and aligns the plugin with pytask v0.3. - {pull}`34` adds mypy, ruff and refurb. +- {pull}`35` publishes types. ## 0.2.0 - 2022-04-16 diff --git a/MANIFEST.in b/MANIFEST.in index ebba16e..438b3ea 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -8,3 +8,5 @@ exclude tox.ini include LICENSE include README.md + +recursive-include src py.typed diff --git a/src/pytask_r/config.py b/src/pytask_r/config.py index 15260db..f107589 100644 --- a/src/pytask_r/config.py +++ b/src/pytask_r/config.py @@ -21,7 +21,7 @@ def pytask_parse_config(config: dict[str, Any]) -> None: config["r_options"] = _parse_value_or_whitespace_option(config.get("r_options")) -def _parse_value_or_whitespace_option(value: str | None) -> None | str | list[str]: +def _parse_value_or_whitespace_option(value: Any) -> list[str] | None: """Parse option which can hold a single value or values separated by new lines.""" if value is None: return None diff --git a/src/pytask_r/py.typed b/src/pytask_r/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/src/pytask_r/shared.py b/src/pytask_r/shared.py index 6a9f6ca..b3ae17f 100644 --- a/src/pytask_r/shared.py +++ b/src/pytask_r/shared.py @@ -9,7 +9,8 @@ def r( - script: str | Path = None, + *, + script: str | Path, options: str | Iterable[str] | None = None, serializer: str | Callable[..., str] | str | None = None, suffix: str | None = None, @@ -23,7 +24,7 @@ def r( Parameters ---------- - script : Union[str, Path] + script : str | Path The path to the R script which is executed. options : str | Iterable[str] One or multiple command line options passed to Rscript.