Hello community,

here is the log from the commit of package python-cssselect2 for 
openSUSE:Factory checked in at 2019-09-23 12:09:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-cssselect2 (Old)
 and      /work/SRC/openSUSE:Factory/.python-cssselect2.new.7948 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-cssselect2"

Mon Sep 23 12:09:20 2019 rev:5 rq:730669 version:0.2.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-cssselect2/python-cssselect2.changes      
2019-05-05 21:18:27.804794030 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-cssselect2.new.7948/python-cssselect2.changes
    2019-09-23 12:09:23.221885787 +0200
@@ -1,0 +2,6 @@
+Fri Sep 13 10:29:09 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 0.2.2:
+  * Optimize lang attribute selectors
+
+-------------------------------------------------------------------

Old:
----
  cssselect2-0.2.1.tar.gz

New:
----
  cssselect2-0.2.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-cssselect2.spec ++++++
--- /var/tmp/diff_new_pack.pxGE5d/_old  2019-09-23 12:09:24.049885651 +0200
+++ /var/tmp/diff_new_pack.pxGE5d/_new  2019-09-23 12:09:24.049885651 +0200
@@ -19,23 +19,22 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define skip_python2 1
 Name:           python-cssselect2
-Version:        0.2.1
+Version:        0.2.2
 Release:        0
 Summary:        CSS selectors for Python ElementTree
 License:        BSD-3-Clause
 Group:          Development/Languages/Python
-Url:            https://github.com/Kozea/cssselect2/
+URL:            https://github.com/Kozea/cssselect2/
 Source:         
https://files.pythonhosted.org/packages/source/c/cssselect2/cssselect2-%{version}.tar.gz
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
+Requires:       python-tinycss2
+BuildArch:      noarch
 # SECTION test requirements
 BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module tinycss2}
 # /SECTION
-Requires:       python-tinycss2
-BuildArch:      noarch
-
 %python_subpackages
 
 %description
@@ -60,7 +59,7 @@
 
 %check
 export LANG=en_US.UTF-8
-%python_exec -m pytest cssselect2/tests
+%pytest cssselect2/tests
 
 %files %{python_files}
 %doc CHANGES README.rst

++++++ cssselect2-0.2.1.tar.gz -> cssselect2-0.2.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cssselect2-0.2.1/.travis.yml 
new/cssselect2-0.2.2/.travis.yml
--- old/cssselect2-0.2.1/.travis.yml    2017-07-07 11:35:07.000000000 +0200
+++ new/cssselect2-0.2.2/.travis.yml    2019-06-30 21:51:15.000000000 +0200
@@ -9,19 +9,18 @@
     - os: linux
       python: 2.7
     - os: linux
-      python: 3.3
-    - os: linux
-      python: 3.4
-    - 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 install python3; fi
+  - 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]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cssselect2-0.2.1/CHANGES new/cssselect2-0.2.2/CHANGES
--- old/cssselect2-0.2.1/CHANGES        2017-10-02 10:57:29.000000000 +0200
+++ new/cssselect2-0.2.2/CHANGES        2019-09-06 10:48:44.000000000 +0200
@@ -2,6 +2,14 @@
 ====================
 
 
+Version 0.2.2
+-------------
+
+Released on 2019-09-06.
+
+* Optimize lang attribute selectors.
+
+
 Version 0.2.1
 -------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cssselect2-0.2.1/LICENSE new/cssselect2-0.2.2/LICENSE
--- old/cssselect2-0.2.1/LICENSE        2017-08-14 11:47:15.000000000 +0200
+++ new/cssselect2-0.2.2/LICENSE        2018-04-10 13:49:24.000000000 +0200
@@ -1,31 +1,29 @@
-Copyright (c) 2012 - 2013 by Simon Sapin, 2017 by Guillaume Ayoub.
+BSD 3-Clause License
 
-Some rights reserved.
+Copyright (c) 2012-2018, Simon Sapin and contributors (see AUTHORS).
+All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+modification, are permitted provided that the following conditions are met:
 
-    * Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
+* Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
 
-    * Redistributions in binary form must reproduce the above
-      copyright notice, this list of conditions and the following
-      disclaimer in the documentation and/or other materials provided
-      with the distribution.
-
-    * The names of the contributors may not be used to endorse or
-      promote products derived from this software without specific
-      prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* Redistributions in binary form must reproduce the above copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+
+* Neither the name of the copyright holder nor the names of its
+  contributors may be used to endorse or promote products derived from
+  this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cssselect2-0.2.1/PKG-INFO 
new/cssselect2-0.2.2/PKG-INFO
--- old/cssselect2-0.2.1/PKG-INFO       2017-10-02 11:00:28.000000000 +0200
+++ new/cssselect2-0.2.2/PKG-INFO       2019-09-06 10:49:59.000000000 +0200
@@ -1,12 +1,11 @@
-Metadata-Version: 1.0
+Metadata-Version: 2.1
 Name: cssselect2
-Version: 0.2.1
+Version: 0.2.2
 Summary: CSS selectors for Python ElementTree
 Home-page: http://packages.python.org/cssselect2/
 Author: Simon Sapin
 Author-email: [email protected]
 License: BSD
-Description-Content-Type: UNKNOWN
 Description: cssselect2: CSS selectors for Python ElementTree
         ################################################
         
@@ -37,3 +36,4 @@
         * Install with ``pip install cssselect2``
         
 Platform: UNKNOWN
+Provides-Extra: test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cssselect2-0.2.1/cssselect2/__init__.py 
new/cssselect2-0.2.2/cssselect2/__init__.py
--- old/cssselect2-0.2.1/cssselect2/__init__.py 2017-10-02 10:57:40.000000000 
+0200
+++ new/cssselect2-0.2.2/cssselect2/__init__.py 2019-09-06 10:47:13.000000000 
+0200
@@ -21,8 +21,7 @@
 from .parser import SelectorError  # noqa
 from .tree import ElementWrapper  # noqa
 
-
-VERSION = '0.2.1'
+VERSION = '0.2.2'
 
 
 class Matcher(object):
@@ -32,6 +31,7 @@
         self.class_selectors = {}
         self.lower_local_name_selectors = {}
         self.namespace_selectors = {}
+        self.lang_attr_selectors = []
         self.other_selectors = []
         self.order = 0
 
@@ -69,6 +69,8 @@
         elif selector.namespace is not None:
             self.namespace_selectors.setdefault(selector.namespace, []) \
                 .append(entry)
+        elif selector.requires_lang_attr:
+            self.lang_attr_selectors.append(entry)
         else:
             self.other_selectors.append(entry)
 
@@ -99,6 +101,10 @@
                 ascii_lower(element.local_name), []))
         relevant_selectors.append(
             self.namespace_selectors.get(element.namespace_url, []))
+
+        if 'lang' in element.etree_element.attrib:
+            relevant_selectors.append(self.lang_attr_selectors)
+
         relevant_selectors.append(self.other_selectors)
 
         results = [
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cssselect2-0.2.1/cssselect2/compiler.py 
new/cssselect2-0.2.2/cssselect2/compiler.py
--- old/cssselect2-0.2.1/cssselect2/compiler.py 2017-10-01 00:43:23.000000000 
+0200
+++ new/cssselect2-0.2.2/cssselect2/compiler.py 2019-09-06 10:46:12.000000000 
+0200
@@ -54,6 +54,7 @@
         self.local_name = None
         self.lower_local_name = None
         self.namespace = None
+        self.requires_lang_attr = False
 
         node = parsed_selector.parsed_tree
         if isinstance(node, parser.CombinedSelector):
@@ -68,6 +69,9 @@
                 self.lower_local_name = simple_selector.lower_local_name
             elif isinstance(simple_selector, parser.NamespaceSelector):
                 self.namespace = simple_selector.namespace
+            elif isinstance(simple_selector, parser.AttributeSelector) and \
+                    simple_selector.name == "lang":
+                self.requires_lang_attr = True
 
 
 def _compile_node(selector):
@@ -169,7 +173,7 @@
                        % (selector.lower_name, selector.name))
             value = selector.value
             if selector.operator is None:
-                return 'el.etree_element.get(%s) is not None' % key
+                return '%s in el.etree_element.attrib' % key
             elif selector.operator == '=':
                 return 'el.etree_element.get(%s) == %r' % (key, value)
             elif selector.operator == '~=':
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cssselect2-0.2.1/cssselect2/tests/test_cssselect2.py 
new/cssselect2-0.2.2/cssselect2/tests/test_cssselect2.py
--- old/cssselect2-0.2.1/cssselect2/tests/test_cssselect2.py    2017-08-16 
12:00:09.000000000 +0200
+++ new/cssselect2-0.2.2/cssselect2/tests/test_cssselect2.py    2019-06-30 
21:39:56.000000000 +0200
@@ -15,7 +15,6 @@
 import xml.etree.ElementTree as etree
 
 import pytest
-
 from cssselect2 import ElementWrapper, SelectorError, compile_selector_list
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cssselect2-0.2.1/cssselect2.egg-info/PKG-INFO 
new/cssselect2-0.2.2/cssselect2.egg-info/PKG-INFO
--- old/cssselect2-0.2.1/cssselect2.egg-info/PKG-INFO   2017-10-02 
11:00:28.000000000 +0200
+++ new/cssselect2-0.2.2/cssselect2.egg-info/PKG-INFO   2019-09-06 
10:49:59.000000000 +0200
@@ -1,12 +1,11 @@
-Metadata-Version: 1.0
+Metadata-Version: 2.1
 Name: cssselect2
-Version: 0.2.1
+Version: 0.2.2
 Summary: CSS selectors for Python ElementTree
 Home-page: http://packages.python.org/cssselect2/
 Author: Simon Sapin
 Author-email: [email protected]
 License: BSD
-Description-Content-Type: UNKNOWN
 Description: cssselect2: CSS selectors for Python ElementTree
         ################################################
         
@@ -37,3 +36,4 @@
         * Install with ``pip install cssselect2``
         
 Platform: UNKNOWN
+Provides-Extra: test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cssselect2-0.2.1/setup.cfg 
new/cssselect2-0.2.2/setup.cfg
--- old/cssselect2-0.2.1/setup.cfg      2017-10-02 11:00:28.000000000 +0200
+++ new/cssselect2-0.2.2/setup.cfg      2019-09-06 10:49:59.000000000 +0200
@@ -8,6 +8,9 @@
 addopts = --cov=cssselect2 --flake8 --isort cssselect2
 norecursedirs = dist .cache .git build *.egg-info .eggs venv
 
+[isort]
+default_section = THIRDPARTY
+
 [egg_info]
 tag_build = 
 tag_date = 0


Reply via email to