14
0

Accepting request 1179857 from devel:languages:python

Forwarded request #1179217 from mcalabkova

- Add no-six.patch to get rid of the six dependency

OBS-URL: https://build.opensuse.org/request/show/1179857
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-robot-detection?expand=0&rev=4
This commit is contained in:
2024-06-11 16:29:35 +00:00
committed by Git OBS Bridge
3 changed files with 49 additions and 5 deletions

36
no-six.patch Normal file
View File

@@ -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',

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Jun 7 12:24:11 UTC 2024 - Markéta Machová <mmachova@suse.com>
- Add no-six.patch to get rid of the six dependency
-------------------------------------------------------------------
Mon Jun 19 08:02:23 UTC 2023 - Andreas Schneider <asn@cryptomilk.org>

View File

@@ -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