Hello community, here is the log from the commit of package python-serpent for openSUSE:Factory checked in at 2019-03-19 09:57:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-serpent (Old) and /work/SRC/openSUSE:Factory/.python-serpent.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-serpent" Tue Mar 19 09:57:59 2019 rev:3 rq:682071 version:1.27 Changes: -------- --- /work/SRC/openSUSE:Factory/python-serpent/python-serpent.changes 2018-12-24 11:43:50.161322118 +0100 +++ /work/SRC/openSUSE:Factory/.python-serpent.new.28833/python-serpent.changes 2019-03-19 09:58:03.312111087 +0100 @@ -1,0 +2,9 @@ +Wed Mar 6 09:33:03 UTC 2019 - Tomáš Chvátal <[email protected]> + +- Update to 1.27: + * fixed serialization of unicode elements in dicts and sets (this was a regression on Python 2.x) + * support for enum34 backport library for enums in older python versions. + * Some small tweaks and attempt to fix an inconsistently running unit test + * LICENSE file included in release. + +------------------------------------------------------------------- Old: ---- LICENSE serpent-1.24.tar.gz New: ---- serpent-1.27.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-serpent.spec ++++++ --- /var/tmp/diff_new_pack.nVnN2v/_old 2019-03-19 09:58:04.436110636 +0100 +++ /var/tmp/diff_new_pack.nVnN2v/_new 2019-03-19 09:58:04.460110626 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-serpent # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,19 +18,21 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-serpent -Version: 1.24 +Version: 1.27 Release: 0 Summary: Serialization based on astliteral_eval License: MIT Group: Development/Languages/Python -Url: https://github.com/irmen/Serpent +URL: https://github.com/irmen/Serpent Source: https://files.pythonhosted.org/packages/source/s/serpent/serpent-%{version}.tar.gz -Source10: https://raw.githubusercontent.com/irmen/Serpent/%{version}/LICENSE BuildRequires: %{python_module setuptools} BuildRequires: fdupes +BuildRequires: python-enum34 BuildRequires: python-rpm-macros BuildArch: noarch - +%ifpython2 +Requires: python-enum34 +%endif %python_subpackages %description @@ -42,7 +44,6 @@ %prep %setup -q -n serpent-%{version} -cp %{SOURCE10} . %build %python_build ++++++ serpent-1.24.tar.gz -> serpent-1.27.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/serpent-1.24/LICENSE new/serpent-1.27/LICENSE --- old/serpent-1.24/LICENSE 1970-01-01 01:00:00.000000000 +0100 +++ new/serpent-1.27/LICENSE 2017-12-29 00:56:17.000000000 +0100 @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) by Irmen de Jong + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/serpent-1.24/MANIFEST.in new/serpent-1.27/MANIFEST.in --- old/serpent-1.24/MANIFEST.in 1970-01-01 01:00:00.000000000 +0100 +++ new/serpent-1.27/MANIFEST.in 2018-07-03 19:16:03.000000000 +0200 @@ -0,0 +1,3 @@ +include LICENSE +include README.md +include tox.ini diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/serpent-1.24/PKG-INFO new/serpent-1.27/PKG-INFO --- old/serpent-1.24/PKG-INFO 2018-03-01 21:55:57.000000000 +0100 +++ new/serpent-1.27/PKG-INFO 2018-07-30 21:09:28.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: serpent -Version: 1.24 +Version: 1.27 Summary: Serialization based on ast.literal_eval Home-page: UNKNOWN Author: Irmen de Jong diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/serpent-1.24/README.md new/serpent-1.27/README.md --- old/serpent-1.24/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/serpent-1.27/README.md 2018-07-27 19:40:50.000000000 +0200 @@ -0,0 +1,96 @@ +Serpent serialization library (Python/.NET/Java) +================================================ + +[](https://saythanks.io/to/irmen) +[](https://travis-ci.org/irmen/Serpent) +[](https://pypi.python.org/pypi/Serpent/) +[](http://search.maven.org/#search|ga|1|g%3A%22net.razorvine%22%20AND%20a%3A%22serpent%22) +[](https://www.nuget.org/packages/Razorvine.Serpent/) +[](https://anaconda.org/conda-forge/serpent) + +Serpent provides ast.literal_eval() compatible object tree serialization. +It serializes an object tree into bytes (utf-8 encoded string) that can be decoded and then +passed as-is to ast.literal_eval() to rebuild it as the original object tree. +As such it is safe to send serpent data to other machines over the network for instance +(because only 'safe' literals are encoded). + +More info on Pypi: https://pypi.python.org/pypi/serpent +Source code is on Github: https://github.com/irmen/Serpent + +Copyright by Irmen de Jong ([email protected]) +This software is released under the MIT software license. +This license, including disclaimer, is available in the 'LICENSE' file. + + +PYTHON +------ +Package can be found on Pypi as 'serpent': https://pypi.python.org/pypi/serpent +Example usage can be found in ./tests/example.py + + +C#/.NET +------- +Package is available on www.nuget.org as 'Razorvine.Serpent'. +Full source code can be found in ./dotnet/ directory. +Example usage can be found in ./dotnet/Serpent.Test/Example.cs +The project is a dotnet core project targeting NetStandard 2.0. + + +JAVA +---- +Maven-artefact is available on maven central, groupid 'net.razorvine' artifactid 'serpent'. +Full source code can be found in ./java/ directory. +Example usage can be found in ./java/test/SerpentExample.java +Versions before 1.23 require Java 7 or Java 8 (JDK 1.7 or 1.8) to compile and run. +Version 1.23 and later require Java 8 (JDK 1.8) at a minimum to compile and run. + + +SOME MORE DETAILS +----------------- +Compatible with Python 2.7+ (including 3.x), IronPython 2.7+, Jython 2.7+. + +Serpent handles several special Python types to make life easier: + + - str --> promoted to unicode (see below why this is) + - bytes, bytearrays, memoryview, buffer --> string, base-64 + (you'll have to manually un-base64 them though. Can use serpent.tobytes function) + - uuid.UUID, datetime.{datetime, date, time, timespan} --> appropriate string/number + - decimal.Decimal --> string (to not lose precision) + - array.array typecode 'c'/'u' --> string/unicode + - array.array other typecode --> list + - Exception --> dict with some fields of the exception (message, args) + - collections module types --> mostly equivalent primitive types or dict + - enums --> the value of the enum (Python 3.4+ or enum34 library) + - all other types --> dict with the ``__getstate__`` or ``vars()`` of the object + +Notes: + +All str will be promoted to unicode. This is done because it is the +default anyway for Python 3.x, and it solves the problem of the str/unicode +difference between different Python versions. Also it means the serialized +output doesn't have those problematic 'u' prefixes on strings. + +The serializer is not thread-safe. Make sure you're not making changes +to the object tree that is being serialized, and don't use the same +serializer in different threads. + +Because the serialized format is just valid Python source code, it can +contain comments. Serpent does not add comments by itself apart from the +single header line. + +Set literals are not supported on python <3.2 (``ast.literal_eval`` +limitation). If you need Python < 3.2 compatibility, you'll have to use +``set_literals=False`` when serializing. Since version 1.6 serpent chooses +this wisely for you by default, but you can still override it if needed. + +Floats +inf and -inf are handled via a trick, Float 'nan' cannot be handled +and is represented by the special value: ``{'__class__':'float','value':'nan'}`` +We chose not to encode it as just the string 'NaN' because that could cause +memory issues when used in multiplications. + +Jython's ast module cannot properly parse some literal reprs of unicode strings. +This is a known bug http://bugs.jython.org/issue2008 +It seems to work when your server is Python 2.x but safest is perhaps to make +sure your data to parse contains only ascii strings when dealing with Jython. +Serpent checks for possible problems and will raise an error if it finds one, +rather than continuing with string data that might be incorrect. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/serpent-1.24/serpent.egg-info/PKG-INFO new/serpent-1.27/serpent.egg-info/PKG-INFO --- old/serpent-1.24/serpent.egg-info/PKG-INFO 2018-03-01 21:55:57.000000000 +0100 +++ new/serpent-1.27/serpent.egg-info/PKG-INFO 2018-07-30 21:09:28.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: serpent -Version: 1.24 +Version: 1.27 Summary: Serialization based on ast.literal_eval Home-page: UNKNOWN Author: Irmen de Jong diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/serpent-1.24/serpent.egg-info/SOURCES.txt new/serpent-1.27/serpent.egg-info/SOURCES.txt --- old/serpent-1.24/serpent.egg-info/SOURCES.txt 2018-03-01 21:55:57.000000000 +0100 +++ new/serpent-1.27/serpent.egg-info/SOURCES.txt 2018-07-30 21:09:28.000000000 +0200 @@ -1,6 +1,10 @@ +LICENSE +MANIFEST.in +README.md serpent.py setup.cfg setup.py +tox.ini serpent.egg-info/PKG-INFO serpent.egg-info/SOURCES.txt serpent.egg-info/dependency_links.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/serpent-1.24/serpent.py new/serpent-1.27/serpent.py --- old/serpent-1.24/serpent.py 2018-03-01 21:47:32.000000000 +0100 +++ new/serpent-1.27/serpent.py 2018-07-30 21:04:55.000000000 +0200 @@ -20,7 +20,7 @@ - array.array other typecode --> list - Exception --> dict with some fields of the exception (message, args) - collections module types --> mostly equivalent primitive types or dict - - enums --> the value of the enum (Python 3.4+) + - enums --> the value of the enum (Python 3.4+ or enum34 library) - all other types --> dict with __getstate__ or vars() of the object Notes: @@ -76,11 +76,16 @@ import collections if sys.version_info >= (3, 4): from collections.abc import KeysView, ValuesView, ItemsView + import enum else: from collections import KeysView, ValuesView, ItemsView + try: + import enum + except ImportError: + enum = None -__version__ = "1.24" +__version__ = "1.27" __all__ = ["dump", "dumps", "load", "loads", "register_class", "unregister_class", "tobytes"] can_use_set_literals = sys.version_info >= (3, 2) # check if we can use set literals @@ -161,9 +166,7 @@ _special_classes_registry[ItemsView] = _ser_DictView if sys.version_info >= (2, 7): _special_classes_registry[collections.OrderedDict] = _ser_OrderedDict - if sys.version_info >= (3, 4): - import enum - + if enum is not None: def _ser_Enum(obj, serializer, outputstream, indentlevel): serializer._serialize(obj.value, outputstream, indentlevel) _special_classes_registry[enum.Enum] = _ser_Enum @@ -457,10 +460,8 @@ def _check_hashable_type(self, t): if t not in (bool, bytes, str, tuple) and not issubclass(t, numbers.Number): - if sys.version_info >= (3, 4): - import enum - if issubclass(t, enum.Enum): - return + if enum is not None and issubclass(t, enum.Enum): + return elif sys.version_info < (3, 0) and t is unicode: return raise TypeError("one of the keys in a dict or set is not of a primitive hashable type: " + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/serpent-1.24/setup.cfg new/serpent-1.27/setup.cfg --- old/serpent-1.24/setup.cfg 2018-03-01 21:55:57.000000000 +0100 +++ new/serpent-1.27/setup.cfg 2018-07-30 21:09:28.000000000 +0200 @@ -1,11 +1,18 @@ [wheel] universal = 1 +[bdist_rpm] +doc_files = LICENSE + docs/ + [pycodestyle] max-line-length = 140 ignore = E402,E731 exclude = .git,__pycache__,.tox,docs,tests,build,dist,examples +[metadata] +license_file = LICENSE + [egg_info] tag_build = tag_date = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/serpent-1.24/setup.py new/serpent-1.27/setup.py --- old/serpent-1.24/setup.py 2018-03-01 21:42:31.000000000 +0100 +++ new/serpent-1.27/setup.py 2018-07-24 20:18:14.000000000 +0200 @@ -173,5 +173,5 @@ "Programming Language :: Python :: 3.7", "Topic :: Software Development" ], - + tests_require=['enum34; python_version < "3.4"'] ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/serpent-1.24/tox.ini new/serpent-1.27/tox.ini --- old/serpent-1.24/tox.ini 1970-01-01 01:00:00.000000000 +0100 +++ new/serpent-1.27/tox.ini 2018-07-24 20:18:05.000000000 +0200 @@ -0,0 +1,17 @@ +[tox] +envlist=py27,py34,py35,py36,py37,pypy,pypy3 + +[testenv] +deps= + pytz + enum34; python_version<"3.4" +changedir={toxinidir}/tests +commands=python -E -Wall -tt -bb test_serpent.py + +[testenv:py26] +deps=unittest2 + pytz + +[testenv:pypy3] +commands=python -E -Wall -bb test_serpent.py +# pypy3 doesn't like the -tt option
