Hello community, here is the log from the commit of package python-cssselect2 for openSUSE:Factory checked in at 2020-04-07 10:19:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-cssselect2 (Old) and /work/SRC/openSUSE:Factory/.python-cssselect2.new.3248 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-cssselect2" Tue Apr 7 10:19:28 2020 rev:6 rq:790649 version:0.3.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-cssselect2/python-cssselect2.changes 2019-09-23 12:09:23.221885787 +0200 +++ /work/SRC/openSUSE:Factory/.python-cssselect2.new.3248/python-cssselect2.changes 2020-04-07 10:19:35.785714054 +0200 @@ -1,0 +2,7 @@ +Wed Apr 1 14:58:45 UTC 2020 - Marketa Calabkova <mcalabk...@suse.com> + +- Update to 0.3.0 + * Drop Python2 support + * Improve packaging and testing + +------------------------------------------------------------------- Old: ---- cssselect2-0.2.2.tar.gz New: ---- cssselect2-0.3.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-cssselect2.spec ++++++ --- /var/tmp/diff_new_pack.i4s1wa/_old 2020-04-07 10:19:36.649715016 +0200 +++ /var/tmp/diff_new_pack.i4s1wa/_new 2020-04-07 10:19:36.653715019 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-cssselect2 # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,21 +19,23 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-cssselect2 -Version: 0.2.2 +Version: 0.3.0 Release: 0 Summary: CSS selectors for Python ElementTree License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/Kozea/cssselect2/ Source: https://files.pythonhosted.org/packages/source/c/cssselect2/cssselect2-%{version}.tar.gz -BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module setuptools >= 39.2.0} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-tinycss2 +Requires: python-webencodings BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module pytest} BuildRequires: %{python_module tinycss2} +BuildRequires: %{python_module webencodings} # /SECTION %python_subpackages @@ -49,6 +51,7 @@ %prep %setup -q -n cssselect2-%{version} sed -i '/addopts/d' setup.cfg +sed -i -e 's/pytest-.*//' setup.cfg %build %python_build @@ -62,7 +65,7 @@ %pytest cssselect2/tests %files %{python_files} -%doc CHANGES README.rst +%doc README.rst %license LICENSE %{python_sitelib}/* ++++++ cssselect2-0.2.2.tar.gz -> cssselect2-0.3.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/.coveragerc new/cssselect2-0.3.0/.coveragerc --- old/cssselect2-0.2.2/.coveragerc 2017-06-17 23:22:17.000000000 +0200 +++ new/cssselect2-0.3.0/.coveragerc 1970-01-01 01:00:00.000000000 +0100 @@ -1,10 +0,0 @@ -[run] -branch = True - -[report] -exclude_lines = - pragma: no cover - def __repr__ - raise NotImplementedError -omit = - .* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/.gitignore new/cssselect2-0.3.0/.gitignore --- old/cssselect2-0.2.2/.gitignore 2017-06-17 23:38:10.000000000 +0200 +++ new/cssselect2-0.3.0/.gitignore 1970-01-01 01:00:00.000000000 +0100 @@ -1,10 +0,0 @@ -*.pyc -*.egg-info -/.cache -/.coverage -/.eggs -/build -/dist -/env -/htmlcov -/profile diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/.travis.yml new/cssselect2-0.3.0/.travis.yml --- old/cssselect2-0.2.2/.travis.yml 2019-06-30 21:51:15.000000000 +0200 +++ new/cssselect2-0.3.0/.travis.yml 1970-01-01 01:00:00.000000000 +0100 @@ -1,29 +0,0 @@ -language: python -sudo: false - -git: - submodules: false - -matrix: - include: - - os: linux - python: 2.7 - - os: linux - python: 3.5 - - os: linux - python: 3.6 - - dist: xenial - python: 3.7 - - os: osx - language: generic - env: PYTHON_VERSION=3 - -before_install: - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew pin numpy gdal postgis; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew upgrade python; fi - -install: - - pip$PYTHON_VERSION install --upgrade -e.[test] - -script: - - python$PYTHON_VERSION setup.py test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/CHANGES new/cssselect2-0.3.0/CHANGES --- old/cssselect2-0.2.2/CHANGES 2019-09-06 10:48:44.000000000 +0200 +++ new/cssselect2-0.3.0/CHANGES 1970-01-01 01:00:00.000000000 +0100 @@ -1,37 +0,0 @@ -cssselect2 changelog -==================== - - -Version 0.2.2 -------------- - -Released on 2019-09-06. - -* Optimize lang attribute selectors. - - -Version 0.2.1 -------------- - -Released on 2017-10-02. - -* Fix documentation. - - -Version 0.2.0 -------------- - -Released on 2017-08-16. - -* Fix some selectors for HTML documents with no namespace. -* Don't crash when the attribute comparator is unknown. -* Don't crash when there are empty attribute classes. -* Follow semantic versioning. - - -Version 0.1 ------------ - -Released on 2017-07-07. - -* Initial release. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/MANIFEST.in new/cssselect2-0.3.0/MANIFEST.in --- old/cssselect2-0.2.2/MANIFEST.in 2017-06-17 22:33:38.000000000 +0200 +++ new/cssselect2-0.3.0/MANIFEST.in 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -include README.rst CHANGES LICENSE tox.ini .coveragerc -recursive-include docs * -prune docs/_build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/PKG-INFO new/cssselect2-0.3.0/PKG-INFO --- old/cssselect2-0.2.2/PKG-INFO 2019-09-06 10:49:59.000000000 +0200 +++ new/cssselect2-0.3.0/PKG-INFO 2020-03-16 22:26:28.000000000 +0100 @@ -1,11 +1,15 @@ Metadata-Version: 2.1 Name: cssselect2 -Version: 0.2.2 +Version: 0.3.0 Summary: CSS selectors for Python ElementTree -Home-page: http://packages.python.org/cssselect2/ +Home-page: https://cssselect2.readthedocs.io/ Author: Simon Sapin -Author-email: simon.sa...@exyr.org +Author-email: commun...@kozea.fr License: BSD +Project-URL: Documentation, https://cssselect2.readthedocs.io/ +Project-URL: Code, https://github.com/Kozea/cssselect2/ +Project-URL: Issue tracker, https://github.com/Kozea/cssselect2/issues +Project-URL: Donation, https://www.patreon.com/kozea Description: cssselect2: CSS selectors for Python ElementTree ################################################ @@ -28,12 +32,27 @@ Quick facts: * Free software: BSD licensed - * Compatible with Python 2.7+ and 3.3+ + * Compatible with Python 3.5+ * Latest documentation: http://cssselect2.readthedocs.io/ * Source, issues and pull requests `on Github <https://github.com/Kozea/cssselect2/>`_ * Releases `on PyPI <http://pypi.python.org/pypi/cssselect2>`_ * Install with ``pip install cssselect2`` -Platform: UNKNOWN +Keywords: css,elementtree +Platform: Linux +Platform: macOS +Platform: Windows +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Topic :: Internet :: WWW/HTTP +Requires-Python: >=3.5 +Description-Content-Type: text/x-rst +Provides-Extra: doc Provides-Extra: test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/README.rst new/cssselect2-0.3.0/README.rst --- old/cssselect2-0.2.2/README.rst 2017-10-01 00:42:21.000000000 +0200 +++ new/cssselect2-0.3.0/README.rst 2020-01-26 14:18:10.000000000 +0100 @@ -20,7 +20,7 @@ Quick facts: * Free software: BSD licensed -* Compatible with Python 2.7+ and 3.3+ +* Compatible with Python 3.5+ * Latest documentation: http://cssselect2.readthedocs.io/ * Source, issues and pull requests `on Github <https://github.com/Kozea/cssselect2/>`_ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/cssselect2/VERSION new/cssselect2-0.3.0/cssselect2/VERSION --- old/cssselect2-0.2.2/cssselect2/VERSION 1970-01-01 01:00:00.000000000 +0100 +++ new/cssselect2-0.3.0/cssselect2/VERSION 2020-03-16 22:22:15.000000000 +0100 @@ -0,0 +1 @@ +0.3.0 \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/cssselect2/__init__.py new/cssselect2-0.3.0/cssselect2/__init__.py --- old/cssselect2-0.2.2/cssselect2/__init__.py 2019-09-06 10:47:13.000000000 +0200 +++ new/cssselect2-0.3.0/cssselect2/__init__.py 2020-01-26 19:53:27.000000000 +0100 @@ -1,4 +1,3 @@ -# coding: utf8 """ cssselect2 ---------- @@ -10,9 +9,8 @@ """ -from __future__ import unicode_literals - import operator +from pathlib import Path from webencodings import ascii_lower @@ -21,7 +19,7 @@ from .parser import SelectorError # noqa from .tree import ElementWrapper # noqa -VERSION = '0.2.2' +VERSION = __version__ = (Path(__file__).parent / 'VERSION').read_text().strip() class Matcher(object): @@ -36,8 +34,7 @@ self.order = 0 def add_selector(self, selector, payload): - """ - Add a selector and its payload to the matcher. + """Add a selector and its payload to the matcher. :param selector: A :class:`CompiledSelector` object. @@ -75,8 +72,7 @@ self.other_selectors.append(entry) def match(self, element): - """ - Match selectors against the given element. + """Match selectors against the given element. :param element: An :class:`ElementWrapper`. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/cssselect2/_compat.py new/cssselect2-0.3.0/cssselect2/_compat.py --- old/cssselect2-0.2.2/cssselect2/_compat.py 2017-06-17 22:33:38.000000000 +0200 +++ new/cssselect2-0.3.0/cssselect2/_compat.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,9 +0,0 @@ -try: - basestring = basestring -except NameError: - basestring = str - -try: - from itertools import ifilter -except ImportError: - ifilter = filter diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/cssselect2/compiler.py new/cssselect2-0.3.0/cssselect2/compiler.py --- old/cssselect2-0.2.2/cssselect2/compiler.py 2019-09-06 10:46:12.000000000 +0200 +++ new/cssselect2-0.3.0/cssselect2/compiler.py 2020-01-26 20:13:53.000000000 +0100 @@ -1,7 +1,3 @@ -# coding: utf8 - -from __future__ import unicode_literals - import re from tinycss2.nth import parse_nth @@ -18,8 +14,7 @@ """Compile a (comma-separated) list of selectors. :param input: - A :term:`tinycss2:string`, - or an iterable of tinycss2 :term:`tinycss2:component values` such as + A string, or an iterable of tinycss2 component values such as the :attr:`~tinycss2.ast.QualifiedRule.predule` of a style rule. :param namespaces: A optional dictionary of all `namespace prefix declarations diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/cssselect2/parser.py new/cssselect2-0.3.0/cssselect2/parser.py --- old/cssselect2-0.2.2/cssselect2/parser.py 2019-09-06 10:46:09.000000000 +0200 +++ new/cssselect2-0.3.0/cssselect2/parser.py 2020-01-26 20:13:37.000000000 +0100 @@ -1,30 +1,27 @@ -# coding: utf8 """ cssselect2.parser ----------------- - A parser for CSS selectors, based on the tinycss tokenizer. + A parser for CSS selectors, based on the tinycss2 tokenizer. :copyright: (c) 2012 by Simon Sapin, 2017 by Guillaume Ayoub. :license: BSD, see LICENSE for more details. """ -from __future__ import unicode_literals - from tinycss2 import parse_component_value_list -from ._compat import basestring - __all__ = ['parse'] def parse(input, namespaces=None): - """ + """Yield tinycss2 selectors found in given ``input``. + :param input: - A :term:`string`, or an iterable of :term:`component values`. + A string, or an iterable of tinycss2 component values. + """ - if isinstance(input, basestring): + if isinstance(input, str): input = parse_component_value_list(input) tokens = TokenStream(input) namespaces = namespaces or {} @@ -197,8 +194,11 @@ def parse_qualified_name(tokens, namespaces, is_attribute=False): - """Returns None (not a qualified name) or (ns, local), - in which None is a wildcard. The empty string for ns is "no namespace". + """Return ``(namespace, local)`` for given tokens. + + Can also return ``None`` for a wildcard. + + The empty string for ``namespace`` means "no namespace". """ peek = tokens.peek() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/cssselect2/tests/__init__.py new/cssselect2-0.3.0/cssselect2/tests/__init__.py --- old/cssselect2-0.2.2/cssselect2/tests/__init__.py 2017-08-14 11:46:37.000000000 +0200 +++ new/cssselect2-0.3.0/cssselect2/tests/__init__.py 2020-01-26 14:19:04.000000000 +0100 @@ -1,4 +1,3 @@ -# coding: utf8 """ cssselect2.tests ---------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/cssselect2/tests/test_cssselect2.py new/cssselect2-0.3.0/cssselect2/tests/test_cssselect2.py --- old/cssselect2-0.2.2/cssselect2/tests/test_cssselect2.py 2019-06-30 21:39:56.000000000 +0200 +++ new/cssselect2-0.3.0/cssselect2/tests/test_cssselect2.py 2020-01-26 15:57:03.000000000 +0100 @@ -1,4 +1,3 @@ -# coding: utf8 """ cssselect2.tests ---------------- @@ -23,12 +22,12 @@ def load_json(filename): - return json.load(open(resource(filename))) + return json.load(open(resource(filename), encoding='utf-8')) def get_test_document(): document = etree.parse(resource('content.xhtml')) - parent = next(e for e in document.getiterator() if e.get('id') == 'root') + parent = next(e for e in document.iter() if e.get('id') == 'root') # Setup namespace tests for id in ('any-namespace', 'no-namespace'): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/cssselect2/tree.py new/cssselect2-0.3.0/cssselect2/tree.py --- old/cssselect2-0.2.2/cssselect2/tree.py 2019-09-06 10:46:09.000000000 +0200 +++ new/cssselect2-0.3.0/cssselect2/tree.py 2020-01-26 20:07:25.000000000 +0100 @@ -1,12 +1,5 @@ -# coding: utf8 - -from __future__ import unicode_literals - -import xml.etree.ElementTree as etree - from webencodings import ascii_lower -from ._compat import basestring, ifilter from .compiler import compile_selector_list, split_whitespace @@ -67,10 +60,9 @@ @classmethod def from_html_root(cls, root, content_language=None): - """Same as :meth:`from_xml_root`, - but for documents parsed with an HTML parser - like `html5lib <http://html5lib.readthedocs.org/>`_, - which should be the case of documents with the ``text/html`` MIME type. + """Same as :meth:`from_xml_root`, but for documents parsed with an HTML parser + like `html5lib`_, which should be the case of documents with the + ``text/html`` MIME type. Compared to :meth:`from_xml_root`, this makes element attribute names in Selectors case-insensitive. @@ -99,7 +91,7 @@ if parent is not None: #: The :attr:`parent`’s children #: as a list of - #: ElementTree :class:`~xml.etree.ElementTree.Element`s. + #: ElementTree :class:`~xml.etree.ElementTree.Element`\ s. #: For the root (which has no parent) self.etree_siblings = parent.etree_children else: @@ -233,7 +225,7 @@ """ tests = self._compile(selectors) if len(tests) == 1: - return ifilter(tests[0], self.iter_subtree()) + return filter(tests[0], self.iter_subtree()) elif selectors: return ( element @@ -269,7 +261,7 @@ are not included. """ - return [c for c in self.etree_element if isinstance(c.tag, basestring)] + return [c for c in self.etree_element if isinstance(c.tag, str)] @cached_property def local_name(self): @@ -315,8 +307,9 @@ # Root elememnt if is_html: content_language = None - for meta in etree_iter(self.etree_element, - '{http://www.w3.org/1999/xhtml}meta'): + iterator = self.etree_element.iter( + '{http://www.w3.org/1999/xhtml}meta') + for meta in iterator: http_equiv = meta.get('http-equiv', '') if ascii_lower(http_equiv) == 'content-language': content_language = _parse_content_language( @@ -351,14 +344,6 @@ return tag[1:pos], tag[pos + 1:] -if hasattr(etree.Element, 'iter'): - def etree_iter(element, tag=None): - return element.iter(tag) -else: - def etree_iter(element, tag=None): - return element.getiterator(tag) - - def _parse_content_language(value): if value is not None and ',' not in value: parts = split_whitespace(value) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/cssselect2.egg-info/PKG-INFO new/cssselect2-0.3.0/cssselect2.egg-info/PKG-INFO --- old/cssselect2-0.2.2/cssselect2.egg-info/PKG-INFO 2019-09-06 10:49:59.000000000 +0200 +++ new/cssselect2-0.3.0/cssselect2.egg-info/PKG-INFO 2020-03-16 22:26:28.000000000 +0100 @@ -1,11 +1,15 @@ Metadata-Version: 2.1 Name: cssselect2 -Version: 0.2.2 +Version: 0.3.0 Summary: CSS selectors for Python ElementTree -Home-page: http://packages.python.org/cssselect2/ +Home-page: https://cssselect2.readthedocs.io/ Author: Simon Sapin -Author-email: simon.sa...@exyr.org +Author-email: commun...@kozea.fr License: BSD +Project-URL: Documentation, https://cssselect2.readthedocs.io/ +Project-URL: Code, https://github.com/Kozea/cssselect2/ +Project-URL: Issue tracker, https://github.com/Kozea/cssselect2/issues +Project-URL: Donation, https://www.patreon.com/kozea Description: cssselect2: CSS selectors for Python ElementTree ################################################ @@ -28,12 +32,27 @@ Quick facts: * Free software: BSD licensed - * Compatible with Python 2.7+ and 3.3+ + * Compatible with Python 3.5+ * Latest documentation: http://cssselect2.readthedocs.io/ * Source, issues and pull requests `on Github <https://github.com/Kozea/cssselect2/>`_ * Releases `on PyPI <http://pypi.python.org/pypi/cssselect2>`_ * Install with ``pip install cssselect2`` -Platform: UNKNOWN +Keywords: css,elementtree +Platform: Linux +Platform: macOS +Platform: Windows +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Topic :: Internet :: WWW/HTTP +Requires-Python: >=3.5 +Description-Content-Type: text/x-rst +Provides-Extra: doc Provides-Extra: test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/cssselect2.egg-info/SOURCES.txt new/cssselect2-0.3.0/cssselect2.egg-info/SOURCES.txt --- old/cssselect2-0.2.2/cssselect2.egg-info/SOURCES.txt 2019-09-06 10:49:59.000000000 +0200 +++ new/cssselect2-0.3.0/cssselect2.egg-info/SOURCES.txt 2020-03-16 22:26:28.000000000 +0100 @@ -1,21 +1,16 @@ -.coveragerc -.gitignore -.travis.yml -CHANGES LICENSE -MANIFEST.in README.rst -example.py setup.cfg setup.py +cssselect2/VERSION cssselect2/__init__.py -cssselect2/_compat.py cssselect2/compiler.py cssselect2/parser.py cssselect2/tree.py cssselect2.egg-info/PKG-INFO cssselect2.egg-info/SOURCES.txt cssselect2.egg-info/dependency_links.txt +cssselect2.egg-info/not-zip-safe cssselect2.egg-info/requires.txt cssselect2.egg-info/top_level.txt cssselect2/tests/LICENSE @@ -26,6 +21,4 @@ cssselect2/tests/make_valid_selectors_json.sh cssselect2/tests/shakespeare.html cssselect2/tests/test_cssselect2.py -cssselect2/tests/valid_selectors.json -docs/conf.py -docs/index.rst \ No newline at end of file +cssselect2/tests/valid_selectors.json \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/cssselect2.egg-info/not-zip-safe new/cssselect2-0.3.0/cssselect2.egg-info/not-zip-safe --- old/cssselect2-0.2.2/cssselect2.egg-info/not-zip-safe 1970-01-01 01:00:00.000000000 +0100 +++ new/cssselect2-0.3.0/cssselect2.egg-info/not-zip-safe 2020-01-26 19:55:12.000000000 +0100 @@ -0,0 +1 @@ + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/cssselect2.egg-info/requires.txt new/cssselect2-0.3.0/cssselect2.egg-info/requires.txt --- old/cssselect2-0.2.2/cssselect2.egg-info/requires.txt 2019-09-06 10:49:59.000000000 +0200 +++ new/cssselect2-0.3.0/cssselect2.egg-info/requires.txt 2020-03-16 22:26:28.000000000 +0100 @@ -1,4 +1,10 @@ +setuptools>=39.2.0 tinycss2 +webencodings + +[doc] +sphinx +sphinx_rtd_theme [test] pytest-runner diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/docs/conf.py new/cssselect2-0.3.0/docs/conf.py --- old/cssselect2-0.2.2/docs/conf.py 2017-09-30 21:53:41.000000000 +0200 +++ new/cssselect2-0.3.0/docs/conf.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,80 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# cssselect2 documentation build configuration file. - -import codecs -import re -from os import path - - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx'] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix of source filenames. -source_suffix = '.rst' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = 'cssselect2' -copyright = '2012-2017, Simon Sapin' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = re.search("VERSION = '([^']+)'", codecs.open( - path.join(path.dirname(path.dirname(__file__)), 'cssselect2', '__init__.py'), - encoding='utf-8', -).read().strip()).group(1) - -# The short X.Y version. -version = '.'.join(release.split('.')[:2]) - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ['_build'] - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = 'sphinx_rtd_theme' - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -# Output file base name for HTML help builder. -htmlhelp_basename = 'cssselect2doc' - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ('index', 'cssselect2', 'cssselect2 Documentation', - ['Simon Sapin'], 1) -] - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ('index', 'cssselect2', 'cssselect2 Documentation', - 'Simon Sapin', 'cssselect2', 'One line description of project.', - 'Miscellaneous'), -] - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - 'py2': ('http://docs.python.org/2', None), - 'py3': ('http://docs.python.org/3', None), - 'webencodings': ('http://pythonhosted.org/webencodings/', None)} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/docs/index.rst new/cssselect2-0.3.0/docs/index.rst --- old/cssselect2-0.2.2/docs/index.rst 2017-10-01 01:11:55.000000000 +0200 +++ new/cssselect2-0.3.0/docs/index.rst 1970-01-01 01:00:00.000000000 +0100 @@ -1,41 +0,0 @@ -.. include:: ../README.rst - - -Installation -============ - -Installing cssselect2 with pip_ should Just Work:: - - pip install cssselect2 - -This will also automatically install cssselect2’s only dependency, tinycss2_. -cssselect2 and tinycss2 both only contain Python code and should work on any -Python implementation, although they’re only tested on CPython. - -.. _pip: http://pip-installer.org/ -.. _tinycss2: http://tinycss2.readthedocs.io/ - - -Basic Example -============= - -Here is a classical cssselect2 workflow: - -- parse a CSS stylesheet using tinycss2_, -- store the CSS rules in a :meth:`~cssselect2.Matcher` object, -- parse an HTML document using an ElementTree-like parser, -- wrap the HTML tree in a :meth:`~cssselect2.ElementWrapper` object, -- find the CSS rules matching each HTML tag, using the matcher and the wrapper. - -.. literalinclude:: ../example.py - -.. module:: cssselect2 -.. autoclass:: Matcher - :members: -.. autofunction:: compile_selector_list -.. autoclass:: ElementWrapper - :members: -.. autoclass:: SelectorError - - -.. include:: ../CHANGES diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/example.py new/cssselect2-0.3.0/example.py --- old/cssselect2-0.2.2/example.py 2017-10-01 01:15:17.000000000 +0200 +++ new/cssselect2-0.3.0/example.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,49 +0,0 @@ -from xml.etree import ElementTree - -import cssselect2 -import tinycss2 - - -# Parse CSS and add rules to the matcher - -matcher = cssselect2.Matcher() - -rules = tinycss2.parse_stylesheet(''' - body { font-size: 2em } - body p { background: red } - p { color: blue } -''', skip_whitespace=True) - -for rule in rules: - selectors = cssselect2.compile_selector_list(rule.prelude) - selector_string = tinycss2.serialize(rule.prelude) - content_string = tinycss2.serialize(rule.content) - payload = (selector_string, content_string) - for selector in selectors: - matcher.add_selector(selector, payload) - - -# Parse HTML and find CSS rules applying to each tag - -html_tree = ElementTree.fromstring(''' - <html> - <body> - <p>Test</p> - </body> - </html> -''') -wrapper = cssselect2.ElementWrapper.from_html_root(html_tree) -for element in wrapper.iter_subtree(): - tag = element.etree_element.tag.split('}')[-1] - print('Found tag "{}" in HTML'.format(tag)) - - matches = matcher.match(element) - if matches: - for match in matches: - specificity, order, pseudo, payload = match - selector_string, content_string = payload - print('Matching selector "{}" ({})'.format( - selector_string, content_string)) - else: - print('No rule matching this tag') - print() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/setup.cfg new/cssselect2-0.3.0/setup.cfg --- old/cssselect2-0.2.2/setup.cfg 2019-09-06 10:49:59.000000000 +0200 +++ new/cssselect2-0.3.0/setup.cfg 2020-03-16 22:26:28.000000000 +0100 @@ -1,15 +1,95 @@ -[aliases] -test = pytest +[metadata] +name = cssselect2 +url = https://cssselect2.readthedocs.io/ +version = file: cssselect2/VERSION +license = BSD +license_file = LICENSE +description = CSS selectors for Python ElementTree +long_description = file: README.rst +long_description_content_type = text/x-rst +author = Simon Sapin +author_email = commun...@kozea.fr +platforms = + Linux + macOS + Windows +keywords = + css + elementtree +classifiers = + Development Status :: 5 - Production/Stable + Intended Audience :: Developers + License :: OSI Approved :: BSD License + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Topic :: Internet :: WWW/HTTP +project_urls = + Documentation = https://cssselect2.readthedocs.io/ + Code = https://github.com/Kozea/cssselect2/ + Issue tracker = https://github.com/Kozea/cssselect2/issues + Donation = https://www.patreon.com/kozea + +[options] +packages = find: +zip_safe = false +setup_requires = pytest-runner +install_requires = + setuptools>=39.2.0 + tinycss2 + webencodings +tests_require = + pytest-runner + pytest-cov + pytest-flake8 + pytest-isort +python_requires = >= 3.5 + +[options.package_data] +cssselect2 = VERSION +cssselect2.tests = * + +[options.extras_require] +doc = + sphinx + sphinx_rtd_theme +test = + pytest-runner + pytest-cov + pytest-flake8 + pytest-isort [bdist_wheel] -universal = 1 +python-tag = py3 + +[build_sphinx] +source-dir = docs +build-dir = docs/_build + +[aliases] +test = pytest [tool:pytest] -addopts = --cov=cssselect2 --flake8 --isort cssselect2 -norecursedirs = dist .cache .git build *.egg-info .eggs venv +addopts = --flake8 --isort cssselect2 +norecursedirs = build dist .cache .eggs .git + +[coverage:run] +branch = True +include = cssselect2/* + +[coverage:report] +exclude_lines = + pragma: no cover + def __repr__ + raise NotImplementedError +omit = + .* [isort] default_section = THIRDPARTY +multi_line_output = 4 [egg_info] tag_build = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cssselect2-0.2.2/setup.py new/cssselect2-0.3.0/setup.py --- old/cssselect2-0.2.2/setup.py 2017-07-07 11:35:07.000000000 +0200 +++ new/cssselect2-0.3.0/setup.py 2020-01-26 19:54:46.000000000 +0100 @@ -1,36 +1,12 @@ #!/usr/bin/env python -# coding: utf8 -import os.path -import re import sys from setuptools import setup -ROOT = os.path.dirname(__file__) -README = open(os.path.join(ROOT, 'README.rst')).read() -INIT_PY = open(os.path.join(ROOT, 'cssselect2', '__init__.py')).read() -VERSION = re.search("VERSION = '([^']+)'", INIT_PY).group(1) +if sys.version_info.major < 3: + raise RuntimeError( + 'cssselect2 does not support Python 2.x anymore. ' + 'Please use Python 3 or install an older version of cssselect2.') -needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv) -pytest_runner = ['pytest-runner'] if needs_pytest else [] - -setup( - name='cssselect2', - version=VERSION, - author='Simon Sapin', - author_email='simon.sa...@exyr.org', - description='CSS selectors for Python ElementTree', - long_description=README, - url='http://packages.python.org/cssselect2/', - license='BSD', - packages=['cssselect2'], - package_data={'cssselect2': ['tests/*']}, - install_requires=['tinycss2'], - setup_requires=pytest_runner, - test_suite='cssselect2.tests', - tests_require=[ - 'pytest-runner', 'pytest-cov', 'pytest-flake8', 'pytest-isort'], - extras_require={'test': [ - 'pytest-runner', 'pytest-cov', 'pytest-flake8', 'pytest-isort']}, -) +setup()