diff --git a/no-six.patch b/no-six.patch new file mode 100644 index 0000000..6056041 --- /dev/null +++ b/no-six.patch @@ -0,0 +1,36 @@ +Index: robot-detection-0.4.0/robot_detection.py +=================================================================== +--- robot-detection-0.4.0.orig/robot_detection.py ++++ robot-detection-0.4.0/robot_detection.py +@@ -1,7 +1,6 @@ + from __future__ import print_function + + import sys, os.path, codecs, re +-import six + + robot_useragents = [ + 'appie', +@@ -661,7 +660,7 @@ robot_useragents = [ + robot_useragents = [re.compile(x) for x in robot_useragents] + + def is_robot(user_agent): +- if not isinstance(user_agent, six.string_types): ++ if not isinstance(user_agent, str): + raise TypeError + if len(user_agent) == 0: + raise ValueError +Index: robot-detection-0.4.0/setup.py +=================================================================== +--- robot-detection-0.4.0.orig/setup.py ++++ robot-detection-0.4.0/setup.py +@@ -12,9 +12,7 @@ setup(name="robot-detection", + url="https://github.com/rory/robot-detection", + license="GPLv3+", + test_suite='tests', +- install_requires = [ +- "six", +- ], ++ install_requires = [], + classifiers=[ + 'Development Status :: 4 - Beta', + 'Environment :: Web Environment', diff --git a/python-robot-detection.changes b/python-robot-detection.changes index eb6b2c6..033ef14 100644 --- a/python-robot-detection.changes +++ b/python-robot-detection.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jun 7 12:24:11 UTC 2024 - Markéta Machová + +- Add no-six.patch to get rid of the six dependency + ------------------------------------------------------------------- Mon Jun 19 08:02:23 UTC 2023 - Andreas Schneider diff --git a/python-robot-detection.spec b/python-robot-detection.spec index 9b6e35a..d7b0d85 100644 --- a/python-robot-detection.spec +++ b/python-robot-detection.spec @@ -1,7 +1,7 @@ # # spec file for package python-robot-detection # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,6 +16,7 @@ # +%define pypiver 0.4 %{?sle15_python_module_pythons} Name: python-robot-detection Version: 0.4.0 @@ -25,11 +26,11 @@ License: GPL-3.0-or-later URL: https://github.com/rory/robot-detection # https://github.com/rory/robot-detection/issues/2 Source0: https://github.com/rory/robot-detection/archive/v%{version}.tar.gz +# PATCH-FIX-UPSTREAM https://github.com/amandasaurus/robot-detection/pull/3 get rid of six +Patch: no-six.patch BuildRequires: %{python_module setuptools} -BuildRequires: %{python_module six} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-six BuildArch: noarch %python_subpackages @@ -37,7 +38,7 @@ BuildArch: noarch Library for detecting if a HTTP User Agent header is likely to be a bot. %prep -%setup -q -n robot-detection-%{version} +%autosetup -p1 -n robot-detection-%{version} %build %python_build @@ -52,6 +53,8 @@ Library for detecting if a HTTP User Agent header is likely to be a bot. %files %{python_files} %doc README.md %license LICENCE -%{python_sitelib}/* +%{python_sitelib}/robot_detection.py +%{python_sitelib}/robot_detection-%{pypiver}*info +%pycache_only %{python_sitelib}/__pycache__/robot_detection* %changelog