diff --git a/docs/source/api.rst b/docs/source/api.rst index 5a5b20b..8932f57 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -22,3 +22,6 @@ API .. autoclass:: rez_pip.pip.DownloadedArtifact :members: + +.. autoclass:: rez_pip.plugins.CleanupAction + :members: diff --git a/src/rez_pip/plugins/__init__.py b/src/rez_pip/plugins/__init__.py index 6293011..056f9d4 100644 --- a/src/rez_pip/plugins/__init__.py +++ b/src/rez_pip/plugins/__init__.py @@ -35,14 +35,14 @@ def __dir__() -> typing.List[str]: @dataclasses.dataclass(frozen=True) class CleanupAction: """ - Cleanup hook action. If you want to to any cleanup from a cleanup hook - you need ot return this. + Cleanup hook action. If you want to do any cleanup from a cleanup hook + you need to return this from the :func:`cleanup` hook. """ #: Operation to perform. op: typing.Literal["remove"] - #: Path to on which to perform the operation. + #: Path on which to perform the operation. path: str @@ -101,8 +101,8 @@ def cleanup( # type: ignore[empty-body] self, dist: rez_pip.compat.importlib_metadata.Distribution, path: str ) -> rez_pip.compat.Sequence[CleanupAction]: """ - Cleanup a package post-installation. Do not do any files/directories from this hook. - rez-pip will take care of deleting stuff for you. + Cleanup a package post-installation. Do not delete any files/directories from this hook. + Return the list of actions you want to perform and let rez-pip perform them. :param dist: Python distribution. :param path: Root path of the rez variant.