#1014 Fix and reword some docstrings
Merged 10 months ago by mprahl. Opened 10 months ago by cqi.
cqi/fm-orchestrator docstring  into  master

@@ -70,12 +70,18 @@ 

          return query

  

      def _get_modules(self, name, stream, version=None, context=None, state="ready", strict=False):

-         """

-         :param module_info: str, mmd or module dict

-         :param strict: Normally this function returns None if no module can be

-                found.  If strict=True, then an UnprocessableEntity is raised.

- 

-         :return final list of module_info which pass repoclosure

+         """Query and return modules from MBS with specific info

+ 

+         :param str name: module's name.

+         :param str stream: module's stream.

+         :kwarg str version: module's version. Optional.

+         :kwarg str context: module's context. Optional.

+         :kwarg str state: module's state. Defaults to ``ready``.

+         :kwarg bool strict: Normally this function returns None if no module can be

+             found. If strict=True, then an UnprocessableEntity is raised.

+         :return: final list of module_info which pass repoclosure

+         :rtype: list[dict]

+         :raises UnprocessableEntity: if no modules are found and ``strict`` is True.

          """

          query = self._query_from_nsvc(name, stream, version, context, state)

          query["page"] = 1

@@ -197,7 +203,8 @@ 

  

      def get_module_build_dependencies(self, name=None, stream=None, version=None, context=None,

                                        mmd=None, strict=False):

-         """

+         """Get module's build dependencies defined in xmd/mbs section

+ 

          :param name: a module's name (required if mmd is not set)

          :param stream: a module's stream (required if mmd is not set)

          :param version: a module's version (required if mmd is not set)

@@ -205,7 +212,9 @@ 

          :param mmd: uses the mmd instead of the name, stream, version

          :param strict: Normally this function returns None if no module can be

              found.  If strict=True, then an UnprocessableEntity is raised.

-         :return dict with koji_tag as a key and ModuleMetadata object as value.

+         :return: a mapping containing buildrequire modules info in key/value pairs,

+             where key is koji_tag and value is the ModuleMetadata object.

+         :rtype: dict(str, :class:`ModuleMetadata`)

          """

  

          if mmd:

The convention I've seen is to do:

:kwarg str version: module's version

Actually, mmd.get_xmd()['mbs']['buildrequires'] contains the buildrequires and the buildrequires' requires.

I just use the recommended keyword in http://www.sphinx-doc.org/en/stable/domains.html#info-field-lists. However, I can update these to keep consistence in MBS.

It seems this function does not handle the buildrequires' requires. Anything I missed?

@mprahl BTW, is there any document to describe metadata in xmd/mbs section?

rebased onto e97df189ec31161628d370b676d1ccebbf51510e

10 months ago

@mprahl Docstring is updated to use kwarg. And any further comment to the docstring of get_module_build_dependencies?

This gets the module's buildrequires and the buildrequires' requires, not the requires.

rebased onto 85520fba07bed0b8f5db61a0e322edb647c3b9b8

10 months ago

@mprahl Sorry, I realized I used wrong word "runtime". I corrected it to "build dependencies". Please review again. Thanks.

"runtime dependent" => "buildrequire"

rebased onto e606840

10 months ago

Pull-Request has been merged by mprahl

10 months ago