forked from pool/python-python-whois
Accepting request 1110429 from devel:languages:python
- Add patch remove-future-requirement.patch, remove future requirement - Switch to autosetup and pyproject macros - Stop using greedy globs in %files OBS-URL: https://build.opensuse.org/request/show/1110429 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-python-whois?expand=0&rev=7
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Sep 12 05:33:31 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
- Add patch remove-future-requirement.patch, remove future requirement
|
||||||
|
- Switch to autosetup and pyproject macros
|
||||||
|
- Stop using greedy globs in %files
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Aug 9 07:14:05 UTC 2022 - Sebastian Wagner <sebix+novell.com@sebix.at>
|
Tue Aug 9 07:14:05 UTC 2022 - Sebastian Wagner <sebix+novell.com@sebix.at>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-python-whois
|
# spec file for package python-python-whois
|
||||||
#
|
#
|
||||||
# Copyright (c) 2022 SUSE LLC
|
# Copyright (c) 2023 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,28 +16,25 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
||||||
%global skip_python2 1
|
|
||||||
Name: python-python-whois
|
Name: python-python-whois
|
||||||
Version: 0.8.0
|
Version: 0.8.0
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Whois querying and parsing of domain registration information
|
Summary: Whois querying and parsing of domain registration information
|
||||||
License: MIT
|
License: MIT
|
||||||
Group: Development/Languages/Python
|
|
||||||
URL: https://bitbucket.org/richardpenman/pywhois
|
URL: https://bitbucket.org/richardpenman/pywhois
|
||||||
Source: https://files.pythonhosted.org/packages/source/p/python-whois/python-whois-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/p/python-whois/python-whois-%{version}.tar.gz
|
||||||
|
Patch0: remove-future-requirement.patch
|
||||||
|
BuildRequires: %{python_module pip}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
|
BuildRequires: %{python_module wheel}
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
# SECTION test requirements
|
# SECTION test requirements
|
||||||
BuildRequires: %{python_module future}
|
|
||||||
BuildRequires: %{python_module pytest}
|
BuildRequires: %{python_module pytest}
|
||||||
BuildRequires: %{python_module simplejson}
|
BuildRequires: %{python_module simplejson}
|
||||||
# /SECTION
|
# /SECTION
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
Requires: python-future
|
|
||||||
Suggests: python-python-dateutil
|
Suggests: python-python-dateutil
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%python_subpackages
|
%python_subpackages
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@@ -46,15 +43,15 @@ Able to extract data for all the popular TLDs (com, org, net, ...)
|
|||||||
Query a WHOIS server directly instead of going through an intermediate web service like many others do.
|
Query a WHOIS server directly instead of going through an intermediate web service like many others do.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n python-whois-%{version}
|
%autosetup -p1 -n python-whois-%{version}
|
||||||
# requires internet connection:
|
# requires internet connection:
|
||||||
rm test/test_query.py
|
rm test/test_query.py
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_build
|
%pyproject_wheel
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%python_install
|
%pyproject_install
|
||||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
@@ -64,6 +61,7 @@ rm test/test_query.py
|
|||||||
|
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
%{python_sitelib}/*
|
%{python_sitelib}/whois
|
||||||
|
%{python_sitelib}/python_whois-%{version}.dist-info
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
175
remove-future-requirement.patch
Normal file
175
remove-future-requirement.patch
Normal file
@@ -0,0 +1,175 @@
|
|||||||
|
Index: python-whois-0.8.0/test/test_main.py
|
||||||
|
===================================================================
|
||||||
|
--- python-whois-0.8.0.orig/test/test_main.py
|
||||||
|
+++ python-whois-0.8.0/test/test_main.py
|
||||||
|
@@ -1,12 +1,5 @@
|
||||||
|
# coding=utf-8
|
||||||
|
|
||||||
|
-from __future__ import unicode_literals
|
||||||
|
-from __future__ import print_function
|
||||||
|
-from __future__ import division
|
||||||
|
-from __future__ import absolute_import
|
||||||
|
-from future import standard_library
|
||||||
|
-standard_library.install_aliases()
|
||||||
|
-from builtins import *
|
||||||
|
import unittest
|
||||||
|
from whois import extract_domain
|
||||||
|
|
||||||
|
Index: python-whois-0.8.0/test/test_nicclient.py
|
||||||
|
===================================================================
|
||||||
|
--- python-whois-0.8.0.orig/test/test_nicclient.py
|
||||||
|
+++ python-whois-0.8.0/test/test_nicclient.py
|
||||||
|
@@ -1,12 +1,5 @@
|
||||||
|
# coding=utf-8
|
||||||
|
|
||||||
|
-from __future__ import unicode_literals
|
||||||
|
-from __future__ import print_function
|
||||||
|
-from __future__ import division
|
||||||
|
-from __future__ import absolute_import
|
||||||
|
-from future import standard_library
|
||||||
|
-standard_library.install_aliases()
|
||||||
|
-from builtins import *
|
||||||
|
import unittest
|
||||||
|
from whois.whois import NICClient
|
||||||
|
|
||||||
|
Index: python-whois-0.8.0/test/test_parser.py
|
||||||
|
===================================================================
|
||||||
|
--- python-whois-0.8.0.orig/test/test_parser.py
|
||||||
|
+++ python-whois-0.8.0/test/test_parser.py
|
||||||
|
@@ -1,11 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
-from __future__ import print_function
|
||||||
|
-from __future__ import unicode_literals
|
||||||
|
-from __future__ import division
|
||||||
|
-from __future__ import absolute_import
|
||||||
|
-from future import standard_library
|
||||||
|
-standard_library.install_aliases()
|
||||||
|
-from builtins import *
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
import os
|
||||||
|
Index: python-whois-0.8.0/whois/__init__.py
|
||||||
|
===================================================================
|
||||||
|
--- python-whois-0.8.0.orig/whois/__init__.py
|
||||||
|
+++ python-whois-0.8.0/whois/__init__.py
|
||||||
|
@@ -1,12 +1,5 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
-from __future__ import print_function
|
||||||
|
-from __future__ import absolute_import
|
||||||
|
-from __future__ import unicode_literals
|
||||||
|
-from __future__ import division
|
||||||
|
-from future import standard_library
|
||||||
|
-standard_library.install_aliases()
|
||||||
|
-from builtins import *
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
Index: python-whois-0.8.0/whois/parser.py
|
||||||
|
===================================================================
|
||||||
|
--- python-whois-0.8.0.orig/whois/parser.py
|
||||||
|
+++ python-whois-0.8.0/whois/parser.py
|
||||||
|
@@ -6,20 +6,9 @@
|
||||||
|
# This module is part of python-whois and is released under
|
||||||
|
# the MIT license: http://www.opensource.org/licenses/mit-license.php
|
||||||
|
|
||||||
|
-from __future__ import absolute_import
|
||||||
|
-from __future__ import unicode_literals
|
||||||
|
-from __future__ import print_function
|
||||||
|
-from __future__ import division
|
||||||
|
-from future import standard_library
|
||||||
|
-
|
||||||
|
import re
|
||||||
|
from datetime import datetime
|
||||||
|
import json
|
||||||
|
-from past.builtins import basestring
|
||||||
|
-from builtins import str
|
||||||
|
-from builtins import *
|
||||||
|
-
|
||||||
|
-standard_library.install_aliases()
|
||||||
|
|
||||||
|
try:
|
||||||
|
import dateutil.parser as dp
|
||||||
|
@@ -169,7 +158,7 @@ class WhoisEntry(dict):
|
||||||
|
|
||||||
|
def _preprocess(self, attr, value):
|
||||||
|
value = value.strip()
|
||||||
|
- if value and isinstance(value, basestring) and not value.isdigit() and '_date' in attr:
|
||||||
|
+ if value and isinstance(value, str) and not value.isdigit() and '_date' in attr:
|
||||||
|
# try casting to date format
|
||||||
|
value = cast_date(
|
||||||
|
value,
|
||||||
|
@@ -1050,7 +1039,7 @@ class WhoisBr(WhoisEntry):
|
||||||
|
|
||||||
|
def _preprocess(self, attr, value):
|
||||||
|
value = value.strip()
|
||||||
|
- if value and isinstance(value, basestring) and '_date' in attr:
|
||||||
|
+ if value and isinstance(value, str) and '_date' in attr:
|
||||||
|
# try casting to date format
|
||||||
|
value = re.findall(r"[\w\s:.-\\/]+", value)[0].strip()
|
||||||
|
value = cast_date(
|
||||||
|
Index: python-whois-0.8.0/whois/time_zones.py
|
||||||
|
===================================================================
|
||||||
|
--- python-whois-0.8.0.orig/whois/time_zones.py
|
||||||
|
+++ python-whois-0.8.0/whois/time_zones.py
|
||||||
|
@@ -1,10 +1,3 @@
|
||||||
|
-from __future__ import unicode_literals
|
||||||
|
-from __future__ import print_function
|
||||||
|
-from __future__ import division
|
||||||
|
-from __future__ import absolute_import
|
||||||
|
-from future import standard_library
|
||||||
|
-standard_library.install_aliases()
|
||||||
|
-from builtins import *
|
||||||
|
_tz_string = '''-12 Y
|
||||||
|
-11 X NUT SST
|
||||||
|
-10 W CKT HAST HST TAHT TKT
|
||||||
|
Index: python-whois-0.8.0/whois/whois.py
|
||||||
|
===================================================================
|
||||||
|
--- python-whois-0.8.0.orig/whois/whois.py
|
||||||
|
+++ python-whois-0.8.0/whois/whois.py
|
||||||
|
@@ -27,21 +27,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWAR
|
||||||
|
THE SOFTWARE.
|
||||||
|
"""
|
||||||
|
|
||||||
|
-from __future__ import print_function
|
||||||
|
-from __future__ import unicode_literals
|
||||||
|
-from __future__ import division
|
||||||
|
-from __future__ import absolute_import
|
||||||
|
-from future import standard_library
|
||||||
|
-
|
||||||
|
import os
|
||||||
|
import optparse
|
||||||
|
import socket
|
||||||
|
import sys
|
||||||
|
import re
|
||||||
|
-from builtins import object
|
||||||
|
-from builtins import *
|
||||||
|
import logging
|
||||||
|
-standard_library.install_aliases()
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
Index: python-whois-0.8.0/setup.py
|
||||||
|
===================================================================
|
||||||
|
--- python-whois-0.8.0.orig/setup.py
|
||||||
|
+++ python-whois-0.8.0/setup.py
|
||||||
|
@@ -10,9 +10,7 @@ setuptools.setup(
|
||||||
|
version='0.8.0',
|
||||||
|
description="Whois querying and parsing of domain registration information.",
|
||||||
|
long_description=read('README.rst'),
|
||||||
|
- install_requires=[
|
||||||
|
- 'future',
|
||||||
|
- ],
|
||||||
|
+ install_requires=[],
|
||||||
|
classifiers=[
|
||||||
|
'Environment :: Web Environment',
|
||||||
|
'Intended Audience :: Developers',
|
||||||
|
@@ -33,8 +31,6 @@ setuptools.setup(
|
||||||
|
extras_require={
|
||||||
|
'better date conversion': ["python-dateutil"]
|
||||||
|
},
|
||||||
|
- test_suite='nose.collector',
|
||||||
|
- tests_require=['nose', 'simplejson'],
|
||||||
|
include_package_data=True,
|
||||||
|
zip_safe=False
|
||||||
|
)
|
Reference in New Issue
Block a user