From 1ad4b5159d56a7f69632121209ea22910e96b5c5 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Mon, 9 Jan 2023 18:50:21 +0100 Subject: [PATCH 1/3] Publish types. --- CHANGES.md | 1 + MANIFEST.in | 2 ++ src/pytask_r/py.typed | 0 3 files changed, 3 insertions(+) create mode 100644 src/pytask_r/py.typed 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/py.typed b/src/pytask_r/py.typed new file mode 100644 index 0000000..e69de29 From 8a236205936722bb7c957b2f5b1dd37e4bdcde3a Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Mon, 9 Jan 2023 22:51:17 +0100 Subject: [PATCH 2/3] Make script mandatory. --- src/pytask_r/config.py | 2 +- src/pytask_r/shared.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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/shared.py b/src/pytask_r/shared.py index 6a9f6ca..5ccfbb0 100644 --- a/src/pytask_r/shared.py +++ b/src/pytask_r/shared.py @@ -9,7 +9,7 @@ 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 +23,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. From 486ee7f5d913b5b302e5143616d165f7ce0b64cd Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Sat, 21 Jan 2023 13:26:09 +0100 Subject: [PATCH 3/3] fix. --- src/pytask_r/shared.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pytask_r/shared.py b/src/pytask_r/shared.py index 5ccfbb0..b3ae17f 100644 --- a/src/pytask_r/shared.py +++ b/src/pytask_r/shared.py @@ -9,6 +9,7 @@ def r( + *, script: str | Path, options: str | Iterable[str] | None = None, serializer: str | Callable[..., str] | str | None = None,