Hello community,

here is the log from the commit of package python-catkin-pkg for 
openSUSE:Factory checked in at 2020-01-24 14:12:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-catkin-pkg (Old)
 and      /work/SRC/openSUSE:Factory/.python-catkin-pkg.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-catkin-pkg"

Fri Jan 24 14:12:00 2020 rev:2 rq:766826 version:0.4.15

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-catkin-pkg/python-catkin-pkg.changes      
2019-08-22 10:49:31.525722810 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-catkin-pkg.new.26092/python-catkin-pkg.changes
   2020-01-24 14:12:12.946430839 +0100
@@ -1,0 +2,6 @@
+Fri Jan 24 11:34:31 UTC 2020 - Marketa Calabkova <[email protected]>
+
+- update to 0.4.15
+  * small fixes
+
+-------------------------------------------------------------------

Old:
----
  0.4.13.tar.gz

New:
----
  0.4.15.tar.gz

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

Other differences:
------------------
++++++ python-catkin-pkg.spec ++++++
--- /var/tmp/diff_new_pack.GqNbX0/_old  2020-01-24 14:12:13.594431059 +0100
+++ /var/tmp/diff_new_pack.GqNbX0/_new  2020-01-24 14:12:13.598431060 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-catkin-pkg
 #
-# 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
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-catkin-pkg
-Version:        0.4.13
+Version:        0.4.15
 Release:        0
 Summary:        Catkin package library
 License:        BSD-3-Clause

++++++ 0.4.13.tar.gz -> 0.4.15.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/catkin_pkg-0.4.13/.travis.yml 
new/catkin_pkg-0.4.15/.travis.yml
--- old/catkin_pkg-0.4.13/.travis.yml   2019-07-26 18:11:19.000000000 +0200
+++ new/catkin_pkg-0.4.15/.travis.yml   2019-12-09 20:41:50.000000000 +0100
@@ -8,7 +8,9 @@
   - "3.6"
 # command to install dependencies
 install:
-  - pip install nose coverage argparse python-dateutil docutils pyparsing
+  # newer versions of docutils dropped support for Python 3.4
+  - if [ $TRAVIS_PYTHON_VERSION == "3.4" ]; then pip install docutils==0.15.2; 
else pip install docutils; fi
+  - pip install nose coverage argparse python-dateutil pyparsing
   - pip install flake8 flake8-blind-except flake8-builtins 
flake8-class-newline flake8-comprehensions flake8-deprecated flake8-docstrings 
flake8-import-order flake8-quotes
 # command to run tests
 script:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/catkin_pkg-0.4.13/setup.py 
new/catkin_pkg-0.4.15/setup.py
--- old/catkin_pkg-0.4.13/setup.py      2019-07-26 18:11:19.000000000 +0200
+++ new/catkin_pkg-0.4.15/setup.py      2019-12-09 20:41:50.000000000 +0100
@@ -20,7 +20,7 @@
     # same version as in:
     # - src/catkin_pkg/__init__.py
     # - stdeb.cfg
-    'version': '0.4.13',
+    'version': '0.4.15',
     'packages': ['catkin_pkg', 'catkin_pkg.cli'],
     'package_dir': {'': 'src'},
     'package_data': {'catkin_pkg': ['templates/*.in']},
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/catkin_pkg-0.4.13/src/catkin_pkg/__init__.py 
new/catkin_pkg-0.4.15/src/catkin_pkg/__init__.py
--- old/catkin_pkg-0.4.13/src/catkin_pkg/__init__.py    2019-07-26 
18:11:19.000000000 +0200
+++ new/catkin_pkg-0.4.15/src/catkin_pkg/__init__.py    2019-12-09 
20:41:50.000000000 +0100
@@ -35,4 +35,4 @@
 # same version as in:
 # - setup.py
 # - stdeb.cfg
-__version__ = '0.4.13'
+__version__ = '0.4.15'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/catkin_pkg-0.4.13/src/catkin_pkg/changelog_generator.py 
new/catkin_pkg-0.4.15/src/catkin_pkg/changelog_generator.py
--- old/catkin_pkg-0.4.13/src/catkin_pkg/changelog_generator.py 2019-07-26 
18:11:19.000000000 +0200
+++ new/catkin_pkg-0.4.15/src/catkin_pkg/changelog_generator.py 2019-12-09 
20:41:50.000000000 +0100
@@ -197,7 +197,7 @@
 def get_version_section_pattern(version):
     valid_section_characters = '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'
     headline = get_version_headline(version, None)
-    pattern = '^(' + re.escape(headline) + '( \([0-9 \-:|+]+\))?)\r?\n([' + 
re.escape(valid_section_characters) + ']+)\r?\n?$'
+    pattern = '^(' + re.escape(headline) + r'( \([0-9 \-:|+]+\))?)\r?\n([' + 
re.escape(valid_section_characters) + ']+)\r?\n?$'
     return pattern
 
 
@@ -277,7 +277,7 @@
 
 def escape_trailing_underscores(line):
     if line.endswith('_'):
-        line = line[:-1] + '\_'
+        line = line[:-1] + r'\_'
     # match words ending with an underscore which are not followed by another 
word
     # and insert a backslash before the underscore to escape it
     line = re.sub(r'(\w+)_([^\w])', '\\1\\_\\2', line)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/catkin_pkg-0.4.13/src/catkin_pkg/changelog_generator_vcs.py 
new/catkin_pkg-0.4.15/src/catkin_pkg/changelog_generator_vcs.py
--- old/catkin_pkg-0.4.13/src/catkin_pkg/changelog_generator_vcs.py     
2019-07-26 18:11:19.000000000 +0200
+++ new/catkin_pkg-0.4.15/src/catkin_pkg/changelog_generator_vcs.py     
2019-12-09 20:41:50.000000000 +0100
@@ -155,7 +155,7 @@
         if result_tag['returncode']:
             raise RuntimeError('Could not fetch tags:\n%s' % 
result_tag['output'])
         # Parse a comma-separated list of refname decorators out of the log
-        decorations = ', '.join(re.findall('^[a-f0-9]+ \(([^)]*)\) .', 
result_tag['output'], re.MULTILINE)) + ','
+        decorations = ', '.join(re.findall(r'^[a-f0-9]+ \(([^)]*)\) .', 
result_tag['output'], re.MULTILINE)) + ','
         # Extract only refnames that are tags
         tag_names = re.findall('tag: ([^,]+)[,]', decorations)
 
@@ -240,7 +240,7 @@
                 break
 
     def _replace_github_issue_references(self, line):
-        valid_name = '[\\w\._-]+'
+        valid_name = '[\\w._-]+'
         issue_pattern = '#(\\d+)'
 
         def replace_issue_number(match):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/catkin_pkg-0.4.13/src/catkin_pkg/cmake.py 
new/catkin_pkg-0.4.15/src/catkin_pkg/cmake.py
--- old/catkin_pkg-0.4.13/src/catkin_pkg/cmake.py       2019-07-26 
18:11:19.000000000 +0200
+++ new/catkin_pkg-0.4.15/src/catkin_pkg/cmake.py       2019-12-09 
20:41:50.000000000 +0100
@@ -77,4 +77,4 @@
     def substitute(match):
         var = match.group(0)[1:-1]
         return environment[var]
-    return re.sub('\@[a-zA-Z0-9_]+\@', substitute, template)
+    return re.sub('@[a-zA-Z0-9_]+@', substitute, template)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/catkin_pkg-0.4.13/src/catkin_pkg/group_dependency.py 
new/catkin_pkg-0.4.15/src/catkin_pkg/group_dependency.py
--- old/catkin_pkg-0.4.13/src/catkin_pkg/group_dependency.py    2019-07-26 
18:11:19.000000000 +0200
+++ new/catkin_pkg-0.4.15/src/catkin_pkg/group_dependency.py    2019-12-09 
20:41:50.000000000 +0100
@@ -58,5 +58,5 @@
         for pkg in packages:
             for g in pkg.member_of_groups:
                 assert g.evaluated_condition is not None
-            if self.name in [g.name for g in pkg.member_of_groups if 
g.evaluated_condition]:
+            if self.name in (g.name for g in pkg.member_of_groups if 
g.evaluated_condition):
                 self.members.add(pkg.name)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/catkin_pkg-0.4.13/src/catkin_pkg/package.py 
new/catkin_pkg-0.4.15/src/catkin_pkg/package.py
--- old/catkin_pkg-0.4.13/src/catkin_pkg/package.py     2019-07-26 
18:11:19.000000000 +0200
+++ new/catkin_pkg-0.4.15/src/catkin_pkg/package.py     2019-12-09 
20:41:50.000000000 +0100
@@ -43,6 +43,11 @@
 from catkin_pkg.condition import evaluate_condition
 
 PACKAGE_MANIFEST_FILENAME = 'package.xml'
+PACKAGE_MANIFEST_SCHEMA_URLS = [
+    'http://download.ros.org/schema/package_format1.xsd',
+    'http://download.ros.org/schema/package_format2.xsd',
+    'http://download.ros.org/schema/package_format3.xsd',
+]
 
 
 class Package(object):
@@ -138,7 +143,7 @@
         :returns: True if the given package buildtool depends on catkin
         :rtype: bool
         """
-        return 'catkin' in [d.name for d in self.buildtool_depends]
+        return 'catkin' in (d.name for d in self.buildtool_depends)
 
     def get_build_type(self):
         """
@@ -178,7 +183,7 @@
         :returns: True if metapackage, else False
         :rtype: bool
         """
-        return 'metapackage' in [e.tagname for e in self.exports]
+        return 'metapackage' in (e.tagname for e in self.exports)
 
     def evaluate_conditions(self, context):
         """
@@ -232,12 +237,12 @@
                     'Package name "%s" does not follow the naming conventions. 
It should start with '
                     'a lower case letter and only contain lower case letters, 
digits, underscores, and dashes.' % self.name)
 
-        version_regexp = '^[0-9]+\.[0-9]+\.[0-9]+$'
+        version_regexp = r'^[0-9]+\.[0-9]+\.[0-9]+$'
         if not self.version:
             errors.append('Package version must not be empty')
         elif not re.match(version_regexp, self.version):
             errors.append('Package version "%s" does not follow version 
conventions' % self.version)
-        elif not 
re.match('^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$', self.version):
+        elif not 
re.match(r'^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$', self.version):
             new_warnings.append('Package "%s" does not follow the version 
conventions. It should not contain leading zeros (unless the number is 0).' % 
self.name)
         if self.version_compatibility:
             if not re.match(version_regexp, self.version_compatibility):
@@ -341,6 +346,14 @@
     def __str__(self):
         return self.name
 
+    def __repr__(self):
+        kv = []
+        for slot in self.__slots__:
+            attr = getattr(self, slot, None)
+            if attr is not None:
+                kv.append('{}={!r}'.format(slot, attr))
+        return '{}({})'.format(self.__class__.__name__, ', '.join(kv))
+
     def evaluate_condition(self, context):
         """
         Evaluate the condition.
@@ -420,7 +433,7 @@
     def validate(self):
         if self.email is None:
             return
-        if not 
re.match('^[-a-zA-Z0-9_%+]+(\.[-a-zA-Z0-9_%+]+)*@[-a-zA-Z0-9%]+(\.[-a-zA-Z0-9%]+)*\.[a-zA-Z]{2,}$',
 self.email):
+        if not 
re.match(r'^[-a-zA-Z0-9_%+]+(\.[-a-zA-Z0-9_%+]+)*@[-a-zA-Z0-9%]+(\.[-a-zA-Z0-9%]+)*\.[a-zA-Z]{2,}$',
 self.email):
             raise InvalidPackage('Invalid email "%s" for person "%s"' % 
(self.email, self.name))
 
 
@@ -498,6 +511,49 @@
         return f.read(), filename
 
 
+def has_ros_schema_reference(path):
+    """
+    Check if the XML file contains a processing instruction referencing a ROS 
package manifest schema.
+
+    :param path: The path of the package.xml file, it may or may not
+        include the filename
+    :type path: str
+    :returns: True if it contains the known reference, else False
+    :rtype: bool
+    :raises: :exc:`IOError`
+    """
+    xml, _ = _get_package_xml(path)
+    return has_ros_schema_reference_string(xml)
+
+
+def has_ros_schema_reference_string(data):
+    """
+    Check if the XML data contains a processing instruction referencing a ROS 
package manifest schema.
+
+    :param data: package.xml contents
+    :type data: str
+    :returns: True if it contains the known reference, else False
+    :rtype: bool
+    """
+    if sys.version_info[0] == 2 and not isinstance(data, str):
+        data = data.encode('utf-8')
+    try:
+        root = dom.parseString(data)
+    except Exception:
+        # invalid XML
+        return False
+
+    for child in root.childNodes:
+        if child.nodeType == child.PROCESSING_INSTRUCTION_NODE:
+            if child.target == 'xml-model':
+                # extract schema url from "xml-model" processing instruction
+                schema_url = re.search(r'href="([A-Za-z0-9\._/:]*)"', 
child.data).group(1)
+                if schema_url in PACKAGE_MANIFEST_SCHEMA_URLS:
+                    return True
+
+    return False
+
+
 def parse_package(path, warnings=None):
     """
     Parse package manifest.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/catkin_pkg-0.4.13/src/catkin_pkg/package_version.py 
new/catkin_pkg-0.4.15/src/catkin_pkg/package_version.py
--- old/catkin_pkg-0.4.13/src/catkin_pkg/package_version.py     2019-07-26 
18:11:19.000000000 +0200
+++ new/catkin_pkg-0.4.15/src/catkin_pkg/package_version.py     2019-12-09 
20:41:50.000000000 +0100
@@ -53,7 +53,7 @@
     :raises ValueError: if the version string is not in the format x.y.z
     """
     # split the version number
-    match = re.match('^(\d+)\.(\d+)\.(\d+)$', version)
+    match = re.match(r'^(\d+)\.(\d+)\.(\d+)$', version)
     if match is None:
         raise ValueError('Invalid version string, must be int.int.int: "%s"' % 
version)
     new_version = match.groups()
@@ -78,7 +78,7 @@
     :raises RuntimeError:
     """
     # try to replace contens
-    new_package_str, number_of_subs = 
re.subn('<version([^<>]*)>[^<>]*</version>', '<version\g<1>>%s</version>' % 
new_version, package_str)
+    new_package_str, number_of_subs = 
re.subn('<version([^<>]*)>[^<>]*</version>', r'<version\g<1>>%s</version>' % 
new_version, package_str)
     if number_of_subs != 1:
         raise RuntimeError('Illegal number of version tags: %s' % 
(number_of_subs))
     return new_package_str
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/catkin_pkg-0.4.13/src/catkin_pkg/topological_order.py 
new/catkin_pkg-0.4.15/src/catkin_pkg/topological_order.py
--- old/catkin_pkg-0.4.13/src/catkin_pkg/topological_order.py   2019-07-26 
18:11:19.000000000 +0200
+++ new/catkin_pkg-0.4.15/src/catkin_pkg/topological_order.py   2019-12-09 
20:41:50.000000000 +0100
@@ -45,7 +45,7 @@
     def __init__(self, package, path):
         self.package = package
         self.path = path
-        self.is_metapackage = 'metapackage' in [e.tagname for e in 
self.package.exports]
+        self.is_metapackage = 'metapackage' in (e.tagname for e in 
self.package.exports)
         message_generators = [e.content for e in self.package.exports if 
e.tagname == 'message_generator']
         self.message_generator = message_generators[0] if message_generators 
else None
         # full includes direct build depends and recursive run_depends of 
these build_depends
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/catkin_pkg-0.4.13/stdeb.cfg 
new/catkin_pkg-0.4.15/stdeb.cfg
--- old/catkin_pkg-0.4.13/stdeb.cfg     2019-07-26 18:11:19.000000000 +0200
+++ new/catkin_pkg-0.4.15/stdeb.cfg     2019-12-09 20:41:50.000000000 +0100
@@ -3,15 +3,16 @@
 ; catkin-pkg-modules same version as in:
 ; - setup.py
 ; - src/catkin_pkg/__init__.py
-Depends: python-argparse, python-catkin-pkg-modules (>= 0.4.13), 
python-dateutil, python-docutils
+Depends: python-argparse, python-catkin-pkg-modules (>= 0.4.15), 
python-dateutil, python-docutils
 ; catkin-pkg-modules same version as in:
 ; - setup.py
 ; - src/catkin_pkg/__init__.py
-Depends3: python3-catkin-pkg-modules (>= 0.4.13), python3-dateutil, 
python3-docutils
+Depends3: python3-catkin-pkg-modules (>= 0.4.15), python3-dateutil, 
python3-docutils
 Conflicts: catkin, python3-catkin-pkg
 Conflicts3: catkin, python-catkin-pkg
 Copyright-File: LICENSE
-Suite: trusty utopic vivid wily xenial yakkety zesty artful bionic jessie 
stretch buster
+Suite: xenial yakkety zesty artful bionic cosmic disco eoan jessie stretch 
buster
+Suite3: xenial yakkety zesty artful bionic cosmic disco eoan focal jessie 
stretch buster
 X-Python3-Version: >= 3.4
 Setup-Env-Vars: SKIP_PYTHON_MODULES=1
 
@@ -24,6 +25,7 @@
 Replaces: python-catkin-pkg (<< 0.3.0)
 Replaces3: python3-catkin-pkg (<< 0.3.0)
 Copyright-File: LICENSE
-Suite: trusty utopic vivid wily xenial yakkety zesty artful bionic jessie 
stretch buster
+Suite: xenial yakkety zesty artful bionic cosmic disco eoan jessie stretch 
buster
+Suite3: xenial yakkety zesty artful bionic cosmic disco eoan focal jessie 
stretch buster
 X-Python3-Version: >= 3.4
 Setup-Env-Vars: SKIP_PYTHON_SCRIPTS=1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/catkin_pkg-0.4.13/test/test_package.py 
new/catkin_pkg-0.4.15/test/test_package.py
--- old/catkin_pkg-0.4.13/test/test_package.py  2019-07-26 18:11:19.000000000 
+0200
+++ new/catkin_pkg-0.4.15/test/test_package.py  2019-12-09 20:41:50.000000000 
+0100
@@ -10,6 +10,7 @@
     _get_package_xml,
     Dependency,
     Export,
+    has_ros_schema_reference_string,
     InvalidPackage,
     License,
     Package,
@@ -117,6 +118,14 @@
         dep = Dependency('foo', condition='foo <= bar or bar >= baz')
         self.assertFalse(dep.evaluate_condition({}))
 
+    def test_dependency_repr(self):
+        dep = Dependency('foo', condition='$foo == 2')
+        assert repr(dep) == "Dependency(name='foo', condition='$foo == 2')"
+        self.assertTrue(dep.evaluate_condition({'foo': 2}))
+        assert repr(dep) == "Dependency(name='foo', condition='$foo == 2', 
evaluated_condition=True)"
+        self.assertFalse(dep.evaluate_condition({'foo': 3}))
+        assert repr(dep) == "Dependency(name='foo', condition='$foo == 2', 
evaluated_condition=False)"
+
     def test_init_kwargs_string(self):
         pack = Package('foo',
                        name='bar',
@@ -338,3 +347,26 @@
             xml = xml.encode('utf-8')
             assert isinstance(xml, bytes)
         parse_package_string(xml)
+
+    def test_has_ros_schema_reference_string(self):
+        self.assertFalse(
+            has_ros_schema_reference_string(
+                """\
+<?xml version="1.0"?>
+<?xml-model href="http://some.url/to/a_wrong_schema.xsd"; 
schematypens="http://www.w3.org/2001/XMLSchema";?>
+<package/>
+"""))
+        self.assertFalse(
+            has_ros_schema_reference_string(
+                """\
+<?xml version="1.0"?>
+<package/>
+"""))
+        for format_version in (1, 2, 3):
+            self.assertTrue(
+                has_ros_schema_reference_string(
+                    """\
+<?xml version="1.0"?>
+<?xml-model href="http://download.ros.org/schema/package_format%d.xsd"; 
schematypens="http://www.w3.org/2001/XMLSchema";?>
+<package/>
+""" % format_version))


Reply via email to