14
0

Accepting request 1232084 from home:mcalabkova:branches:devel:languages:python

- add patch no-six.patch to get rid of six

OBS-URL: https://build.opensuse.org/request/show/1232084
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-vobject?expand=0&rev=17
This commit is contained in:
2024-12-19 09:32:00 +00:00
committed by Git OBS Bridge
parent f0b67ade5d
commit dd36f3f3c9
3 changed files with 137 additions and 2 deletions

129
no-six.patch Normal file
View File

@@ -0,0 +1,129 @@
Index: vobject-0.9.8/vobject/base.py
===================================================================
--- vobject-0.9.8.orig/vobject/base.py
+++ vobject-0.9.8/vobject/base.py
@@ -6,7 +6,7 @@ import copy
import codecs
import logging
import re
-import six
+import io
import sys
# ------------------------------------ Python 2/3 compatibility challenges ----
@@ -913,7 +913,7 @@ def getLogicalLines(fp, allowQP=True):
Quoted-printable data will be decoded in the Behavior decoding phase.
# We're leaving this test in for awhile, because the unittest was ugly and dumb.
- >>> from six import StringIO
+ >>> from io import StringIO
>>> f=StringIO(testLines)
>>> for n, l in enumerate(getLogicalLines(f)):
... print("Line %s: %s" % (n, l[0]))
@@ -936,7 +936,7 @@ def getLogicalLines(fp, allowQP=True):
else:
quotedPrintable = False
- newbuffer = six.StringIO
+ newbuffer = io.StringIO
logicalLine = newbuffer()
lineNumber = 0
lineStartNumber = 0
@@ -1050,7 +1050,7 @@ def defaultSerialize(obj, buf, lineLengt
"""
Encode and fold obj and its children, write to buf or return a string.
"""
- outbuf = buf or six.StringIO()
+ outbuf = buf or io.StringIO()
if isinstance(obj, Component):
if obj.group is None:
@@ -1072,7 +1072,7 @@ def defaultSerialize(obj, buf, lineLengt
if obj.behavior and not startedEncoded:
obj.behavior.encode(obj)
- s = six.StringIO()
+ s = io.StringIO()
if obj.group is not None:
s.write(obj.group + ".")
@@ -1141,7 +1141,7 @@ def readComponents(
Generate one Component at a time from a stream.
"""
if isinstance(streamOrString, basestring):
- stream = six.StringIO(streamOrString)
+ stream = io.StringIO(streamOrString)
else:
stream = streamOrString
Index: vobject-0.9.8/vobject/hcalendar.py
===================================================================
--- vobject-0.9.8.orig/vobject/hcalendar.py
+++ vobject-0.9.8/vobject/hcalendar.py
@@ -28,7 +28,7 @@ and an equivalent event in hCalendar for
</span>
"""
-import six
+import io
from datetime import date, datetime, timedelta
@@ -45,7 +45,7 @@ class HCalendar(VCalendar2_0):
Serialize iCalendar to HTML using the hCalendar microformat (http://microformats.org/wiki/hcalendar)
"""
- outbuf = buf or six.StringIO()
+ outbuf = buf or io.StringIO()
level = 0 # holds current indentation level
tabwidth = 3
Index: vobject-0.9.8/vobject/icalendar.py
===================================================================
--- vobject-0.9.8.orig/vobject/icalendar.py
+++ vobject-0.9.8/vobject/icalendar.py
@@ -10,7 +10,7 @@ import string
import base64
from dateutil import rrule, tz
-import six
+import io
try:
import pytz
@@ -65,7 +65,7 @@ def toUnicode(s):
"""
Take a string or unicode, turn it into unicode, decoding as utf-8
"""
- if isinstance(s, six.binary_type):
+ if isinstance(s, bytes):
s = s.decode("utf-8")
return s
@@ -154,7 +154,7 @@ class TimezoneComponent(Component):
"tzid",
)
# serialize encodes as utf-8, cStringIO will leave utf-8 alone
- buffer = six.StringIO()
+ buffer = io.StringIO()
# allow empty VTIMEZONEs
if len(self.contents) == 0:
return None
@@ -607,7 +607,7 @@ class RecurringComponent(Component):
self.add(name).value = setlist
elif name in RULENAMES:
for rule in setlist:
- buf = six.StringIO()
+ buf = io.StringIO()
buf.write("FREQ=")
buf.write(FREQUENCIES[rule._freq])
@@ -1074,7 +1074,7 @@ class VCalendar2_0(VCalendarComponentBeh
transformed = obj
undoTransform = False
out = None
- outbuf = buf or six.StringIO()
+ outbuf = buf or io.StringIO()
if obj.group is None:
groupString = ""
else:

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Dec 18 13:50:35 UTC 2024 - Markéta Machová <mmachova@suse.com>
- add patch no-six.patch to get rid of six
-------------------------------------------------------------------
Tue Nov 5 15:07:32 UTC 2024 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>

View File

@@ -26,6 +26,8 @@ License: Apache-2.0
Group: Development/Languages/Python
URL: https://github.com/py-vobject/vobject/
Source: https://files.pythonhosted.org/packages/source/v/vobject/%{modname}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM https://github.com/py-vobject/vobject/pull/87 remove six
Patch: no-six.patch
BuildRequires: %{python_module PyICU}
BuildRequires: %{python_module devel >= 2.7}
BuildRequires: %{python_module python-dateutil >= 2.7.0}
@@ -35,7 +37,6 @@ BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-python-dateutil >= 2.7.0
Requires: python-pytz
Requires: python-six
Requires(post): update-alternatives
Requires(preun): update-alternatives
Recommends: python-PyICU
@@ -51,7 +52,7 @@ structures to iCalendar, vCard, or (experimentally) hCalendar
unicode strings.
%prep
%setup -q -n %{modname}-%{version}
%autosetup -p1 -n %{modname}-%{version}
# Fix wrong-file-end-of-line-encoding
sed -i 's/\r$//' ACKNOWLEDGEMENTS.txt