Hello community,

here is the log from the commit of package python3-simplejson for 
openSUSE:Factory checked in at 2016-11-03 12:57:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-simplejson (Old)
 and      /work/SRC/openSUSE:Factory/.python3-simplejson.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python3-simplejson"

Changes:
--------
--- /work/SRC/openSUSE:Factory/python3-simplejson/python3-simplejson.changes    
2016-10-26 21:47:20.000000000 +0200
+++ 
/work/SRC/openSUSE:Factory/.python3-simplejson.new/python3-simplejson.changes   
    2016-11-03 12:58:00.000000000 +0100
@@ -1,0 +2,7 @@
+Sat Oct 29 16:46:24 UTC 2016 - a...@gmx.de
+
+- update to version 3.10.0:
+  * Add RawJSON class to allow a faster path for already encoded JSON.
+    https://github.com/simplejson/simplejson/pull/143
+
+-------------------------------------------------------------------

Old:
----
  simplejson-3.9.0.tar.gz

New:
----
  simplejson-3.10.0.tar.gz

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

Other differences:
------------------
++++++ python3-simplejson.spec ++++++
--- /var/tmp/diff_new_pack.yh9qBX/_old  2016-11-03 12:58:01.000000000 +0100
+++ /var/tmp/diff_new_pack.yh9qBX/_new  2016-11-03 12:58:01.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           python3-simplejson
-Version:        3.9.0
+Version:        3.10.0
 Release:        0
 Url:            http://github.com/simplejson/simplejson
 Summary:        Simple, fast, extensible JSON encoder/decoder for Python

++++++ simplejson-3.9.0.tar.gz -> simplejson-3.10.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/simplejson-3.9.0/CHANGES.txt 
new/simplejson-3.10.0/CHANGES.txt
--- old/simplejson-3.9.0/CHANGES.txt    2016-10-21 13:37:05.000000000 +0200
+++ new/simplejson-3.10.0/CHANGES.txt   2016-10-28 11:45:34.000000000 +0200
@@ -1,3 +1,8 @@
+Version 3.10.0 released 2016-10-28
+
+* Add RawJSON class to allow a faster path for already encoded JSON.
+  https://github.com/simplejson/simplejson/pull/143
+
 Version 3.9.0 released 2016-10-21
 
 * Workaround for bad behavior in string subclasses
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/simplejson-3.9.0/PKG-INFO 
new/simplejson-3.10.0/PKG-INFO
--- old/simplejson-3.9.0/PKG-INFO       2016-10-21 13:38:01.000000000 +0200
+++ new/simplejson-3.10.0/PKG-INFO      2016-10-28 12:01:25.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: simplejson
-Version: 3.9.0
+Version: 3.10.0
 Summary: Simple, fast, extensible JSON encoder/decoder for Python
 Home-page: http://github.com/simplejson/simplejson
 Author: Bob Ippolito
@@ -41,7 +41,6 @@
         is not maintained, and should only be used as a last resort.
         
         .. _python2.2: https://github.com/simplejson/simplejson/tree/python2.2
-        https://github.com/simplejson/simplejson/tree/python2.2
         
 Platform: any
 Classifier: Development Status :: 5 - Production/Stable
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/simplejson-3.9.0/README.rst 
new/simplejson-3.10.0/README.rst
--- old/simplejson-3.9.0/README.rst     2016-10-21 04:58:09.000000000 +0200
+++ new/simplejson-3.10.0/README.rst    2016-10-21 14:48:19.000000000 +0200
@@ -33,4 +33,3 @@
 is not maintained, and should only be used as a last resort.
 
 .. _python2.2: https://github.com/simplejson/simplejson/tree/python2.2
-https://github.com/simplejson/simplejson/tree/python2.2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/simplejson-3.9.0/conf.py 
new/simplejson-3.10.0/conf.py
--- old/simplejson-3.9.0/conf.py        2016-10-21 09:55:00.000000000 +0200
+++ new/simplejson-3.10.0/conf.py       2016-10-28 11:25:45.000000000 +0200
@@ -42,9 +42,9 @@
 # other places throughout the built documents.
 #
 # The short X.Y version.
-version = '3.9'
+version = '3.10'
 # The full version, including alpha/beta/rc tags.
-release = '3.9.0'
+release = '3.10.0'
 
 # There are two options for replacing |today|: either, you set today to some
 # non-false value, then it is used:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/simplejson-3.9.0/scripts/artifacts.py 
new/simplejson-3.10.0/scripts/artifacts.py
--- old/simplejson-3.9.0/scripts/artifacts.py   2016-02-15 21:22:25.000000000 
+0100
+++ new/simplejson-3.10.0/scripts/artifacts.py  2016-10-22 01:59:09.000000000 
+0200
@@ -3,9 +3,13 @@
 except ImportError:
     from urllib import urlopen
 
+import glob
 import io
 import json
+import os
+import re
 import subprocess
+import sys
 
 
 def get_json(url):
@@ -38,10 +42,39 @@
     for asset in release['assets']:
         download_file(asset['browser_download_url'], 
'dist/{name}'.format(**asset))
 
+def get_version():
+    return subprocess.check_output([sys.executable, 'setup.py', 
'--version']).strip()
+
+def artifact_matcher(version):
+    return 
re.compile('^simplejson-{}.*\\.(exe|whl)$'.format(re.escape(version)))
+
+def sign_artifacts(version):
+    artifacts = set(os.listdir('dist'))
+    pattern = artifact_matcher(version)
+    for fn in artifacts:
+        if pattern.search(fn) and '{}.asc'.format(fn) not in artifacts:
+            sign_artifact(os.path.join('dist', fn))
+
+def sign_artifact(path):
+    print(' '.join(['gpg', '--detach-sign', '-a', path]))
+    subprocess.check_call(['gpg', '--detach-sign', '-a', path])
+
+def upload_artifacts(version):
+    artifacts = set(os.listdir('dist'))
+    pattern = artifact_matcher(version)
+    args = ['twine', 'upload']
+    for fn in artifacts:
+        if pattern.search(fn):
+            filename = os.path.join('dist', fn)
+            args.extend([filename, filename + '.asc'])
+    subprocess.check_call(args)
 
 def main():
     download_appveyor_artifacts()
     download_github_artifacts()
+    version = get_version()
+    sign_artifacts(version)
+    upload_artifacts(version)
 
 
 if __name__ == '__main__':
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/simplejson-3.9.0/setup.py 
new/simplejson-3.10.0/setup.py
--- old/simplejson-3.9.0/setup.py       2016-10-21 09:55:07.000000000 +0200
+++ new/simplejson-3.10.0/setup.py      2016-10-28 11:25:45.000000000 +0200
@@ -11,7 +11,7 @@
     DistutilsPlatformError
 
 IS_PYPY = hasattr(sys, 'pypy_translation_info')
-VERSION = '3.9.0'
+VERSION = '3.10.0'
 DESCRIPTION = "Simple, fast, extensible JSON encoder/decoder for Python"
 
 with open('README.rst', 'r') as f:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/simplejson-3.9.0/simplejson/__init__.py 
new/simplejson-3.10.0/simplejson/__init__.py
--- old/simplejson-3.9.0/simplejson/__init__.py 2016-10-21 09:55:12.000000000 
+0200
+++ new/simplejson-3.10.0/simplejson/__init__.py        2016-10-28 
11:25:45.000000000 +0200
@@ -97,7 +97,7 @@
     Expecting property name: line 1 column 3 (char 2)
 """
 from __future__ import absolute_import
-__version__ = '3.9.0'
+__version__ = '3.10.0'
 __all__ = [
     'dump', 'dumps', 'load', 'loads',
     'JSONDecoder', 'JSONDecodeError', 'JSONEncoder',
@@ -110,7 +110,7 @@
 
 from .scanner import JSONDecodeError
 from .decoder import JSONDecoder
-from .encoder import JSONEncoder, JSONEncoderForHTML
+from .encoder import JSONEncoder, JSONEncoderForHTML, RawJSON
 def _import_OrderedDict():
     import collections
     try:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/simplejson-3.9.0/simplejson/_speedups.c 
new/simplejson-3.10.0/simplejson/_speedups.c
--- old/simplejson-3.9.0/simplejson/_speedups.c 2016-05-09 03:11:08.000000000 
+0200
+++ new/simplejson-3.10.0/simplejson/_speedups.c        2016-10-28 
11:25:45.000000000 +0200
@@ -245,6 +245,8 @@
 encoder_dealloc(PyObject *self);
 static int
 encoder_clear(PyObject *self);
+static int
+is_raw_json(PyObject *obj);
 static PyObject *
 encoder_stringify_key(PyEncoderObject *s, PyObject *key);
 static int
@@ -277,6 +279,20 @@
 
 #define MIN_EXPANSION 6
 
+static PyObject* RawJSONType;
+static int
+is_raw_json(PyObject *obj)
+{
+    if (RawJSONType == NULL) {
+        PyObject *encoder_module = PyImport_ImportModule("simplejson.encoder");
+        RawJSONType = PyObject_GetAttrString(encoder_module, "RawJSON");
+        Py_DECREF(encoder_module);
+        if (RawJSONType == NULL)
+            return 0;
+    }
+    return PyObject_IsInstance(obj, RawJSONType) ? 1 : 0;
+}
+
 static int
 JSON_Accu_Init(JSON_Accu *acc)
 {
@@ -2868,6 +2884,12 @@
             if (encoded != NULL)
                 rv = _steal_accumulate(rval, encoded);
         }
+        else if (is_raw_json(obj))
+        {
+            PyObject *encoded = PyObject_GetAttrString(obj, "encoded_json");
+            if (encoded != NULL)
+                rv = _steal_accumulate(rval, encoded);
+        }
         else if (PyInt_Check(obj) || PyLong_Check(obj)) {
             PyObject *encoded;
             if (PyInt_CheckExact(obj) || PyLong_CheckExact(obj)) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/simplejson-3.9.0/simplejson/encoder.py 
new/simplejson-3.10.0/simplejson/encoder.py
--- old/simplejson-3.9.0/simplejson/encoder.py  2016-10-21 09:52:45.000000000 
+0200
+++ new/simplejson-3.10.0/simplejson/encoder.py 2016-10-28 11:25:45.000000000 
+0200
@@ -39,6 +39,14 @@
 
 FLOAT_REPR = repr
 
+class RawJSON(object):
+    """Wrap an encoded JSON document for direct embedding in the output
+
+    """
+    def __init__(self, encoded_json):
+        self.encoded_json = encoded_json
+
+
 def encode_basestring(s, _PY3=PY3, _q=u('"')):
     """Return a JSON representation of a Python string
 
@@ -472,6 +480,8 @@
             if (isinstance(value, string_types) or
                 (_PY3 and isinstance(value, binary_type))):
                 yield buf + _encoder(value)
+            elif isinstance(value, RawJSON):
+                yield buf + value.encoded_json
             elif value is None:
                 yield buf + 'null'
             elif value is True:
@@ -590,6 +600,8 @@
             if (isinstance(value, string_types) or
                 (_PY3 and isinstance(value, binary_type))):
                 yield _encoder(value)
+            elif isinstance(value, RawJSON):
+                yield value.encoded_json
             elif value is None:
                 yield 'null'
             elif value is True:
@@ -632,6 +644,8 @@
         if (isinstance(o, string_types) or
             (_PY3 and isinstance(o, binary_type))):
             yield _encoder(o)
+        elif isinstance(o, RawJSON):
+            yield o.encoded_json
         elif o is None:
             yield 'null'
         elif o is True:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/simplejson-3.9.0/simplejson/tests/__init__.py 
new/simplejson-3.10.0/simplejson/tests/__init__.py
--- old/simplejson-3.9.0/simplejson/tests/__init__.py   2016-10-21 
08:16:35.000000000 +0200
+++ new/simplejson-3.10.0/simplejson/tests/__init__.py  2016-10-28 
11:25:45.000000000 +0200
@@ -65,6 +65,7 @@
                 'simplejson.tests.test_tool',
                 'simplejson.tests.test_for_json',
                 'simplejson.tests.test_subclass',
+                'simplejson.tests.test_raw_json',
             ]))
     suite = get_suite()
     import simplejson
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/simplejson-3.9.0/simplejson/tests/test_raw_json.py 
new/simplejson-3.10.0/simplejson/tests/test_raw_json.py
--- old/simplejson-3.9.0/simplejson/tests/test_raw_json.py      1970-01-01 
01:00:00.000000000 +0100
+++ new/simplejson-3.10.0/simplejson/tests/test_raw_json.py     2016-10-28 
11:25:45.000000000 +0200
@@ -0,0 +1,47 @@
+import unittest
+import simplejson as json
+
+dct1 = {
+    'key1': 'value1'
+}
+
+dct2 = {
+    'key2': 'value2',
+    'd1': dct1
+}
+
+dct3 = {
+    'key2': 'value2',
+    'd1': json.dumps(dct1)
+}
+
+dct4 = {
+    'key2': 'value2',
+    'd1': json.RawJSON(json.dumps(dct1))
+}
+
+
+class TestRawJson(unittest.TestCase):
+
+    def test_normal_str(self):
+        self.assertNotEqual(json.dumps(dct2), json.dumps(dct3))
+
+    def test_raw_json_str(self):
+        self.assertEqual(json.dumps(dct2), json.dumps(dct4))
+        self.assertEqual(dct2, json.loads(json.dumps(dct4)))
+
+    def test_list(self):
+        self.assertEqual(
+            json.dumps([dct2]),
+            json.dumps([json.RawJSON(json.dumps(dct2))]))
+        self.assertEqual(
+            [dct2],
+            json.loads(json.dumps([json.RawJSON(json.dumps(dct2))])))
+
+    def test_direct(self):
+        self.assertEqual(
+            json.dumps(dct2),
+            json.dumps(json.RawJSON(json.dumps(dct2))))
+        self.assertEqual(
+            dct2,
+            json.loads(json.dumps(json.RawJSON(json.dumps(dct2)))))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/simplejson-3.9.0/simplejson.egg-info/PKG-INFO 
new/simplejson-3.10.0/simplejson.egg-info/PKG-INFO
--- old/simplejson-3.9.0/simplejson.egg-info/PKG-INFO   2016-10-21 
13:38:01.000000000 +0200
+++ new/simplejson-3.10.0/simplejson.egg-info/PKG-INFO  2016-10-28 
12:01:25.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: simplejson
-Version: 3.9.0
+Version: 3.10.0
 Summary: Simple, fast, extensible JSON encoder/decoder for Python
 Home-page: http://github.com/simplejson/simplejson
 Author: Bob Ippolito
@@ -41,7 +41,6 @@
         is not maintained, and should only be used as a last resort.
         
         .. _python2.2: https://github.com/simplejson/simplejson/tree/python2.2
-        https://github.com/simplejson/simplejson/tree/python2.2
         
 Platform: any
 Classifier: Development Status :: 5 - Production/Stable
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/simplejson-3.9.0/simplejson.egg-info/SOURCES.txt 
new/simplejson-3.10.0/simplejson.egg-info/SOURCES.txt
--- old/simplejson-3.9.0/simplejson.egg-info/SOURCES.txt        2016-10-21 
13:38:01.000000000 +0200
+++ new/simplejson-3.10.0/simplejson.egg-info/SOURCES.txt       2016-10-28 
12:01:25.000000000 +0200
@@ -40,6 +40,7 @@
 simplejson/tests/test_pass1.py
 simplejson/tests/test_pass2.py
 simplejson/tests/test_pass3.py
+simplejson/tests/test_raw_json.py
 simplejson/tests/test_recursion.py
 simplejson/tests/test_scanstring.py
 simplejson/tests/test_separators.py


Reply via email to