Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-openqa_client for 
openSUSE:Factory checked in at 2025-09-22 16:39:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-openqa_client (Old)
 and      /work/SRC/openSUSE:Factory/.python-openqa_client.new.27445 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-openqa_client"

Mon Sep 22 16:39:41 2025 rev:6 rq:1306355 version:4.3.1

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-openqa_client/python-openqa_client.changes    
    2025-05-06 16:41:47.053076013 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-openqa_client.new.27445/python-openqa_client.changes
     2025-09-22 16:40:31.139527097 +0200
@@ -1,0 +2,8 @@
+Sun Sep 21 19:28:33 UTC 2025 - Dirk Müller <[email protected]>
+
+- update to 4.3.1:
+  * Fix `openqa_request` for table endpoints that now require
+    JSON
+  * Use Sequence instead of List type hints (KuxaBeast)
+
+-------------------------------------------------------------------

Old:
----
  python-openqa_client-4.3.0.tar.gz

New:
----
  python-openqa_client-4.3.1.tar.gz

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

Other differences:
------------------
++++++ python-openqa_client.spec ++++++
--- /var/tmp/diff_new_pack.VRFbLK/_old  2025-09-22 16:40:31.571545248 +0200
+++ /var/tmp/diff_new_pack.VRFbLK/_new  2025-09-22 16:40:31.575545416 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-openqa_client
 #
-# Copyright (c) 2025 SUSE LLC
+# Copyright (c) 2025 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define skip_python2 1
 Name:           python-openqa_client
-Version:        4.3.0
+Version:        4.3.1
 Release:        0
 Summary:        Python openQA client library
 License:        GPL-2.0-or-later

++++++ python-openqa_client-4.3.0.tar.gz -> python-openqa_client-4.3.1.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/openQA-python-client-4.3.0/.github/workflows/tox.yml 
new/openQA-python-client-4.3.1/.github/workflows/tox.yml
--- old/openQA-python-client-4.3.0/.github/workflows/tox.yml    2025-04-01 
01:47:00.000000000 +0200
+++ new/openQA-python-client-4.3.1/.github/workflows/tox.yml    2025-09-06 
03:46:18.000000000 +0200
@@ -24,11 +24,11 @@
             python-version: "3.6"
 
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
         with:
           fetch-depth: 0
       - name: Set up Python ${{ matrix.python-version }}
-        uses: actions/[email protected]
+        uses: actions/[email protected]
         with:
           python-version: ${{ matrix.python-version }}
       - name: Install dependencies
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/openQA-python-client-4.3.0/CHANGELOG.md 
new/openQA-python-client-4.3.1/CHANGELOG.md
--- old/openQA-python-client-4.3.0/CHANGELOG.md 2025-04-01 01:47:00.000000000 
+0200
+++ new/openQA-python-client-4.3.1/CHANGELOG.md 2025-09-06 03:46:18.000000000 
+0200
@@ -1,5 +1,10 @@
 ## Changelog
 
+### 4.3.1 - 2025-09-05
+
+1.  Fix `openqa_request` for table endpoints that now require JSON
+2.  Use Sequence instead of List type hints (KuxaBeast)
+
 ### 4.3.0 - 2025-03-31
 
 1.  Add new `get_latest_build` method (asmorodskyi)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/openQA-python-client-4.3.0/README.md 
new/openQA-python-client-4.3.1/README.md
--- old/openQA-python-client-4.3.0/README.md    2025-04-01 01:47:00.000000000 
+0200
+++ new/openQA-python-client-4.3.1/README.md    2025-09-06 03:46:18.000000000 
+0200
@@ -25,6 +25,14 @@
     params['BUILD'] = '22_Beta_TC2'
     print(cl.openqa_request('POST', 'isos', params))
 
+You can use `data=` or `json=` instead of `params=`. `params=` adds
+query parameters to the request. `data=` sends
+`application/x-www-form-urlencoded` data; most endpoints accept this
+and it can avoid query string character limits for long requests.
+`json=` sends `application/json` encoded data; this is required for
+`POST` or `PUT` requests to the `test_suites`, `machines` and
+`products` endpoints.
+
 All methods other than `GET` require authentication. This client uses
 the same configuration file format as the reference (perl) client in
 openQA itself. Configuration will be read from `/etc/openqa/client.conf`
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/openQA-python-client-4.3.0/pyproject.toml 
new/openQA-python-client-4.3.1/pyproject.toml
--- old/openQA-python-client-4.3.0/pyproject.toml       2025-04-01 
01:47:00.000000000 +0200
+++ new/openQA-python-client-4.3.1/pyproject.toml       2025-09-06 
03:46:18.000000000 +0200
@@ -1,6 +1,6 @@
 [project]
 name = "openqa_client"
-version = "4.3.0"
+version = "4.3.1"
 authors = [
     { name="Adam Williamson", email="[email protected]" },
 ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/openQA-python-client-4.3.0/setup.py 
new/openQA-python-client-4.3.1/setup.py
--- old/openQA-python-client-4.3.0/setup.py     2025-04-01 01:47:00.000000000 
+0200
+++ new/openQA-python-client-4.3.1/setup.py     2025-09-06 03:46:18.000000000 
+0200
@@ -26,7 +26,7 @@
 
 setup(
     name="openqa_client",
-    version="4.3.0",
+    version="4.3.1",
     description="Python client library for openQA API",
     author="Adam Williamson",
     author_email="[email protected]",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/openQA-python-client-4.3.0/src/openqa_client/__init__.py 
new/openQA-python-client-4.3.1/src/openqa_client/__init__.py
--- old/openQA-python-client-4.3.0/src/openqa_client/__init__.py        
2025-04-01 01:47:00.000000000 +0200
+++ new/openQA-python-client-4.3.1/src/openqa_client/__init__.py        
2025-09-06 03:46:18.000000000 +0200
@@ -17,4 +17,4 @@
 
 """Python client library for openQA."""
 
-__version__ = "4.3.0"
+__version__ = "4.3.1"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/openQA-python-client-4.3.0/src/openqa_client/client.py 
new/openQA-python-client-4.3.1/src/openqa_client/client.py
--- old/openQA-python-client-4.3.0/src/openqa_client/client.py  2025-04-01 
01:47:00.000000000 +0200
+++ new/openQA-python-client-4.3.1/src/openqa_client/client.py  2025-09-06 
03:46:18.000000000 +0200
@@ -25,7 +25,17 @@
 import logging
 import time
 import sys
-from typing import Any, Callable, Dict, List, MutableMapping, NoReturn, 
Optional, Union, overload
+from typing import (
+    Any,
+    Callable,
+    Dict,
+    MutableMapping,
+    NoReturn,
+    Optional,
+    Sequence,
+    Union,
+    overload,
+)
 
 from urllib.parse import urlparse, urlunparse
 import configparser
@@ -249,11 +259,16 @@
         retries: Optional[int] = None,
         wait: Optional[int] = None,
         data: Any = None,
+        json: Any = None,
     ):
         """Perform a typical openQA request, with an API path and some
         optional parameters. Use the data parameter instead of params if you
         need to pass lots of settings. It will post
-        application/x-www-form-urlencoded data.
+        application/x-www-form-urlencoded data. Use the json parameter if you
+        are POSTing or PUTing to one of the endpoints that requires a
+        JSON-encoded request - test_suites, machines, or products. It will
+        send a request with JSON data and the required
+        Content-Type: application/json header.
 
         If either params or data is a dictionary and contains the key 
"settings"
         (which is a list of dictionaries), then the entries of "settings"
@@ -275,10 +290,10 @@
         # groups, products, etc. that take a settings parameter, then this
         # settings parameter gets returned to us as a list like this:
         # [{"key": "varname", "value": "var_value"}]
-        # But when we sent the reply back, we must send these settings in the
-        # "top level" payload object like this:
-        # "settings[varname]": "var_value"
-        for payload in (params, data):
+        # But when we sent the reply back, we must send these settings in a
+        # simple dict like this:
+        # {"varname": "var_value"}
+        for payload in (params, data, json):
             if (
                 payload is not None
                 and isinstance(payload, dict)
@@ -286,8 +301,7 @@
                 and isinstance(payload["settings"], list)
             ):
                 settings = payload.pop("settings")
-                for setting in settings:
-                    payload[f"settings[{setting.get('key')}]"] = 
setting["value"]
+                payload["settings"] = {setdict["key"]: setdict["value"] for 
setdict in settings}
 
         # As with the reference client, we assume relative paths are
         # relative to /api/v1.
@@ -295,10 +309,10 @@
             path = f"/api/v1/{path}"
 
         url = f"{self.baseurl}{path}"
-        req = requests.Request(method=method.upper(), url=url, params=params, 
data=data)
+        req = requests.Request(method=method.upper(), url=url, params=params, 
data=data, json=json)
         return self.do_request(req, retries=retries, wait=wait, parse=True)
 
-    def find_clones(self, jobs: List[Job]) -> List[Job]:
+    def find_clones(self, jobs: Sequence[Job]) -> Sequence[Job]:
         """Given an iterable of job dicts, this will see if any of the
         jobs were cloned, and replace any that were cloned with the dicts
         of their clones, returning a list. It recurses - so if 3 was
@@ -331,15 +345,18 @@
 
     @overload
     def get_jobs(
-        self, jobs: Optional[List[Union[str, int]]], build: Optional[str], 
filter_dupes: bool
+        self,
+        jobs: Optional[Sequence[Union[str, int]]],
+        build: Optional[str],
+        filter_dupes: bool,
     ): ...  # pragma: no cover
 
     def get_jobs(
         self,
-        jobs: Optional[List[Union[str, int]]] = None,
+        jobs: Optional[Sequence[Union[str, int]]] = None,
         build: Optional[str] = None,
         filter_dupes: bool = True,
-    ):
+    ) -> Sequence[Union[Job, dict]]:
         """Get job dicts. Either 'jobs' or 'build' must be specified.
         'jobs' should be iterable of job IDs (string or int). 'build'
         should be an openQA BUILD to get all the jobs for. If both are
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/openQA-python-client-4.3.0/tests/test_client.py 
new/openQA-python-client-4.3.1/tests/test_client.py
--- old/openQA-python-client-4.3.0/tests/test_client.py 2025-04-01 
01:47:00.000000000 +0200
+++ new/openQA-python-client-4.3.1/tests/test_client.py 2025-09-06 
03:46:18.000000000 +0200
@@ -259,6 +259,21 @@
         assert fakedo.call_args[0][1].params == {}
         assert fakedo.call_args[1]["retries"] == 2
         assert fakedo.call_args[1]["wait"] == 5
+        # check requests with data work
+        fakedo.reset_mock()
+        client.openqa_request("get", "jobs", data=params)
+        prepped = fakedo.call_args[0][1].prepare()
+        assert prepped.body == "id=1"
+        assert prepped.headers == {
+            "Content-Length": "4",
+            "Content-Type": "application/x-www-form-urlencoded",
+        }
+        # check requests with json work
+        fakedo.reset_mock()
+        client.openqa_request("get", "jobs", json=params)
+        prepped = fakedo.call_args[0][1].prepare()
+        assert prepped.body == b'{"id": "1"}'
+        assert prepped.headers == {"Content-Length": "11", "Content-Type": 
"application/json"}
 
     @mock.patch("time.sleep", autospec=True)
     @mock.patch(
@@ -313,8 +328,10 @@
         assert fakedo.call_args[0][1].params == {
             "id": "1",
             "name": "some_suite",
-            "settings[PUBLISH_HDD_1]": 
"%DISTRI%-%VERSION%-%ARCH%-%BUILD%.qcow2",
-            "settings[START_AFTER_TEST]": "fedora_rawhide_qcow2",
+            "settings": {
+                "PUBLISH_HDD_1": "%DISTRI%-%VERSION%-%ARCH%-%BUILD%.qcow2",
+                "START_AFTER_TEST": "fedora_rawhide_qcow2",
+            },
         }
         # check requests with a string payload
         fakedo.reset_mock()

Reply via email to