From 55d8da65e4616cb1e8629970f0169ae4befed638836e02cdb7bdbead450e4fee Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Wed, 25 Jan 2023 12:58:47 +0000 Subject: [PATCH] - Add py311.patch to make tests compatible with python 3.11 gh#apache/avro#1961 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-avro?expand=0&rev=28 --- py311.patch | 14 ++++++++++++++ python-avro.changes | 5 +++++ python-avro.spec | 7 ++++--- 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 py311.patch diff --git a/py311.patch b/py311.patch new file mode 100644 index 0000000..d07204c --- /dev/null +++ b/py311.patch @@ -0,0 +1,14 @@ +Index: avro-1.11.1/avro/compatibility.py +=================================================================== +--- avro-1.11.1.orig/avro/compatibility.py ++++ avro-1.11.1/avro/compatibility.py +@@ -49,6 +49,9 @@ class SchemaType(str, Enum): + STRING = "string" + UNION = "union" + ++ def __str__(self): ++ return self.value ++ + + class SchemaCompatibilityType(Enum): + compatible = "compatible" diff --git a/python-avro.changes b/python-avro.changes index 1b52388..e2aed3a 100644 --- a/python-avro.changes +++ b/python-avro.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jan 25 12:58:14 UTC 2023 - Daniel Garcia + +- Add py311.patch to make tests compatible with python 3.11 gh#apache/avro#1961 + ------------------------------------------------------------------- Thu Aug 4 09:32:11 UTC 2022 - Otto Hollmann diff --git a/python-avro.spec b/python-avro.spec index cd584b6..ad1e7d0 100644 --- a/python-avro.spec +++ b/python-avro.spec @@ -1,7 +1,7 @@ # # spec file for package python-avro # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,7 +16,6 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-avro Version: 1.11.1 @@ -26,6 +25,8 @@ License: Apache-2.0 Group: Development/Languages/Python URL: https://avro.apache.org/ Source: https://files.pythonhosted.org/packages/source/a/avro/avro-%{version}.tar.gz +# PATCH-FIX-UPSTREAM: py311.patch gh#apache/avro#1961 +Patch: py311.patch BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: fdupes @@ -43,7 +44,7 @@ Apache Avro is a serialization and RPC framework. This package contains the python implementation of Avro. %prep -%setup -q -n avro-%{version} +%autosetup -p1 -n avro-%{version} sed -i '1{\@^#!/usr/bin/env python@d}' avro/*.py avro/tether/*.py avro/test/*.py %build