diff --git a/doc/nitpick-exceptions.txt b/doc/nitpick-exceptions.txt index 8ff804f1a4044d802b2562c5c47e8dfa8beb6dda..0af3c739ade938184477a2ec5f052bc59b5eec42 100644 --- a/doc/nitpick-exceptions.txt +++ b/doc/nitpick-exceptions.txt @@ -6,3 +6,4 @@ py:class conda_build.config.Config py:class pkg_resources.Requirement py:class os._Environ py:class _io.StringIO +py:class packaging.requirements.Requirement diff --git a/src/idiap_devtools/utils.py b/src/idiap_devtools/utils.py index 276779bf6e1ed3fe7742160531481c1ddc185516..720acd3a32870d9e83bf7e3328fa27bbd56d53ec 100644 --- a/src/idiap_devtools/utils.py +++ b/src/idiap_devtools/utils.py @@ -28,12 +28,12 @@ def set_environment( Parameters ---------- - name: The name of the environment variable to set - - value: The value to set the environment variable to - - env: Optional environment (dictionary) where to set the variable at - + name + The name of the environment variable to set + value + The value to set the environment variable to + env + Optional environment (dictionary) where to set the variable at Returns ------- @@ -51,15 +51,14 @@ def human_time(seconds: int | float, granularity: int = 2) -> str: This function will convert the provided time in seconds into weeks, days, hours, minutes and seconds. - Parameters ---------- - seconds: The number of seconds to convert - - granularity: The granularity corresponds to how many elements will - output. For a granularity of 2, only the first two non-zero entries - are output. + seconds + The number of seconds to convert + granularity + The granularity corresponds to how many elements will output. For a + granularity of 2, only the first two non-zero entries are output. Returns ------- @@ -100,13 +99,12 @@ def run_cmdline( Parameters ---------- - cmd: The command to run, with parameters separated on a list of strings - - logger: A logger to log messages to console - - kwargs: Further kwargs to be set on the call to - :py:class:`subprocess.Popen`. - + cmd + The command to run, with parameters separated on a list of strings + logger + A logger to log messages to console + kwargs + Further kwargs to be set on the call to :py:class:`subprocess.Popen`. Returns -------