diff --git a/python-user_agent-no-six.patch b/python-user_agent-no-six.patch new file mode 100644 index 0000000..7eeb7fa --- /dev/null +++ b/python-user_agent-no-six.patch @@ -0,0 +1,69 @@ +Index: user_agent-0.1.10/setup.py +=================================================================== +--- user_agent-0.1.10.orig/setup.py ++++ user_agent-0.1.10/setup.py +@@ -24,7 +24,6 @@ setup( + # Package files + packages=['user_agent'], + include_package_data=True, +- install_requires=['six'], + entry_points={ + 'console_scripts': [ + 'ua = user_agent.cli:script_ua', +@@ -33,7 +32,6 @@ setup( + # Topics + classifiers=[ + 'Programming Language :: Python', +- 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', +Index: user_agent-0.1.10/test/user_agent.py +=================================================================== +--- user_agent-0.1.10.orig/test/user_agent.py ++++ user_agent-0.1.10/test/user_agent.py +@@ -7,7 +7,6 @@ import json + from datetime import datetime + from copy import deepcopy + +-import six + import pytest + + import user_agent.base +@@ -134,7 +133,7 @@ def test_data_integrity(): + for _ in range(50): + nav = generate_navigator() + for _, val in nav.items(): +- assert val is None or isinstance(val, six.string_types) ++ assert val is None or isinstance(val, str) + + + def test_ua_script_simple(): +Index: user_agent-0.1.10/user_agent.egg-info/requires.txt +=================================================================== +--- user_agent-0.1.10.orig/user_agent.egg-info/requires.txt ++++ user_agent-0.1.10/user_agent.egg-info/requires.txt +@@ -1 +0,0 @@ +-six +Index: user_agent-0.1.10/user_agent/base.py +=================================================================== +--- user_agent-0.1.10.orig/user_agent/base.py ++++ user_agent-0.1.10/user_agent/base.py +@@ -38,8 +38,6 @@ from random import SystemRandom + from datetime import datetime, timedelta + from itertools import product + +-import six +- + from .warning import warn + # pylint: disable=unused-import + from .device import SMARTPHONE_DEV_IDS, TABLET_DEV_IDS +@@ -408,7 +406,7 @@ def get_option_choices(opt_name, opt_val + """ + + choices = [] +- if isinstance(opt_value, six.string_types): ++ if isinstance(opt_value, str): + choices = [opt_value] + elif isinstance(opt_value, (list, tuple)): + choices = list(opt_value) diff --git a/python-user_agent.changes b/python-user_agent.changes index 850a7d4..b325743 100644 --- a/python-user_agent.changes +++ b/python-user_agent.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Jun 6 13:51:11 UTC 2023 - pgajdos@suse.com + +- do not require six +- added patches + https://github.com/lorien/user_agent/commit/7a664a50cb1633a355a56594e255583a821176ba + + python-user_agent-no-six.patch + ------------------------------------------------------------------- Tue Oct 11 16:46:07 UTC 2022 - Yogalakshmi Arunachalam diff --git a/python-user_agent.spec b/python-user_agent.spec index 0d4916a..4ff0a8c 100644 --- a/python-user_agent.spec +++ b/python-user_agent.spec @@ -1,7 +1,7 @@ # # spec file for package python-user_agent # -# 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-%{**}} Name: python-user_agent Version: 0.1.10 Release: 0 @@ -25,11 +24,11 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/lorien/user_agent Source: https://files.pythonhosted.org/packages/source/u/user_agent/user_agent-%{version}.tar.gz +# https://github.com/lorien/user_agent/commit/7a664a50cb1633a355a56594e255583a821176ba +Patch0: python-user_agent-no-six.patch BuildRequires: %{python_module setuptools} -BuildRequires: %{python_module six} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-six Requires(post): update-alternatives Requires(postun):update-alternatives BuildArch: noarch @@ -42,7 +41,7 @@ BuildRequires: %{python_module pytest} This module generates random, valid web user agents. %prep -%setup -q -n user_agent-%{version} +%autosetup -p1 -n user_agent-%{version} %build %python_build @@ -65,6 +64,7 @@ This module generates random, valid web user agents. %files %{python_files} %license LICENSE %python_alternative %{_bindir}/ua -%{python_sitelib}/* +%{python_sitelib}/user_agent +%{python_sitelib}/user_agent-*.egg-info %changelog