Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-osc-tiny for openSUSE:Factory 
checked in at 2022-10-08 01:23:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-osc-tiny (Old)
 and      /work/SRC/openSUSE:Factory/.python-osc-tiny.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-osc-tiny"

Sat Oct  8 01:23:31 2022 rev:22 rq:1008858 version:0.7.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-osc-tiny/python-osc-tiny.changes  
2022-09-19 16:03:47.586223507 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-osc-tiny.new.2275/python-osc-tiny.changes    
    2022-10-08 01:23:36.406006966 +0200
@@ -1,0 +2,14 @@
+Fri Oct  7 14:12:34 UTC 2022 - Andreas Hasenkopf <ahasenk...@suse.com>
+
+- Release 0.7.5
+  * Workaround for another inconsistency in parameter handling in OBS API
+
+-------------------------------------------------------------------
+Wed Oct  5 08:51:51 UTC 2022 - Andreas Hasenkopf <ahasenk...@suse.com>
+
+- Release 0.7.4
+  * Deprecated `Project.get_files` (fixes #101)
+    (i.e. yet another workaround for an inconsistent server API)
+  * Updated documentation for `Package.cmd` method
+
+-------------------------------------------------------------------

Old:
----
  osc-tiny-0.7.3.tar.gz

New:
----
  osc-tiny-0.7.5.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-osc-tiny.spec ++++++
--- /var/tmp/diff_new_pack.2i7764/_old  2022-10-08 01:23:37.210008810 +0200
+++ /var/tmp/diff_new_pack.2i7764/_new  2022-10-08 01:23:37.214008819 +0200
@@ -19,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define skip_python2 1
 Name:           python-osc-tiny
-Version:        0.7.3
+Version:        0.7.5
 Release:        0
 Summary:        Client API for openSUSE BuildService
 License:        MIT

++++++ osc-tiny-0.7.3.tar.gz -> osc-tiny-0.7.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-tiny-0.7.3/PKG-INFO new/osc-tiny-0.7.5/PKG-INFO
--- old/osc-tiny-0.7.3/PKG-INFO 2022-09-19 14:08:24.194599400 +0200
+++ new/osc-tiny-0.7.5/PKG-INFO 2022-10-07 16:09:26.133109000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: osc-tiny
-Version: 0.7.3
+Version: 0.7.5
 Summary: Client API for openSUSE BuildService
 Home-page: http://github.com/crazyscientist/osc-tiny
 Download-URL: http://github.com/crazyscientist/osc-tiny/tarball/master
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-tiny-0.7.3/osc_tiny.egg-info/PKG-INFO 
new/osc-tiny-0.7.5/osc_tiny.egg-info/PKG-INFO
--- old/osc-tiny-0.7.3/osc_tiny.egg-info/PKG-INFO       2022-09-19 
14:08:24.000000000 +0200
+++ new/osc-tiny-0.7.5/osc_tiny.egg-info/PKG-INFO       2022-10-07 
16:09:26.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: osc-tiny
-Version: 0.7.3
+Version: 0.7.5
 Summary: Client API for openSUSE BuildService
 Home-page: http://github.com/crazyscientist/osc-tiny
 Download-URL: http://github.com/crazyscientist/osc-tiny/tarball/master
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-tiny-0.7.3/osctiny/__init__.py 
new/osc-tiny-0.7.5/osctiny/__init__.py
--- old/osc-tiny-0.7.3/osctiny/__init__.py      2022-09-19 14:08:14.000000000 
+0200
+++ new/osc-tiny-0.7.5/osctiny/__init__.py      2022-10-07 16:09:17.000000000 
+0200
@@ -6,4 +6,4 @@
 
 __all__ = ['Osc', 'bs_requests', 'buildresults', 'comments', 'packages',
            'projects', 'search', 'users']
-__version__ = "0.7.3"
+__version__ = "0.7.5"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-tiny-0.7.3/osctiny/extensions/packages.py 
new/osc-tiny-0.7.5/osctiny/extensions/packages.py
--- old/osc-tiny-0.7.3/osctiny/extensions/packages.py   2022-09-19 
14:08:14.000000000 +0200
+++ new/osc-tiny-0.7.5/osctiny/extensions/packages.py   2022-10-07 
16:09:17.000000000 +0200
@@ -19,7 +19,27 @@
     base_path = "/source"
     new_package_meta_templ = "<package><title/><description/></package>"
 
-    def get_list(self, project: str, deleted: bool = False, expand: bool = 
True):
+    @staticmethod
+    def cleanup_params(**params) -> dict:
+        """
+        Prepare query parameters
+
+        The build service is inconsistent in its validation of parameters. In 
most cases it does not
+        complain about excess parameters, in some it complains about 
unexpected ones.
+
+        :param params: Query parameters
+        :return: The original dictionary of query parameters or a subset of it
+
+        .. versionadded::0.7.4
+        """
+        if params.get("view", None) == "info":
+            # The 'info' view is strict about parameter validation
+            return {key: value for key, value in params.items()
+                    if key in ["parse", "arch", "repository", "view"]}
+
+        return params
+
+    def get_list(self, project: str, deleted: bool = False, expand: bool = 
True, **params):
         """
         Get packages from project
 
@@ -29,17 +49,20 @@
         .. versionadded:: 0.7.0
             Parameter ``expand``
 
+        .. versionadded:: 0.7.4
+            Parameter ``params``
+
         :param project: name of project
         :param deleted: Show deleted packages instead
         :param expand: Include inherited packages and their project of origin
         :return: Objectified XML element
         :rtype: lxml.objectify.ObjectifiedElement
         """
-        params = {"deleted": deleted, "expand": expand}
+        params.update({"deleted": deleted, "expand": expand})
         response = self.osc.request(
             url=urljoin(self.osc.url, "{}/{}".format(self.base_path, project)),
             method="GET",
-            params=params
+            params=self.cleanup_params(**params)
         )
 
         return self.osc.get_objectified_xml(response)
@@ -142,7 +165,7 @@
                 "{}/{}/{}".format(self.base_path, project, package)
             ),
             method="GET",
-            params=params
+            params=self.cleanup_params(**params)
         )
 
         return self.osc.get_objectified_xml(response)
@@ -314,7 +337,8 @@
 
         .. note:: Command ``diff``
 
-            The ``diff`` command returns plain text instaed of XML!
+            The ``diff`` command returns plain text, instead of XML, by 
default!
+            To get XML, pass the ``view='xml'`` param.
 
         :param project: name of project
         :param package: name of package
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-tiny-0.7.3/osctiny/extensions/projects.py 
new/osc-tiny-0.7.5/osctiny/extensions/projects.py
--- old/osc-tiny-0.7.3/osctiny/extensions/projects.py   2022-09-19 
14:08:14.000000000 +0200
+++ new/osc-tiny-0.7.5/osctiny/extensions/projects.py   2022-10-07 
16:09:17.000000000 +0200
@@ -165,20 +165,23 @@
         :param kwargs: More keyword arguments for API call
         :return: Objectified XML element
         :rtype: lxml.objectify.ObjectifiedElement
+
+        .. deprecated:: 0.7.4
+
+            Use :py:meth:`osctiny.extensions.packages.Package.get_files` or
+            :py:meth:`osctiny.extensions.packages.Package.get_list` instead.
+
+            The API URL used by this method is (depending on the value of 
``directory``) identical
+            to the one used by the above two methods.
         """
-        kwargs["meta"] = meta
         if rev:
             kwargs["rev"] = str(rev)
-        response = self.osc.request(
-            url=urljoin(
-                self.osc.url,
-                "{}/{}/{}".format(self.base_path, project, directory)
-            ),
-            method="GET",
-            params=kwargs
-        )
 
-        return self.osc.get_objectified_xml(response)
+        if not directory:
+            return self.osc.packages.get_list(project=project, **kwargs)
+
+        kwargs["meta"] = meta
+        return self.osc.packages.get_files(project=project, package=directory, 
**kwargs)
 
     def get_attribute(self, project, attribute=None):
         """
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osc-tiny-0.7.3/setup.py new/osc-tiny-0.7.5/setup.py
--- old/osc-tiny-0.7.3/setup.py 2022-09-19 14:08:14.000000000 +0200
+++ new/osc-tiny-0.7.5/setup.py 2022-10-07 16:09:17.000000000 +0200
@@ -26,7 +26,7 @@
 
 setup(
     name='osc-tiny',
-    version='0.7.3',
+    version='0.7.5',
     description='Client API for openSUSE BuildService',
     long_description=long_description,
     long_description_content_type="text/markdown",

Reply via email to