forked from pool/python-robot-detection
Accepting request 1179217 from home:mcalabkova:branches:devel:languages:python
- Add no-six.patch to get rid of the six dependency OBS-URL: https://build.opensuse.org/request/show/1179217 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-robot-detection?expand=0&rev=6
This commit is contained in:
36
no-six.patch
Normal file
36
no-six.patch
Normal 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',
|
@@ -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>
|
Mon Jun 19 08:02:23 UTC 2023 - Andreas Schneider <asn@cryptomilk.org>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-robot-detection
|
# 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
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
%define pypiver 0.4
|
||||||
%{?sle15_python_module_pythons}
|
%{?sle15_python_module_pythons}
|
||||||
Name: python-robot-detection
|
Name: python-robot-detection
|
||||||
Version: 0.4.0
|
Version: 0.4.0
|
||||||
@@ -25,11 +26,11 @@ License: GPL-3.0-or-later
|
|||||||
URL: https://github.com/rory/robot-detection
|
URL: https://github.com/rory/robot-detection
|
||||||
# https://github.com/rory/robot-detection/issues/2
|
# https://github.com/rory/robot-detection/issues/2
|
||||||
Source0: https://github.com/rory/robot-detection/archive/v%{version}.tar.gz
|
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 setuptools}
|
||||||
BuildRequires: %{python_module six}
|
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
Requires: python-six
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%python_subpackages
|
%python_subpackages
|
||||||
|
|
||||||
@@ -37,7 +38,7 @@ BuildArch: noarch
|
|||||||
Library for detecting if a HTTP User Agent header is likely to be a bot.
|
Library for detecting if a HTTP User Agent header is likely to be a bot.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n robot-detection-%{version}
|
%autosetup -p1 -n robot-detection-%{version}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_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}
|
%files %{python_files}
|
||||||
%doc README.md
|
%doc README.md
|
||||||
%license LICENCE
|
%license LICENCE
|
||||||
%{python_sitelib}/*
|
%{python_sitelib}/robot_detection.py
|
||||||
|
%{python_sitelib}/robot_detection-%{pypiver}*info
|
||||||
|
%pycache_only %{python_sitelib}/__pycache__/robot_detection*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Reference in New Issue
Block a user