Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-anymarkup-core for
openSUSE:Factory checked in at 2022-10-20 11:11:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-anymarkup-core (Old)
and /work/SRC/openSUSE:Factory/.python-anymarkup-core.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-anymarkup-core"
Thu Oct 20 11:11:42 2022 rev:3 rq:1030107 version:0.8.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-anymarkup-core/python-anymarkup-core.changes
2022-07-04 11:32:48.472016644 +0200
+++
/work/SRC/openSUSE:Factory/.python-anymarkup-core.new.2275/python-anymarkup-core.changes
2022-10-20 11:12:05.684066249 +0200
@@ -1,0 +2,8 @@
+Thu Oct 20 06:52:24 UTC 2022 - Daniel Garcia <[email protected]>
+
+- Add drop-python2-support.patch gh#bkabrda/anymarkup-core#7
+- Remove python-six dependency
+- Use a more specific python_sitelib expression in %files
+- Use autosetup instead of setup and patch
+
+-------------------------------------------------------------------
New:
----
drop-python2-support.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-anymarkup-core.spec ++++++
--- /var/tmp/diff_new_pack.RW7OEt/_old 2022-10-20 11:12:06.180067253 +0200
+++ /var/tmp/diff_new_pack.RW7OEt/_new 2022-10-20 11:12:06.184067261 +0200
@@ -27,10 +27,11 @@
URL: https://github.com/bkabrda/anymarkup-core
Source0:
https://github.com/bkabrda/anymarkup-core/archive/v%{version}/anymarkup-core-%{version}.tar.gz
Patch0: xml-to-dict-0.13.patch
+# PATCH-FIX-UPSTREAM drop-python2-support.patch gh#bkabrda/anymarkup-core#7
+Patch1: drop-python2-support.patch
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
-Requires: python-six
Suggests: python-PyYAML
Suggests: python-configobj
Suggests: python-json5
@@ -43,7 +44,6 @@
BuildRequires: %{python_module flexmock}
BuildRequires: %{python_module json5}
BuildRequires: %{python_module pytest}
-BuildRequires: %{python_module six}
BuildRequires: %{python_module toml}
BuildRequires: %{python_module xmltodict}
# /SECTION
@@ -54,8 +54,7 @@
python-anymarkup.
%prep
-%setup -q -n anymarkup-core-%{version}
-%autopatch -p1
+%autosetup -p1 -n anymarkup-core-%{version}
%build
%python_build
@@ -70,6 +69,7 @@
%files %{python_files}
%doc README.rst
%license LICENSE
-%{python_sitelib}/*
+%{python_sitelib}/anymarkup_core
+%{python_sitelib}/anymarkup_core-%{version}*-info
%changelog
++++++ drop-python2-support.patch ++++++
>From 1d0c5673c15116625c02316b2605648b92cf18a4 Mon Sep 17 00:00:00 2001
From: Daniel Garcia Moreno <[email protected]>
Date: Thu, 20 Oct 2022 08:45:53 +0200
Subject: [PATCH] Drop python2 support
Python2 is very old and not maintained anymore, this patch removes the
python-six dependency and drop python2 support.
---
anymarkup_core/__init__.py | 36 +++++++++++++-----------------------
requirements.txt | 1 -
setup.py | 7 +++----
test/test_parse.py | 5 ++---
test/test_serialize.py | 3 +--
5 files changed, 19 insertions(+), 33 deletions(-)
diff --git a/anymarkup_core/__init__.py b/anymarkup_core/__init__.py
index 91f4133..21ccc78 100644
--- a/anymarkup_core/__init__.py
+++ b/anymarkup_core/__init__.py
@@ -7,7 +7,6 @@ import os
import re
import traceback
-import six
try:
import configobj
except ImportError:
@@ -95,7 +94,7 @@ def parse(inp, format=None, encoding='utf-8',
force_types=True, interpolate=True
if hasattr(inp, 'read'):
proper_inp = inp.read()
# if proper_inp is unicode, encode it
- if isinstance(proper_inp, six.text_type):
+ if isinstance(proper_inp, str):
proper_inp = proper_inp.encode(encoding)
# try to guess markup type
@@ -105,7 +104,7 @@ def parse(inp, format=None, encoding='utf-8',
force_types=True, interpolate=True
fmt = _get_format(format, fname, proper_inp)
# make it look like file-like bytes-yielding object
- proper_inp = six.BytesIO(proper_inp)
+ proper_inp = io.BytesIO(proper_inp)
try:
res = _do_parse(proper_inp, fmt, encoding, force_types, interpolate)
@@ -232,22 +231,17 @@ def _do_parse(inp, fmt, encoding, force_types,
interpolate):
cfg = configobj.ConfigObj(inp, encoding=encoding,
interpolation=interpolate)
res = cfg.dict()
elif fmt == 'json':
- if six.PY3:
- # python 3 json only reads from unicode objects
- inp = io.TextIOWrapper(inp, encoding=encoding)
- res = json.load(inp)
- else:
- res = json.load(inp, encoding=encoding)
+ # python 3 json only reads from unicode objects
+ inp = io.TextIOWrapper(inp, encoding=encoding)
+ res = json.load(inp)
elif fmt == 'json5':
- if six.PY3:
- inp = io.TextIOWrapper(inp, encoding=encoding)
+ inp = io.TextIOWrapper(inp, encoding=encoding)
res = json5.load(inp, encoding=encoding)
elif fmt == 'toml':
if not _is_utf8(encoding):
raise AnyMarkupError('toml is always utf-8 encoded according to
specification')
- if six.PY3:
- # python 3 toml prefers unicode objects
- inp = io.TextIOWrapper(inp, encoding=encoding)
+ # python 3 toml prefers unicode objects
+ inp = io.TextIOWrapper(inp, encoding=encoding)
res = toml.load(inp)
elif fmt == 'xml':
res = xmltodict.parse(inp, encoding=encoding)
@@ -336,9 +330,9 @@ def _ensure_proper_types(struct, encoding, force_types):
res = []
for i in struct:
res.append(_ensure_proper_types(i, encoding, force_types))
- elif isinstance(struct, six.binary_type):
+ elif isinstance(struct, bytes):
res = struct.decode(encoding)
- elif isinstance(struct, (six.text_type, type(None), type(True),
six.integer_types, float)):
+ elif isinstance(struct, (str, type(None), type(True), int, float)):
res = struct
elif isinstance(struct, datetime.datetime):
# toml can parse datetime natively
@@ -347,11 +341,11 @@ def _ensure_proper_types(struct, encoding, force_types):
raise AnyMarkupError('internal error - unexpected type {0} in parsed
markup'.
format(type(struct)))
- if force_types and isinstance(res, six.text_type):
+ if force_types and isinstance(res, str):
res = _recognize_basic_types(res)
elif not (force_types or
- isinstance(res, (dict, collections.OrderedDict, list,
six.text_type))):
- res = six.text_type(res)
+ isinstance(res, (dict, collections.OrderedDict, list, str))):
+ res = str(res)
return res
@@ -361,8 +355,6 @@ def _recognize_basic_types(s):
to a proper type and return it.
"""
tps = [int, float]
- if not six.PY3: # compat for older versions of six that don't have PY2
- tps.append(long)
for tp in tps:
try:
return tp(s)
@@ -498,5 +490,3 @@ if yaml is not None:
yaml.SafeLoader.add_constructor(u'tag:yaml.org,2002:omap',
construct_ordereddict)
yaml.SafeDumper.add_representer(collections.OrderedDict,
represent_ordereddict)
yaml.SafeDumper.add_representer(str, represent_str)
- if six.PY2:
- yaml.SafeDumper.add_representer(unicode, represent_str)
diff --git a/requirements.txt b/requirements.txt
index ffe2fce..e69de29 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1 +0,0 @@
-six
diff --git a/setup.py b/setup.py
index e5b0be2..5391427 100644
--- a/setup.py
+++ b/setup.py
@@ -21,9 +21,8 @@ setup(
'License :: OSI Approved :: BSD License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
- 'Programming Language :: Python :: 2.7',
- 'Programming Language :: Python :: 3.3',
- 'Programming Language :: Python :: 3.4',
- 'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.8',
+ 'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.10',
]
)
diff --git a/test/test_parse.py b/test/test_parse.py
index 3c0bf86..cddd872 100644
--- a/test/test_parse.py
+++ b/test/test_parse.py
@@ -4,7 +4,6 @@ import io
import os
import pytest
-import six
import toml
from anymarkup_core import *
@@ -23,8 +22,8 @@ class TestParse(object):
elif isinstance(struct, list):
for i in struct:
self.assert_unicode(i)
- elif isinstance(struct, (six.string_types, type(None), type(True), \
- six.integer_types, float, datetime)):
+ elif isinstance(struct, (str, type(None), type(True), \
+ int, float, datetime)):
pass
else:
raise AssertionError('Unexpected type {0} in parsed
structure'.format(type(struct)))
diff --git a/test/test_serialize.py b/test/test_serialize.py
index 8191561..9ffbeab 100644
--- a/test/test_serialize.py
+++ b/test/test_serialize.py
@@ -3,7 +3,6 @@ import io
import os
import pytest
-import six
from anymarkup_core import *
@@ -21,7 +20,7 @@ class TestSerialize(object):
fixtures = os.path.join(os.path.dirname(__file__), 'fixtures')
def _read_decode(self, file):
- if isinstance(file, six.string_types):
+ if isinstance(file, str):
file = open(file, 'rb')
else:
file.seek(0)
--
2.38.0