Hello community, here is the log from the commit of package python-tldextract for openSUSE:Factory checked in at 2020-10-24 15:18:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-tldextract (Old) and /work/SRC/openSUSE:Factory/.python-tldextract.new.3463 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-tldextract" Sat Oct 24 15:18:22 2020 rev:9 rq:843692 version:3.0.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-tldextract/python-tldextract.changes 2020-10-21 14:39:12.473633253 +0200 +++ /work/SRC/openSUSE:Factory/.python-tldextract.new.3463/python-tldextract.changes 2020-10-24 15:18:46.788304946 +0200 @@ -1,0 +2,9 @@ +Fri Oct 23 21:46:35 UTC 2020 - Mia Herkt <m...@0x0.st> + +- Update to 3.0.1: + * Fix `tlds` property `AttributeError` + (https://github.com/john-kurkowski/tldextract/issues/210) + * Allow `include_psl_private_domains` in global `extract` too + (https://github.com/john-kurkowski/tldextract/issues/210) + +------------------------------------------------------------------- Old: ---- tldextract-3.0.0.tar.gz New: ---- tldextract-3.0.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-tldextract.spec ++++++ --- /var/tmp/diff_new_pack.QPBYBb/_old 2020-10-24 15:18:47.424305677 +0200 +++ /var/tmp/diff_new_pack.QPBYBb/_new 2020-10-24 15:18:47.428305682 +0200 @@ -19,7 +19,7 @@ %define skip_python2 1 %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-tldextract -Version: 3.0.0 +Version: 3.0.1 Release: 0 Summary: Python module to separate the TLD of a URL License: BSD-3-Clause ++++++ tldextract-3.0.0.tar.gz -> tldextract-3.0.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tldextract-3.0.0/CHANGELOG.md new/tldextract-3.0.1/CHANGELOG.md --- old/tldextract-3.0.0/CHANGELOG.md 2020-10-20 17:45:35.000000000 +0200 +++ new/tldextract-3.0.1/CHANGELOG.md 2020-10-22 07:18:06.000000000 +0200 @@ -3,6 +3,12 @@ After upgrading, update your cache file by deleting it or via `tldextract --update`. +## 3.0.1 (2020-10-21) + +* Bugfixes + * Fix `tlds` property `AttributeError` ([#210](https://github.com/john-kurkowski/tldextract/issues/210)) + * Allow `include_psl_private_domains` in global `extract` too ([#210](https://github.com/john-kurkowski/tldextract/issues/210)) + ## 3.0.0 (2020-10-20) No changes since 3.0.0.rc1. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tldextract-3.0.0/PKG-INFO new/tldextract-3.0.1/PKG-INFO --- old/tldextract-3.0.0/PKG-INFO 2020-10-20 17:47:24.984639200 +0200 +++ new/tldextract-3.0.1/PKG-INFO 2020-10-22 07:18:34.948756000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: tldextract -Version: 3.0.0 +Version: 3.0.1 Summary: Accurately separate the TLD from the registered domain and subdomains of a URL, using the Public Suffix List. By default, this includes the public ICANN TLDs and their exceptions. You can optionally support the Public Suffix List's private domains as well. Home-page: https://github.com/john-kurkowski/tldextract Author: John Kurkowski diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tldextract-3.0.0/tests/main_test.py new/tldextract-3.0.1/tests/main_test.py --- old/tldextract-3.0.0/tests/main_test.py 2020-10-11 23:23:20.000000000 +0200 +++ new/tldextract-3.0.1/tests/main_test.py 2020-10-22 07:11:26.000000000 +0200 @@ -8,6 +8,7 @@ import tldextract from tldextract.cache import DiskCache from tldextract.suffix_list import SuffixListNotFound +from tldextract.tldextract import ExtractResult from .helpers import temporary_dir @@ -248,3 +249,23 @@ with pytest.raises(SuffixListNotFound): tldextract.suffix_list.find_first_response(cache, [server], 5) + + +def test_tlds_property(): + extract_private = tldextract.TLDExtract( + cache_dir=None, + suffix_list_urls=None, + include_psl_private_domains=True + ) + extract_public = tldextract.TLDExtract( + cache_dir=None, + suffix_list_urls=None, + include_psl_private_domains=False + ) + assert len(extract_private.tlds) > len(extract_public.tlds) + + +def test_global_extract(): + assert tldextract.extract("foo.blogspot.com") == ExtractResult(subdomain='foo', domain='blogspot', suffix='com') + assert tldextract.extract("foo.blogspot.com", include_psl_private_domains=True) == \ + ExtractResult(subdomain='', domain='foo', suffix='blogspot.com') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tldextract-3.0.0/tldextract/_version.py new/tldextract-3.0.1/tldextract/_version.py --- old/tldextract-3.0.0/tldextract/_version.py 2020-10-20 17:47:24.000000000 +0200 +++ new/tldextract-3.0.1/tldextract/_version.py 2020-10-22 07:18:34.000000000 +0200 @@ -1,4 +1,4 @@ # coding: utf-8 # file generated by setuptools_scm # don't change, don't track in version control -version = '3.0.0' +version = '3.0.1' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tldextract-3.0.0/tldextract/tldextract.py new/tldextract-3.0.1/tldextract/tldextract.py --- old/tldextract-3.0.0/tldextract/tldextract.py 2020-10-11 23:23:20.000000000 +0200 +++ new/tldextract-3.0.1/tldextract/tldextract.py 2020-10-22 07:11:26.000000000 +0200 @@ -206,8 +206,6 @@ >>> extract('http://forums.bbc.co.uk/') ExtractResult(subdomain='forums', domain='bbc', suffix='co.uk') """ - if include_psl_private_domains is None: - include_psl_private_domains = self.include_psl_private_domains netloc = SCHEME_RE.sub("", url) \ .partition("/")[0] \ @@ -242,7 +240,12 @@ @property def tlds(self): - return self._get_tld_extractor().tlds + """ + Returns the list of tld's used by default + + This will vary based on `include_psl_private_domains` and `extra_suffixes` + """ + return list(self._get_tld_extractor().tlds()) def _get_tld_extractor(self): '''Get or compute this object's TLDExtractor. Looks up the TLDExtractor @@ -271,7 +274,8 @@ self._extractor = _PublicSuffixListTLDExtractor( public_tlds=public_tlds, private_tlds=private_tlds, - extra_tlds=list(self.extra_suffixes) + extra_tlds=list(self.extra_suffixes), + include_psl_private_domains=self.include_psl_private_domains ) return self._extractor @@ -280,8 +284,8 @@ @wraps(TLD_EXTRACTOR.__call__) -def extract(url): - return TLD_EXTRACTOR(url) +def extract(url, include_psl_private_domains=False): + return TLD_EXTRACTOR(url, include_psl_private_domains=include_psl_private_domains) @wraps(TLD_EXTRACTOR.update) @@ -289,20 +293,30 @@ return TLD_EXTRACTOR.update(*args, **kwargs) -class _PublicSuffixListTLDExtractor(object): +class _PublicSuffixListTLDExtractor: """Wrapper around this project's main algo for PSL lookups. """ - def __init__(self, public_tlds, private_tlds, extra_tlds): + def __init__(self, public_tlds, private_tlds, extra_tlds, include_psl_private_domains=False): + # set the default value + self.include_psl_private_domains = include_psl_private_domains + self.public_tlds = public_tlds + self.private_tlds = private_tlds self.tlds_incl_private = frozenset(public_tlds + private_tlds + extra_tlds) self.tlds_excl_private = frozenset(public_tlds + extra_tlds) - def suffix_index(self, lower_spl, include_psl_private_domains=False): + def tlds(self, include_psl_private_domains=None): + if include_psl_private_domains is None: + include_psl_private_domains = self.include_psl_private_domains + + return self.tlds_incl_private if include_psl_private_domains else self.tlds_excl_private + + def suffix_index(self, lower_spl, include_psl_private_domains=None): """Returns the index of the first suffix label. Returns len(spl) if no suffix is found """ - tlds = self.tlds_incl_private if include_psl_private_domains else self.tlds_excl_private + tlds = self.tlds(include_psl_private_domains) length = len(lower_spl) for i in range(length): maybe_tld = '.'.join(lower_spl[i:]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tldextract-3.0.0/tldextract.egg-info/PKG-INFO new/tldextract-3.0.1/tldextract.egg-info/PKG-INFO --- old/tldextract-3.0.0/tldextract.egg-info/PKG-INFO 2020-10-20 17:47:24.000000000 +0200 +++ new/tldextract-3.0.1/tldextract.egg-info/PKG-INFO 2020-10-22 07:18:34.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: tldextract -Version: 3.0.0 +Version: 3.0.1 Summary: Accurately separate the TLD from the registered domain and subdomains of a URL, using the Public Suffix List. By default, this includes the public ICANN TLDs and their exceptions. You can optionally support the Public Suffix List's private domains as well. Home-page: https://github.com/john-kurkowski/tldextract Author: John Kurkowski