Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-rpcq for openSUSE:Factory 
checked in at 2021-01-19 16:02:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-rpcq (Old)
 and      /work/SRC/openSUSE:Factory/.python-rpcq.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-rpcq"

Tue Jan 19 16:02:50 2021 rev:3 rq:864169 version:3.7.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-rpcq/python-rpcq.changes  2020-11-29 
12:30:16.642114392 +0100
+++ /work/SRC/openSUSE:Factory/.python-rpcq.new.28504/python-rpcq.changes       
2021-01-19 16:03:16.811478261 +0100
@@ -1,0 +2,11 @@
+Sat Jan 16 07:47:21 UTC 2021 - andy great <andythe_gr...@pm.me>
+
+- Update to version 3.7.0.
+  * Add mnio_connections section
+  * Import messages and core_messages in rpcq module init
+  * Allow None for optional bools
+  * Correctly report timeout in timeout error messages
+    Fix for breaking change in upstream cl-messagepack 
+
+
+-------------------------------------------------------------------

Old:
----
  rpcq-3.6.0.tar.gz

New:
----
  rpcq-3.7.0.tar.gz

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

Other differences:
------------------
++++++ python-rpcq.spec ++++++
--- /var/tmp/diff_new_pack.Pld10z/_old  2021-01-19 16:03:17.787479729 +0100
+++ /var/tmp/diff_new_pack.Pld10z/_new  2021-01-19 16:03:17.787479729 +0100
@@ -20,7 +20,7 @@
 %define skip_python2 1
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-rpcq
-Version:        3.6.0
+Version:        3.7.0
 Release:        0
 Summary:        The RPC framework and message specification for Rigetti QCS
 License:        Apache-2.0

++++++ rpcq-3.6.0.tar.gz -> rpcq-3.7.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rpcq-3.6.0/VERSION.txt new/rpcq-3.7.0/VERSION.txt
--- old/rpcq-3.6.0/VERSION.txt  2020-11-25 21:19:55.000000000 +0100
+++ new/rpcq-3.7.0/VERSION.txt  2020-12-29 21:08:50.000000000 +0100
@@ -1 +1 @@
-3.6.0
+3.7.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rpcq-3.6.0/rpcq/__init__.py 
new/rpcq-3.7.0/rpcq/__init__.py
--- old/rpcq-3.6.0/rpcq/__init__.py     2020-11-25 21:19:55.000000000 +0100
+++ new/rpcq-3.7.0/rpcq/__init__.py     2020-12-29 21:08:50.000000000 +0100
@@ -1,3 +1,9 @@
 from rpcq._client import Client, ClientAuthConfig
 from rpcq._server import Server, ServerAuthConfig
+# These are imported so that the corresponding data classes are
+# registered whenever rpcq is imported. Without which one would have
+# to import the messages and core_messages modules directly before
+# using, e.g., from_json / to_json.
+from rpcq import messages
+from rpcq import core_messages
 from rpcq.version import __version__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rpcq-3.6.0/rpcq/core_messages.py 
new/rpcq-3.7.0/rpcq/core_messages.py
--- old/rpcq-3.6.0/rpcq/core_messages.py        2020-11-25 21:19:55.000000000 
+0100
+++ new/rpcq-3.7.0/rpcq/core_messages.py        2020-12-29 21:08:50.000000000 
+0100
@@ -507,6 +507,20 @@
 
 
 @dataclass(eq=False, repr=False)
+class MNIOConnection(Message):
+    """
+    Description of one side of an MNIO connection between two Tsunamis.
+    """
+
+    port: int
+    """The physical Tsunami MNIO port, indexed from 0,
+          where this connection originates."""
+
+    destination: str
+    """The Tsunami where this connection terminates."""
+
+
+@dataclass(eq=False, repr=False)
 class Program(Message):
     """
     The dynamic aspects (waveforms, readout kernels, scheduled
@@ -617,6 +631,9 @@
     instrument_type: str
     """Instrument type (driver class name)."""
 
+    mnio_connections: Dict[str, MNIOConnection] = field(default_factory=dict)
+    """MNIO network connections between Tsunami instruments"""
+
     channels: Dict[str, Any] = field(default_factory=dict)
     """Mapping of channel labels to channel settings"""
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rpcq-3.6.0/src/core-messages.lisp 
new/rpcq-3.7.0/src/core-messages.lisp
--- old/rpcq-3.6.0/src/core-messages.lisp       2020-11-25 21:19:55.000000000 
+0100
+++ new/rpcq-3.7.0/src/core-messages.lisp       2020-12-29 21:08:50.000000000 
+0100
@@ -624,6 +624,21 @@
   :documentation "Specify an acquisition on an rx-frame as well as the\
       filters to apply.")
 
+(defmessage |MNIOConnection| ()
+    (
+     (|port|
+      :documentation "The physical Tsunami MNIO port, indexed from 0, \
+          where this connection originates."
+      :type :integer
+      :required t)
+
+     (|destination|
+      :documentation "The Tsunami where this connection terminates."
+      :type :string
+      :required t))
+
+  :documentation "Description of one side of an MNIO connection between two 
Tsunamis.")
+
 (defmessage |Program| ()
     (
      (|waveforms|
@@ -763,6 +778,11 @@
       :type :string
       :required t)
 
+     (|mnio_connections|
+      :documentation "MNIO network connections between Tsunami instruments"
+      :type (:map :string -> |MNIOConnection|)
+      :required nil)
+
      (|channels|
       :documentation "Mapping of channel labels to channel settings"
       :type (:map :string -> :any)
@@ -878,8 +898,7 @@
           True  - Relay closed, allows flux current to flow.\
           False - Relay open, no flux current can flow."
       :type :bool
-      :required nil
-      :default nil))
+      :required nil))
 
   :documentation "Configuration for a single QFD Channel.")
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rpcq-3.6.0/src/package.lisp 
new/rpcq-3.7.0/src/package.lisp
--- old/rpcq-3.6.0/src/package.lisp     2020-11-25 21:19:55.000000000 +0100
+++ new/rpcq-3.7.0/src/package.lisp     2020-12-29 21:08:50.000000000 +0100
@@ -52,4 +52,5 @@
            #:rpc-protocol-error
            #:rpc-protocol-error-id
            #:rpc-protocol-error-object
+           #:optional-bool
            ))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rpcq-3.6.0/src/rpcq-python.lisp 
new/rpcq-3.7.0/src/rpcq-python.lisp
--- old/rpcq-3.6.0/src/rpcq-python.lisp 2020-11-25 21:19:55.000000000 +0100
+++ new/rpcq-3.7.0/src/rpcq-python.lisp 2020-12-29 21:08:50.000000000 +0100
@@ -47,9 +47,10 @@
   (let ((*python-types* *python-instance-check-types*))
     (python-type field-type)))
 
-(defun python-argspec-default (field-type default)
-  "Translate DEFAULT values for immutable objects of a given
-FIELD-TYPE to python."
+(defun python-argspec-default (field-type default &optional defaultp)
+  "Translate DEFAULT values for immutable objects of a given FIELD-TYPE to 
python.
+
+DEFAULTP indicates whether DEFAULT has a value of NIL because NIL was provided 
in the DEFMESSAGE (T), or because it was missing in the DEFMESSAGE (NIL)."
   (typecase field-type
     ((eql :string)
      (if default
@@ -60,9 +61,10 @@
          (format nil "b~S" (to-string default))
          "None"))
     ((eql :bool)
-     (if default
-         "True"
-         "False"))
+     (cond
+       ((not defaultp) "None")
+       (default        "True")
+       (t              "False")))
     ((eql :integer)
      (if default
          (format nil "~d" default)
@@ -207,11 +209,10 @@
                    (required (getf field-settings ':required))
                    (documentation (getf field-settings ':documentation))
                    (defaultp (member ':default field-settings))
-                   (default (or (getf field-settings ':default)))
+                   (default (getf field-settings ':default))
                    (deprecated (getf field-settings ':deprecated))
                    (deprecates (getf field-settings ':deprecates))
                    (deprecated-by (getf field-settings ':deprecated-by)))
-
               ;; optional fields automatically acquire a NIL default
               (unless (or required defaultp)
                 (setf default nil)
@@ -228,7 +229,7 @@
                    (push (list slot-name nil required "None") 
deprecated-fields)))
                 ;; recipe for a deprecating slot
                 (deprecates
-                 (let ((definite-default (python-argspec-default type 
default)))
+                 (let ((definite-default (python-argspec-default type default 
(member ':default field-settings))))
                    (python-out `(("    ~a: ~a = ~a"      ,(symbol-name 
slot-name)
                                                          
,(python-maybe-optional-typing-type type t)
                                                          ,definite-default)
@@ -238,7 +239,8 @@
                 (defaultp
                  (python-out `(("    ~a: ~a = ~a"       ,(symbol-name 
slot-name)
                                                         
,(python-maybe-optional-typing-type type required)
-                                                        
,(python-argspec-default type default))
+                                                        
,(python-argspec-default type default
+                                                                               
  (member ':default field-settings)))
                                ("    \"\"\"~a\"\"\""    ,documentation))))
                 ;; recipe for a slot otherwise
                 (t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rpcq-3.6.0/src/rpcq.lisp new/rpcq-3.7.0/src/rpcq.lisp
--- old/rpcq-3.6.0/src/rpcq.lisp        2020-11-25 21:19:55.000000000 +0100
+++ new/rpcq-3.7.0/src/rpcq.lisp        2020-12-29 21:08:50.000000000 +0100
@@ -176,6 +176,12 @@
       (stream
        (%deserialize (messagepack:decode-stream payload))))))
 
+(deftype optional-bool ()
+  "An optional boolean value includes the extra None value, specific to 
Python."
+  `(or null
+       boolean
+       (eql :none)))
+
 (defun slot-type-and-initform (field-type required default)
   "Translate a FIELD-TYPE to a Lisp type and initform taking into account
 whether the field is REQUIRED and a specified DEFAULT value.
@@ -216,6 +222,7 @@
     - if a value is not provided, then a fallback value is used
     - you can explicitly pass None/null/NIL for this field
 "
+  (check-type required optional-bool)
   (cond
 
     ;; handle :string :integer :float :bool :bytes
@@ -226,7 +233,7 @@
                               :bytes (simple-array (unsigned-byte 8))
                               :integer fixnum
                               :float double-float
-                              :bool boolean
+                              :bool optional-bool
                               :any t)
                             field-type))
           ;; make sure the default value (if defined) is coerced
@@ -317,6 +324,12 @@
                                      "-"
                                      (snake-to-kebab (symbol-name slot-name))))
 
+           (defaultify (default defaultp field-type)
+             (cond
+              (defaultp default)
+              ((eql field-type ':bool) ':none)
+              (t nil)))
+
            (make-slot-spec (field-spec)
              (let*
                  ((slot-name (car field-spec))
@@ -325,7 +338,9 @@
                   (required (getf field-settings ':required))
                   (documentation (getf field-settings ':documentation))
                   (defaultp (member ':default field-settings))
-                  (default (getf field-settings ':default))
+                  (default (defaultify (getf field-settings ':default)
+                                       defaultp
+                                       field-type))
                   (deprecated (getf field-settings ':deprecated))
                   (deprecates (getf field-settings ':deprecates))
                   (deprecated-by (getf field-settings ':deprecated-by)))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rpcq-3.6.0/src/server.lisp 
new/rpcq-3.7.0/src/server.lisp
--- old/rpcq-3.6.0/src/server.lisp      2020-11-25 21:19:55.000000000 +0100
+++ new/rpcq-3.7.0/src/server.lisp      2020-12-29 21:08:50.000000000 +0100
@@ -220,19 +220,7 @@
                                (finish-output *error-output*)
                                (trivial-backtrace:print-backtrace c :output 
*error-output*)))))
                  (apply f (concatenate 'list positional-args 
kwargs-as-plist)))))
-        (let* ((client-timeout (|RPCRequest-client_timeout| request))
-               ;; TODO A timeout of NIL is supposed to signal an
-               ;; indefinite timeout. The same is signalled by 0,
-               ;; which leads to the extra logic below and means
-               ;; subtle bugs may creep in.  Can we be strict about
-               ;; NIL vs 0?  I mean just look at this mess.
-               (timeout (if (and client-timeout
-                                 (or (null timeout)
-                                     (zerop timeout)
-                                     (> timeout client-timeout)))
-                            client-timeout
-                            timeout))
-               (result (if timeout
+        (let* ((result (if timeout
                            (bt:with-timeout (timeout)
                              (apply-handler))
                            (apply-handler))))
@@ -267,7 +255,19 @@
                             (|RPCRequest-id| request)
                             (|RPCRequest-method| request))
 
-      (let ((reply (%process-request request dispatch-table timeout debug)))
+      (let* ((client-timeout (|RPCRequest-client_timeout| request))
+             ;; TODO A timeout of NIL is supposed to signal an
+             ;; indefinite timeout. The same is signalled by 0,
+             ;; which leads to the extra logic below and means
+             ;; subtle bugs may creep in.  Can we be strict about
+             ;; NIL vs 0?  I mean just look at this mess.
+             (timeout (if (and client-timeout
+                               (or (null timeout)
+                                   (zerop timeout)
+                                   (> timeout client-timeout)))
+                          client-timeout
+                          timeout))
+             (reply (%process-request request dispatch-table timeout debug)))
         (log-completion-message logger request reply start-time)
         (handler-case
             (%push-raw-request receiver identity empty-frame (serialize reply))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rpcq-3.6.0/src-tests/suite.lisp 
new/rpcq-3.7.0/src-tests/suite.lisp
--- old/rpcq-3.6.0/src-tests/suite.lisp 2020-11-25 21:19:55.000000000 +0100
+++ new/rpcq-3.7.0/src-tests/suite.lisp 2020-12-29 21:08:50.000000000 +0100
@@ -50,14 +50,22 @@
         :required t
         :default "a string"
         :documentation "String docs.")
-
        (flt
         :type :float
         :required t
         :default 0.0
-        :documentation "A float."))
-
-
+        :documentation "A float.")
+       (optional-bool-none
+        :type :bool
+        :required nil)
+       (optional-bool-false
+        :type :bool
+        :required nil
+        :default nil)
+       (optional-bool-true
+        :type :bool
+        :required nil
+        :default t))
     :documentation "Test message")
 
   (let ((m (make-instance 'my-msg :required-int 5)))
@@ -66,7 +74,13 @@
     (is (string= (gethash "yo" (my-msg-optional-map m)) "working"))
     (is (= (length (gethash "suite" rpcq::*messages*)) 1))
     (is (typep (my-msg-flt m) 'double-float))
-    (is (string= (my-msg-str m) "a string"))))
+    (is (string= (my-msg-str m) "a string"))
+    (is (typep (my-msg-optional-bool-none m) 'optional-bool))
+    (is (eql (my-msg-optional-bool-none m) ':none))
+    (is (typep (my-msg-optional-bool-true m) 'optional-bool))
+    (is (my-msg-optional-bool-true m))
+    (is (typep (my-msg-optional-bool-false m) 'optional-bool))
+    (is (null (my-msg-optional-bool-false m)))))
 
 (deftest test-prepare-rpc-call-args ()
   (loop
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rpcq-3.6.0/src-tests/test-rpc.lisp 
new/rpcq-3.7.0/src-tests/test-rpc.lisp
--- old/rpcq-3.6.0/src-tests/test-rpc.lisp      2020-11-25 21:19:55.000000000 
+0100
+++ new/rpcq-3.7.0/src-tests/test-rpc.lisp      2020-12-29 21:08:50.000000000 
+0100
@@ -261,7 +261,7 @@
                                             (let ((messagepack:*extended-types*
                                                     
(messagepack:define-extension-types
                                                         '(0 
deserialize-bomb))))
-                                              (rpcq::serialize (make-instance 
'deserialize-bomb :id 9)))))
+                                              (rpcq::serialize (make-instance 
'deserialize-bomb 'messagepack-sym:id 9)))))
              (is (search "Threw generic error before RPC call"
                          (get-output-stream-string log-stream))))
         ;; kill the server thread

Reply via email to