Skip to content

Commit dff5946

Browse files
committed
docs: convert docstrings in handler helpers to Sphinx convention
1 parent 6c2e939 commit dff5946

1 file changed

Lines changed: 17 additions & 33 deletions

File tree

src/DIRAC/FrameworkSystem/Service/SystemAdministratorHandler.py

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -50,29 +50,20 @@ def loadDIRACCFG():
5050
def _normalise_version(version):
5151
"""Validate and normalise a raw version string supplied by the operator.
5252
53-
Parameters
54-
----------
55-
version:
56-
Raw string as received from the client (may contain surrounding
53+
:param str version: Raw string as received from the client (may contain surrounding
5754
whitespace or use the spaced ``pkg @ url`` pip syntax).
58-
59-
Returns
60-
-------
61-
tuple(str, str | None, bool, bool)
62-
``(version, primaryExtension, released_version, isPrerelease)``
63-
64-
- *version* – normalised version string ready to be passed to pip.
65-
- *primaryExtension* – package name when the caller used
66-
``extension==version`` syntax; ``None`` otherwise.
67-
- *released_version* – ``True`` when installing a PEP 440 release,
68-
``False`` when installing from a VCS URL.
69-
- *isPrerelease* – ``True`` when the PEP 440 version is a pre-release.
70-
71-
Raises
72-
------
73-
ValueError
74-
When the version string is empty or not a valid PEP 440 version and
75-
does not contain a recognised VCS URL.
55+
:returns: A 4-tuple ``(version, primaryExtension, released_version, isPrerelease)`` where
56+
57+
- *version* is the normalised version string ready to be passed to pip,
58+
- *primaryExtension* is the package name when the caller used
59+
``extension==version`` syntax, or ``None`` otherwise,
60+
- *released_version* is ``True`` when installing a PEP 440 release and
61+
``False`` when installing from a VCS URL,
62+
- *isPrerelease* is ``True`` when the PEP 440 version is a pre-release.
63+
64+
:rtype: tuple(str, str or None, bool, bool)
65+
:raises ValueError: When the version string is empty, or is not a valid PEP 440
66+
version and does not contain a recognised VCS URL.
7667
"""
7768
version = version.strip()
7869
if not version:
@@ -113,17 +104,10 @@ def _directory_label(version, released_version):
113104
(pip ``pkg @ url`` syntax) it is the URL part, stripped of any
114105
``#egg=...`` fragment and surrounding whitespace.
115106
116-
Parameters
117-
----------
118-
version:
119-
Normalised version string as returned by :func:`_normalise_version`.
120-
released_version:
121-
``True`` when *version* is a PEP 440 release string.
122-
123-
Returns
124-
-------
125-
str
126-
A filesystem-safe label derived from *version*.
107+
:param str version: Normalised version string as returned by :func:`_normalise_version`.
108+
:param bool released_version: ``True`` when *version* is a PEP 440 release string.
109+
:returns: A filesystem-safe label derived from *version*.
110+
:rtype: str
127111
"""
128112
if released_version:
129113
return version

0 commit comments

Comments
 (0)