From 846ca81359ac846dbb702edb8c01ad73b52a6dc148710a5509f7e21149fea3a3 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Thu, 25 Feb 2021 20:11:51 +0000 Subject: [PATCH] - add fix-setup-encoding.patch to fix encoding issues in setup.py - Skip Python 2. - run the tests. - remove add-license.patch, included in upstream OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-exrex?expand=0&rev=13 --- fix-setup-encoding.patch | 23 +++++++++++++++++++++++ python-exrex.changes | 6 ++++-- python-exrex.spec | 6 +++++- 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 fix-setup-encoding.patch diff --git a/fix-setup-encoding.patch b/fix-setup-encoding.patch new file mode 100644 index 0000000..dee8eb8 --- /dev/null +++ b/fix-setup-encoding.patch @@ -0,0 +1,23 @@ +From 09a1ef0962268460f66084a992fee1aff77dc141 Mon Sep 17 00:00:00 2001 +From: Sebastian Wagner +Date: Thu, 25 Feb 2021 21:03:56 +0100 +Subject: [PATCH] setup.py: declare encoding as utf-8 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +the ellipsis (…) causes troubles otherwise on "old" python versions as +3.6 +--- + setup.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/setup.py b/setup.py +index 29c5a87..475a86f 100644 +--- a/setup.py ++++ b/setup.py +@@ -1,3 +1,4 @@ ++# -*- coding: utf-8 -*- + import io + import os + import sys diff --git a/python-exrex.changes b/python-exrex.changes index 5f5a396..8e51e83 100644 --- a/python-exrex.changes +++ b/python-exrex.changes @@ -1,8 +1,10 @@ ------------------------------------------------------------------- Thu Feb 25 19:25:16 UTC 2021 - Sebastian Wagner -- run the tests -- remove add-license.patch +- add fix-setup-encoding.patch to fix encoding issues in setup.py +- Skip Python 2. +- run the tests. +- remove add-license.patch, included in upstream - Update to revision 49909345: - Fix: added py_modules - Fix: Typo in email address diff --git a/python-exrex.spec b/python-exrex.spec index 8518ebc..ffb0aaf 100644 --- a/python-exrex.spec +++ b/python-exrex.spec @@ -18,6 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define revision fd1e21ffc7c16fd5637a5c440224766417e840f9 +%define skip_python2 1 Name: python-exrex Version: 0.10.5+git119 Release: 0 @@ -27,6 +28,8 @@ Group: Development/Languages/Python URL: https://github.com/asciimoo/exrex #Source: https://files.pythonhosted.org/packages/source/e/exrex/exrex-%%{version}.tar.gz Source: https://github.com/asciimoo/exrex/archive/%{revision}.tar.gz#/exrex-%{version}.tar.gz +# PATCH-FIX-UPSTREAM fix-setup-encoding.patch +Patch0: https://github.com/asciimoo/exrex/pull/53.patch#/fix-setup-encoding.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -42,6 +45,7 @@ A command line tool and python module that generates all or random matching stri %prep %setup -q -n exrex-%{revision} sed -i '1s/^#!.*//' exrex.py +%patch0 -p1 %build %python_build @@ -54,7 +58,7 @@ rm %{buildroot}%{_bindir}/exrex.py %check %{python_expand # comment -PYTHONPATH=%{buildroot}%{$python_sitelib} $python ./tests.py} +LANG=C.UTF-8 PYTHONPATH=%{buildroot}%{$python_sitelib} $python ./tests.py} %post %python_install_alternative exrex