Sebastian Wagner 2021-07-13 20:36:37 +00:00 committed by Git OBS Bridge
parent 30d8190b59
commit 6d027c6c7b
2 changed files with 42 additions and 27 deletions

View File

@ -1,11 +1,36 @@
From a3152e9e77850aa741976e7e492ab98b672be536 Mon Sep 17 00:00:00 2001
From: "Dishy.Dev" <dishy@dev> From: "Dishy.Dev" <dishy@dev>
Date: Sun, 8 Nov 2020 08:15:57 +0000 Date: Sun, 8 Nov 2020 08:15:57 +0000
Subject: [PATCH] Removing unused urllib3 dependency, loosening requests Subject: [PATCH] Removing unused urllib3 dependency, loosening requests
version requirement and making aiohttp and requests optional installs version requirement and making aiohttp and requests optional installs
diff -Nru geoip2-4.2.0.orig/geoip2/webservice.py geoip2-4.2.0/geoip2/webservice.py ---
--- geoip2-4.2.0.orig/geoip2/webservice.py 2020-12-10 18:47:00.000000000 +0100 .github/workflows/lint.yml | 2 +-
+++ geoip2-4.2.0/geoip2/webservice.py 2021-07-13 11:55:41.952344432 +0200 README.rst | 3 +++
geoip2/webservice.py | 46 +++++++++++++++++++++++++++++---------
requirements.txt | 3 ---
setup.cfg | 2 ++
setup.py | 5 +++++
6 files changed, 46 insertions(+), 15 deletions(-)
diff --git a/README.rst b/README.rst
index a17082e..8969781 100644
--- a/README.rst
+++ b/README.rst
@@ -19,6 +19,9 @@ To install the ``geoip2`` module, type:
.. code-block:: bash
$ pip install geoip2
+ $ pip install geoip2[aiohttp]
+ $ pip install geoip2[requests]
+ $ pip install geoip2[all] # Install both requests and aiohttp support
If you are not able to use pip, you may also use easy_install from the
source directory:
diff --git a/geoip2/webservice.py b/geoip2/webservice.py
index 4b1fc15..6ab0e84 100644
--- a/geoip2/webservice.py
+++ b/geoip2/webservice.py
@@ -27,12 +27,21 @@ @@ -27,12 +27,21 @@
import ipaddress import ipaddress
@ -68,30 +93,19 @@ diff -Nru geoip2-4.2.0.orig/geoip2/webservice.py geoip2-4.2.0/geoip2/webservice.
class BaseClient: # pylint: disable=missing-class-docstring, too-few-public-methods class BaseClient: # pylint: disable=missing-class-docstring, too-few-public-methods
diff -Nru geoip2-4.2.0.orig/README.rst geoip2-4.2.0/README.rst diff --git a/requirements.txt b/requirements.txt
--- geoip2-4.2.0.orig/README.rst 2021-05-12 18:10:23.000000000 +0200 index af2c6ff..9c772e4 100644
+++ geoip2-4.2.0/README.rst 2021-07-13 11:55:41.952344432 +0200 --- a/requirements.txt
@@ -19,6 +19,9 @@ +++ b/requirements.txt
.. code-block:: bash
$ pip install geoip2
+ $ pip install geoip2[aiohttp]
+ $ pip install geoip2[requests]
+ $ pip install geoip2[all] # Install both requests and aiohttp support
If you are not able to use pip, you may also use easy_install from the
source directory:
diff -Nru geoip2-4.2.0.orig/requirements.txt geoip2-4.2.0/requirements.txt
--- geoip2-4.2.0.orig/requirements.txt 2020-07-28 19:27:21.000000000 +0200
+++ geoip2-4.2.0/requirements.txt 2021-07-13 11:55:41.952344432 +0200
@@ -1,4 +1 @@ @@ -1,4 +1 @@
-aiohttp>=3.6.2,<4.0.0 -aiohttp>=3.6.2,<4.0.0
maxminddb>=2.0.0,<3.0.0 maxminddb>=2.0.0,<3.0.0
-requests>=2.24.0,<3.0.0 -requests>=2.24.0,<3.0.0
-urllib3>=1.25.2,<2.0.0 -urllib3>=1.25.2,<2.0.0
diff -Nru geoip2-4.2.0.orig/setup.cfg geoip2-4.2.0/setup.cfg diff --git a/setup.cfg b/setup.cfg
--- geoip2-4.2.0.orig/setup.cfg 2021-05-12 18:12:14.163335000 +0200 index 9d48adc..c77568d 100644
+++ geoip2-4.2.0/setup.cfg 2021-07-13 11:57:15.737814093 +0200 --- a/setup.cfg
+++ b/setup.cfg
@@ -22,8 +22,9 @@ @@ -22,8 +22,9 @@
pytest pytest
mocket mocket
@ -103,9 +117,10 @@ diff -Nru geoip2-4.2.0.orig/setup.cfg geoip2-4.2.0/setup.cfg
tag_build = tag_build =
tag_date = 0 tag_date = 0
- -
diff -Nru geoip2-4.2.0.orig/setup.py geoip2-4.2.0/setup.py diff --git a/setup.py b/setup.py
--- geoip2-4.2.0.orig/setup.py 2020-09-25 17:00:20.000000000 +0200 index 2194e8f..14b6d99 100644
+++ geoip2-4.2.0/setup.py 2021-07-13 11:55:41.952344432 +0200 --- a/setup.py
+++ b/setup.py
@@ -26,6 +26,11 @@ @@ -26,6 +26,11 @@
include_package_data=True, include_package_data=True,
python_requires=">=3.6", python_requires=">=3.6",

View File

@ -17,7 +17,6 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without test
Name: python-geoip2 Name: python-geoip2
Version: 4.2.0 Version: 4.2.0
Release: 0 Release: 0
@ -26,6 +25,7 @@ License: Apache-2.0
Group: Development/Languages/Python Group: Development/Languages/Python
URL: https://github.com/maxmind/GeoIP2-python URL: https://github.com/maxmind/GeoIP2-python
Source: https://files.pythonhosted.org/packages/source/g/geoip2/geoip2-%{version}.tar.gz#/%{name}-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/g/geoip2/geoip2-%{version}.tar.gz#/%{name}-%{version}.tar.gz
# PATCH-FIX-OPENSUSE 0001-Removing-unused-urllib3-dependency-loosening-request.patch -- Removing unused urllib3 dependency loosening requests version based on https://github.com/maxmind/GeoIP2-python/pull/104.patch
Patch0: 0001-Removing-unused-urllib3-dependency-loosening-request.patch Patch0: 0001-Removing-unused-urllib3-dependency-loosening-request.patch
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: fdupes BuildRequires: fdupes
@ -37,7 +37,7 @@ BuildRequires: %{python_module mocket >= 3.8.9}
BuildRequires: %{python_module python-magic >= 0.4.18} BuildRequires: %{python_module python-magic >= 0.4.18}
BuildRequires: %{python_module requests >= 2.14.0} BuildRequires: %{python_module requests >= 2.14.0}
# /SECTION # /SECTION
Requires: python-aiohttp >= 3.6.2 Recommends: python-aiohttp >= 3.6.2
Requires: python-maxminddb >= 2.0.0 Requires: python-maxminddb >= 2.0.0
Requires: python-requests >= 2.14.0 Requires: python-requests >= 2.14.0
BuildArch: noarch BuildArch: noarch