14
0
forked from pool/python-tld

Accepting request 731290 from devel:languages:python

- Update to 0.9.6:
  * Fix for update-tld-names returns a non-zero exit code on success
  * Minor tests improvements.

- update to version 0.9.5:
  - Tests improvements.
- update to version 0.9.4:
  - Optimisations in setup.py, tests and console scripts.
  - Skip testing the update-tld-names functionality if no internet is available.
- add skip_internet_tests.patch
- remove remove-download-test.patch

OBS-URL: https://build.opensuse.org/request/show/731290
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-tld?expand=0&rev=7
This commit is contained in:
2019-09-27 12:48:44 +00:00
committed by Git OBS Bridge
6 changed files with 42 additions and 48 deletions

View File

@@ -1,3 +1,21 @@
-------------------------------------------------------------------
Mon Sep 16 13:21:10 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 0.9.6:
* Fix for update-tld-names returns a non-zero exit code on success
* Minor tests improvements.
-------------------------------------------------------------------
Sat Sep 14 20:05:33 UTC 2019 - Sebastian Wagner <sebix+novell.com@sebix.at>
- update to version 0.9.5:
- Tests improvements.
- update to version 0.9.4:
- Optimisations in setup.py, tests and console scripts.
- Skip testing the update-tld-names functionality if no internet is available.
- add skip_internet_tests.patch
- remove remove-download-test.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Sun Apr 7 11:31:45 UTC 2019 - Sebastian Wagner <sebix+novell.com@sebix.at> Sun Apr 7 11:31:45 UTC 2019 - Sebastian Wagner <sebix+novell.com@sebix.at>

View File

@@ -18,15 +18,15 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-tld Name: python-tld
Version: 0.9.3 Version: 0.9.6
Release: 0 Release: 0
Summary: URL top level domain (TLD) extraction module Summary: URL top level domain (TLD) extraction module
License: MPL-1.1 OR GPL-2.0-only OR LGPL-2.1-only License: MPL-1.1 OR GPL-2.0-only OR LGPL-2.1-only
Group: Development/Languages/Python Group: Development/Languages/Python
Url: https://github.com/barseghyanartur/tld Url: https://github.com/barseghyanartur/tld
Source: https://files.pythonhosted.org/packages/source/t/tld/tld-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/t/tld/tld-%{version}.tar.gz
# PATCH-FIX-OPENSUSE remove-download-test.patch # PATCH-FIX-OPENSUSE skip_internet_tests.patch
Patch0: remove-download-test.patch Patch0: skip_internet_tests.patch
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
# SECTION test requirements # SECTION test requirements
@@ -49,7 +49,7 @@ A list of TLD names is taken from Mozillas public suffix list:
%prep %prep
%setup -q -n tld-%{version} %setup -q -n tld-%{version}
sed -i '1s/^#!.*/#!\/usr\/bin\/python3/' src/tld/bin/update-tld-names #sed -i '1s/^#!.*/#!\/usr\/bin\/python3/' src/tld/bin/update-tld-names
%patch0 -p1 %patch0 -p1
%build %build

View File

@@ -1,41 +0,0 @@
--- tld-0.9.2/src/tld/tests/test_core.py 2019-01-10 22:54:41.000000000 +0100
+++ tld-0.9.2/src/tld/tests/test_core.py 2019-01-15 21:40:19.489828184 +0100
@@ -296,13 +296,6 @@
return res
@log_info
- def test_1_update_tld_names(self):
- """Test updating the tld names (re-fetch mozilla source)."""
- res = update_tld_names(fail_silently=True)
- self.assertTrue(res)
- return res
-
- @log_info
def test_2_fld_good_patterns_pass(self):
"""Test good URL patterns."""
res = []
--- tld-0.9.2/src/tld/tests/test_commands.py 2019-01-10 22:54:41.000000000 +0100
+++ tld-0.9.2/src/tld/tests/test_commands1.py 2019-01-15 21:51:14.998679024 +0100
@@ -23,22 +23,6 @@
def setUp(self):
"""Set up."""
- @log_info
- def test_1_update_tld_names_command(self):
- """Test updating the tld names (re-fetch mozilla source)."""
- res = subprocess.check_output(shlex.split('update-tld-names')).strip()
- self.assertEqual(res, b'True')
- return res
-
- @log_info
- def test_2_update_tld_names_module(self):
- """Test updating the tld names (re-fetch mozilla source)."""
- res = subprocess.check_output(
- shlex.split('python src/tld/commands/update_tld_names.py')
- ).strip()
- self.assertEqual(res, b'True')
- return res
-
if __name__ == '__main__':
unittest.main()

17
skip_internet_tests.patch Normal file
View File

@@ -0,0 +1,17 @@
--- tld-0.9.5/src/tld/tests/base.py 2019-09-11 01:17:41.000000000 +0200
+++ tld-0.9.5/src/tld/tests/base.py 2019-09-14 22:20:02.920343051 +0200
@@ -55,13 +55,7 @@
OpenPort: 53/tcp
Service: domain (DNS/TCP)
"""
- try:
- socket.setdefaulttimeout(timeout)
- socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect((host, port))
- return True
- except socket.error as ex:
- print(ex)
- return False
+ return False
def internet_available_only(func):

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f766638e4e972445ce18e4dc0fadc0189c0a2a4f7d15e50c3c25d49af9cb1744
size 247523

3
tld-0.9.6.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:89a7a403a4a5de1ca7b64550df8a8a2abdfbbd1556e1b8cdfe251c0f90ab2f3a
size 251010