From ad70639823d4f8d19f60737f01038930baabdd35a0909942b0c412cf1dea8004 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 10 Feb 2023 22:55:20 +0000 Subject: [PATCH] - Add remove-simplejson.patch (openSUSE only, upstream in more recent commits switched to ujson). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-copr-cli?expand=0&rev=12 --- python-copr-cli.changes | 6 ++++ python-copr-cli.spec | 11 +++++-- remove-simplejson.patch | 65 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 remove-simplejson.patch diff --git a/python-copr-cli.changes b/python-copr-cli.changes index f23e586..cf16ba1 100644 --- a/python-copr-cli.changes +++ b/python-copr-cli.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Feb 10 22:45:01 UTC 2023 - Matej Cepl + +- Add remove-simplejson.patch (openSUSE only, upstream in more + recent commits switched to ujson). + ------------------------------------------------------------------- Fri Feb 10 10:05:34 UTC 2023 - Dirk Müller diff --git a/python-copr-cli.spec b/python-copr-cli.spec index abf075d..ca8c4e5 100644 --- a/python-copr-cli.spec +++ b/python-copr-cli.spec @@ -23,6 +23,10 @@ Summary: Copr cli License: GPL-2.0-or-later URL: https://github.com/fedora-copr/copr Source: https://files.pythonhosted.org/packages/source/c/copr-cli/copr-cli-%{version}.tar.gz +# PATCH-FIX-OPENSUSE remove-simplejson.patch mcepl@suse.com +# Remove dependency on simplejson +# (not upstream, which on master switched to ujson) +Patch0: remove-simplejson.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -33,7 +37,6 @@ Requires: python-future Requires: python-humanize Requires: python-requests-gssapi Requires: python-responses -Requires: python-simplejson BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module Jinja2} @@ -44,15 +47,17 @@ BuildRequires: %{python_module humanize} BuildRequires: %{python_module pytest} BuildRequires: %{python_module requests-gssapi} BuildRequires: %{python_module responses} -BuildRequires: %{python_module simplejson} # /SECTION +Requires(post): update-alternatives +Requires(postun):update-alternatives %python_subpackages %description CLI tool to run copr. %prep -%setup -q -n copr-cli-%{version} +%autosetup -p1 -n copr-cli-%{version} + sed -i '1{/#!/d}' copr_cli/package_build_order.py %build diff --git a/remove-simplejson.patch b/remove-simplejson.patch new file mode 100644 index 0000000..a6d32d7 --- /dev/null +++ b/remove-simplejson.patch @@ -0,0 +1,65 @@ +--- + copr-cli.spec | 4 ---- + copr_cli/util.py | 4 ++-- + setup.py | 1 - + 3 files changed, 2 insertions(+), 7 deletions(-) + +--- a/copr-cli.spec ++++ b/copr-cli.spec +@@ -32,7 +32,6 @@ BuildRequires: util-linux + %if %{with python3} + Requires: python3-copr >= %min_python_copr_version + Requires: python3-jinja2 +-Requires: python3-simplejson + Requires: python3-humanize + Requires: python3-koji + Requires: python3-future +@@ -47,13 +46,11 @@ BuildRequires: python3-humanize + BuildRequires: python3-pytest + BuildRequires: python3-responses + BuildRequires: python3-setuptools +-BuildRequires: python3-simplejson + BuildRequires: python3-munch + BuildRequires: python3-future + %else + Requires: python-copr >= %min_python_copr_version + Requires: python-jinja2 +-Requires: python-simplejson + Requires: python-humanize + Requires: python-future + +@@ -65,7 +62,6 @@ BuildRequires: python-humanize + BuildRequires: python-mock + BuildRequires: python2-responses + BuildRequires: python-setuptools +-BuildRequires: python-simplejson + BuildRequires: python-munch + BuildRequires: python-future + %endif +--- a/copr_cli/util.py ++++ b/copr_cli/util.py +@@ -1,7 +1,7 @@ + # coding: utf-8 + + import humanize +-import simplejson ++import json + + + try: +@@ -66,4 +66,4 @@ def serializable(result): + + + def json_dumps(result): +- return simplejson.dumps(serializable(result), indent=4, sort_keys=True, for_json=True) ++ return json.dumps(serializable(result), indent=4, sort_keys=True) +--- a/setup.py ++++ b/setup.py +@@ -16,7 +16,6 @@ This part is a command line interface to + requires = [ + 'copr', + 'humanize', +- 'simplejson', + 'jinja2', + 'setuptools', + 'future',