15
0

Accepting request 872816 from devel:languages:python

- Update to version 2.0.0
  * Major release: the serialized JSON format now preserves
    dictionary identity, which is a subtle change in the
    serialized format. (#351)
  * Dictionary identity is now preserved. For example, if the same
    dictionary appears twice in a list, the reconstituted list
    will now contain two references to the same dictionary. (#255)
    (+332)
- Changes in v1.5.2
  * Patch release to avoid the change in behavior from the
    preservation of dict identity. The next release will be
    v2.0.0. (#351)
  * This relese does not include the performance improvements from
    v1.5.1.
  * Pandas DataFrame objects with multilevel columns are now
    supported. (#346) (+347)
  * Numpy 1.20 is now officially supported. (#336)
  * Python 3.9 is now officially supported. (+348)
  * Achieved a small speedup for _get_flattener by merging type
    checks. (+349)
- Changes in v1.5.1
  * The performance of the unpickler was drastically improved by
    avoiding tag checks for basic Python types. (+340)
  * decode() documentation improvements. (+341)
  * Serialization of Pandas DataFrame objects that contain
    timedelta64[ns] dtypes are now supported. (+330) (#331)
  * Dictionary identity is now preserved. For example, if the same
    dictionary appears twice in a list, the reconstituted list
    will now contain two references to the same dictionary. (#255)
    (+332)
  * Unit tests were added to ensure that sklearn.tree.
    DecisionTreeClassifier objects are properly serialized. (#155)
    (+344)
  * The is_reducible() utility function used by encode() is now 4x
    faster! Objects that provide __getstate__(), __setstate__(),
    and __slots__ benefit most from these improvements. (+343)
  * Improved pickler flatten()/encode() performance. (+345)
- Changes in v1.5.0
  * Previous versions of jsonpickle with make_refs=False would
    emit null when encountering an object it had already seen when
    traversing objects. All instances of the object are now
    serialized. While this is arguably an improvement in the vast
    majority of scenarios, it is a change in behavior and is thus
    considered a minor-level change. (#333) (#334) (#337) (+338)
  * Multiple enums are now serialized correctly with
    make_refs=False. (#235)
- Changes in v1.4.2
  * Use importlib.metadata from the stdlib on Python 3.8. (+305)
    (#303)
  * Micro-optimize type checks to use a set for lookups. (+327)
  * Documentation improvements.
- Changes in v1.4.1
  * Patch release for Python 3.8 importlib_metadata support. (#300)
- Changes in v1.4
  * Python 3.8 support. (#292)
  * jsonpickle.encode now supports the standard indent and
    separators arguments, and passes them through to the active
    JSON backend library. (#183)
  * We now include a custom handler for array.array objects. (#199)
  * Dict key order is preserved when pickling dictionaries on
    Python3. (#193)
  * Improved serialization of dictionaries with non-string keys.
    Previously, using an enum that was both the key and a value in
    a dictionary could end up with incorrect references to other
    objects. The references are now properly maintained for dicts
    with object keys that are also referenced in the dict's
    values. (#286)
  * Improved serialization of pandas.Series objects. (#287)
- Don't test numpy and pandas in python36 flavor, because
  they are no longer available on Tumbleweed (NEP 29)
- Test some extras, but not in lettered staging if they are not
  in Ring1.
- Drop PR292-Python38.patch merged upstream

OBS-URL: https://build.opensuse.org/request/show/872816
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-jsonpickle?expand=0&rev=8
This commit is contained in:
2021-02-16 21:34:38 +00:00
committed by Git OBS Bridge
5 changed files with 114 additions and 58 deletions

View File

@@ -1,41 +0,0 @@
--- a/jsonpickle/handlers.py
+++ b/jsonpickle/handlers.py
@@ -10,7 +10,9 @@ A handler can be bound to other types by
from __future__ import absolute_import, division, unicode_literals
import copy
import datetime
+import io
import re
+import sys
import threading
import uuid
@@ -254,3 +256,18 @@ class LockHandler(BaseHandler):
_lock = threading.Lock()
LockHandler.handles(_lock.__class__)
+
+
+class TextIOHandler(BaseHandler):
+ """Serialize file descriptors as None because we cannot roundtrip"""
+
+ def flatten(self, obj, data):
+ return None
+
+ def restore(self, data):
+ """Restore should never get called because flatten() returns None"""
+ raise AssertionError('Restoring IO.TextIOHandler is not supported')
+
+
+if sys.version_info >= (3, 8):
+ TextIOHandler.handles(io.TextIOWrapper)
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -12,5 +12,5 @@ pytest
pytest-cov
simplejson
sqlalchemy
-ujson
-yajl; sys_platform != 'win32'
+ujson; python_version < '3.8'
+yajl; sys_platform != 'win32' and python_version < '3.8'

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:71bca2b80ae28af4e3f86629ef247100af7f97032b5ca8d791c1f8725b411d95
size 76571

3
jsonpickle-2.0.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0be49cba80ea6f87a168aa8168d717d00c6ca07ba83df3cec32d3b30bfe6fb9a
size 110336

View File

@@ -1,3 +1,80 @@
-------------------------------------------------------------------
Mon Feb 15 21:52:25 UTC 2021 - Ben Greiner <code@bnavigator.de>
- Update to version 2.0.0
* Major release: the serialized JSON format now preserves
dictionary identity, which is a subtle change in the
serialized format. (#351)
* Dictionary identity is now preserved. For example, if the same
dictionary appears twice in a list, the reconstituted list
will now contain two references to the same dictionary. (#255)
(+332)
- Changes in v1.5.2
* Patch release to avoid the change in behavior from the
preservation of dict identity. The next release will be
v2.0.0. (#351)
* This relese does not include the performance improvements from
v1.5.1.
* Pandas DataFrame objects with multilevel columns are now
supported. (#346) (+347)
* Numpy 1.20 is now officially supported. (#336)
* Python 3.9 is now officially supported. (+348)
* Achieved a small speedup for _get_flattener by merging type
checks. (+349)
- Changes in v1.5.1
* The performance of the unpickler was drastically improved by
avoiding tag checks for basic Python types. (+340)
* decode() documentation improvements. (+341)
* Serialization of Pandas DataFrame objects that contain
timedelta64[ns] dtypes are now supported. (+330) (#331)
* Dictionary identity is now preserved. For example, if the same
dictionary appears twice in a list, the reconstituted list
will now contain two references to the same dictionary. (#255)
(+332)
* Unit tests were added to ensure that sklearn.tree.
DecisionTreeClassifier objects are properly serialized. (#155)
(+344)
* The is_reducible() utility function used by encode() is now 4x
faster! Objects that provide __getstate__(), __setstate__(),
and __slots__ benefit most from these improvements. (+343)
* Improved pickler flatten()/encode() performance. (+345)
- Changes in v1.5.0
* Previous versions of jsonpickle with make_refs=False would
emit null when encountering an object it had already seen when
traversing objects. All instances of the object are now
serialized. While this is arguably an improvement in the vast
majority of scenarios, it is a change in behavior and is thus
considered a minor-level change. (#333) (#334) (#337) (+338)
* Multiple enums are now serialized correctly with
make_refs=False. (#235)
- Changes in v1.4.2
* Use importlib.metadata from the stdlib on Python 3.8. (+305)
(#303)
* Micro-optimize type checks to use a set for lookups. (+327)
* Documentation improvements.
- Changes in v1.4.1
* Patch release for Python 3.8 importlib_metadata support. (#300)
- Changes in v1.4
* Python 3.8 support. (#292)
* jsonpickle.encode now supports the standard indent and
separators arguments, and passes them through to the active
JSON backend library. (#183)
* We now include a custom handler for array.array objects. (#199)
* Dict key order is preserved when pickling dictionaries on
Python3. (#193)
* Improved serialization of dictionaries with non-string keys.
Previously, using an enum that was both the key and a value in
a dictionary could end up with incorrect references to other
objects. The references are now properly maintained for dicts
with object keys that are also referenced in the dict's
values. (#286)
* Improved serialization of pandas.Series objects. (#287)
- Don't test numpy and pandas in python36 flavor, because
they are no longer available on Tumbleweed (NEP 29)
- Test some extras, but not in lettered staging if they are not
in Ring1.
- Drop PR292-Python38.patch merged upstream
-------------------------------------------------------------------
Sat Mar 14 08:25:54 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-jsonpickle
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,37 +19,53 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define modname jsonpickle
%bcond_without python2
%bcond_with ringdisabled
Name: python-jsonpickle
Version: 1.3
Version: 2.0.0
Release: 0
Summary: Python library for serializing any arbitrary object graph into JSON
License: BSD-3-Clause
URL: https://github.com/jsonpickle/jsonpickle
Source: https://files.pythonhosted.org/packages/source/j/jsonpickle/jsonpickle-%{version}.tar.gz
# PATCH-FIX-UPSTREAM PR292-Python38.patch gh#jsonpickle/jsonpickle#281 mcepl@suse.com
# Fix Python 3.8 incompatibilities
Patch01: PR292-Python38.patch
BuildRequires: %{python_module importlib_metadata if %python-base < 3.8}
BuildRequires: %{python_module setuptools_scm >= 3.4.1}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module toml}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
%if 0%{python_version_nodots} < 38
Requires: python-importlib_metadata
%endif
Recommends: python-simplejson
Suggests: python-demjson
Suggests: python-ujson
Suggests: python-yajl
Suggests: python-numpy
Suggests: python-pandas
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module SQLAlchemy}
BuildRequires: %{python_module coverage}
BuildRequires: %{python_module numpy}
BuildRequires: %{python_module ecdsa}
BuildRequires: %{python_module pymongo}
BuildRequires: %{python_module pytest}
BuildRequires: %{pythons}
# /SECTION
BuildRequires: %{python_module pytz}
BuildRequires: %{python_module simplejson}
BuildRequires: %{python_module numpy if (%python-base without python36-base)}
%if ! 0%{?_with_ringdisabled}
# Test these in a normal devel project or locally, but not when staging with Ring1
BuildRequires: %{python_module demjson}
BuildRequires: %{python_module feedparser}
BuildRequires: %{python_module ujson}
BuildRequires: %{python_module pandas if (%python-base without python36-base)}
BuildRequires: %{python_module scikit-learn if (%python-base without python36-base)}
%endif
%if %{with python2}
BuildRequires: python-enum34
BuildRequires: python-jsonlib
%endif
# /SECTION
%ifpython2
Suggests: python-feedparser
Suggests: python-enum34
Suggests: python-jsonlib
%endif
%python_subpackages
@@ -61,6 +77,7 @@ Additionally, it can reconstitute the object back into Python.
%prep
%autosetup -p1 -n %{modname}-%{version}
sed -i 's/--flake8 --black --cov//' pytest.ini
%build
%python_build
@@ -70,11 +87,14 @@ Additionally, it can reconstitute the object back into Python.
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%pytest
python36_ignorefiles="--ignore jsonpickle/ext/numpy.py \
--ignore jsonpickle/ext/pandas.py"
%pytest -ra ${$python_ignorefiles} %{?_with_ringdisabled:--ignore jsonpickle/ext/pandas.py}
%files %{python_files}
%doc README.rst docs/source/changelog.rst
%license COPYING
%{python_sitelib}/*
%license LICENSE
%doc README.rst CHANGES.rst
%{python_sitelib}/jsonpickle
%{python_sitelib}/jsonpickle-%{version}*-info
%changelog