Hello community,

here is the log from the commit of package python-pkgconfig for 
openSUSE:Factory checked in at 2017-05-02 08:54:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pkgconfig (Old)
 and      /work/SRC/openSUSE:Factory/.python-pkgconfig.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pkgconfig"

Tue May  2 08:54:33 2017 rev:2 rq:489348 version:1.2.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pkgconfig/python-pkgconfig.changes        
2015-06-11 08:21:50.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python-pkgconfig.new/python-pkgconfig.changes   
2017-05-02 08:54:34.880957896 +0200
@@ -1,0 +2,7 @@
+Wed Apr 19 15:33:55 UTC 2017 - [email protected]
+
+- Update to version 1.1.0
+  + No changelog available
+- Implement single-spec version.
+
+-------------------------------------------------------------------

Old:
----
  pkgconfig-1.1.0.tar.gz

New:
----
  pkgconfig-1.2.2.tar.gz

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

Other differences:
------------------
++++++ python-pkgconfig.spec ++++++
--- /var/tmp/diff_new_pack.F4LB2v/_old  2017-05-02 08:54:35.772832135 +0200
+++ /var/tmp/diff_new_pack.F4LB2v/_new  2017-05-02 08:54:35.776831571 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-pkgconfig
 #
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -15,25 +15,29 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 
 
+%bcond_without tests
+
+%{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-pkgconfig
-Version:        1.1.0
+Version:        1.2.2
 Release:        0
 License:        MIT
 Summary:        Interface Python with pkg-config
 Url:            http://github.com/matze/pkgconfig
 Group:          Development/Languages/Python
-Source:         
https://pypi.python.org/packages/source/p/pkgconfig/pkgconfig-%{version}.tar.gz
-BuildRequires:  python-devel
-BuildRequires:  python-setuptools
-# Test requirements (wrongly marked as install req):
-BuildRequires:  python-nose
+Source:         
https://files.pythonhosted.org/packages/source/p/pkgconfig/pkgconfig-%{version}.tar.gz
+BuildRequires:  fdupes
+BuildRequires:  python-rpm-macros
+BuildRequires:  %{python_module devel}
+BuildRequires:  %{python_module setuptools}
+%if %{with tests}
+# Test requirements
+BuildRequires:  %{python_module nose}
+%endif
 Requires:       pkg-config
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-%if 0%{?suse_version} && 0%{?suse_version} <= 1110
-%{!?python_sitelib: %global python_sitelib %(python -c "from 
distutils.sysconfig import get_python_lib; print get_python_lib()")}
-%else
 BuildArch:      noarch
-%endif
+%python_subpackages
 
 %description
 A Python module to interface with the pkg-config
@@ -43,15 +47,18 @@
 %setup -q -n pkgconfig-%{version}
 
 %build
-python setup.py build
+%python_build
 
 %install
-python setup.py install --prefix=%{_prefix} --root=%{buildroot}
+%python_install
+%python_expand %fdupes %{buildroot}%{$python_sitelib}
 
-#%%check
-#python setup.py test
+%if %{with tests}
+%check
+%python_exec setup.py test
+%endif
 
-%files
+%files %{python_files}
 %defattr(-,root,root,-)
 %doc LICENSE README.rst
 %{python_sitelib}/*

++++++ pkgconfig-1.1.0.tar.gz -> pkgconfig-1.2.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkgconfig-1.1.0/MANIFEST.in 
new/pkgconfig-1.2.2/MANIFEST.in
--- old/pkgconfig-1.1.0/MANIFEST.in     2013-08-12 09:58:13.000000000 +0200
+++ new/pkgconfig-1.2.2/MANIFEST.in     2016-12-02 10:33:36.000000000 +0100
@@ -1,2 +1,4 @@
 include LICENSE
 include README.rst
+include test.py
+include data/*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkgconfig-1.1.0/PKG-INFO new/pkgconfig-1.2.2/PKG-INFO
--- old/pkgconfig-1.1.0/PKG-INFO        2013-11-06 15:15:45.000000000 +0100
+++ new/pkgconfig-1.2.2/PKG-INFO        2016-12-02 10:35:04.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: pkgconfig
-Version: 1.1.0
+Version: 1.2.2
 Summary: Interface Python with pkg-config
 Home-page: http://github.com/matze/pkgconfig
 Author: Matthias Vogelgesang
@@ -17,6 +17,10 @@
         
         It can be used to
         
+        -  find all pkg-config packages ::
+        
+               >>> packages = pkgconfig.list_all()
+        
         -  check if a package exists ::
         
                >>> pkgconfig.exists('glib-2.0')
@@ -39,8 +43,50 @@
         
                >>> d = pkgconfig.parse('glib-2.0 gtk+-2.0')
                >>> d['libraries']
-               set([u'glib-2.0', u'gtk+-2.0'])
+               [u'gtk+-2.0', u'glib-2.0']
+        
+           The ``pkgconfig.parse`` function return a dictonary of list.
+           The lists returned are an accurate representations of the equivalent
+           ``pkg-config`` call, both in content and order.
+        
+        If ``pkg-config`` is not on the path, raises ``EnvironmentError``.
         
         The ``pkgconfig`` module is licensed under the MIT license.
         
+        
+        Changelog
+        ---------
+        
+        Version 1.2.1 and 1.2.2
+        ~~~~~~~~~~~~~~~~~~~~~~~
+        
+        Bug fix releases released on December 1st and 2nd 2016.
+        
+        - Include the ``data`` folder in the distribution in order to run tests
+        - Improve the tests
+        
+        
+        Version 1.2.0
+        ~~~~~~~~~~~~~
+        
+        Released on November 30th 2016.
+        
+        - Potential break: switch from result set to list
+        - Expose --list-all query
+        - Added support for PKG_CONFIG environment variable
+        
+        
+        Version 1.1.0
+        ~~~~~~~~~~~~~
+        
+        Released on November 6th 2013.
+        
+        - Multiple packages can now be parsed with a single call to ``.parse``.
+        
+        
+        Version 1.0.0
+        ~~~~~~~~~~~~~
+        
+        First release on September 8th 2013.
+        
 Platform: UNKNOWN
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkgconfig-1.1.0/README.rst 
new/pkgconfig-1.2.2/README.rst
--- old/pkgconfig-1.1.0/README.rst      2013-11-06 15:13:54.000000000 +0100
+++ new/pkgconfig-1.2.2/README.rst      2016-12-02 10:34:33.000000000 +0100
@@ -9,6 +9,10 @@
 
 It can be used to
 
+-  find all pkg-config packages ::
+
+       >>> packages = pkgconfig.list_all()
+
 -  check if a package exists ::
 
        >>> pkgconfig.exists('glib-2.0')
@@ -31,6 +35,48 @@
 
        >>> d = pkgconfig.parse('glib-2.0 gtk+-2.0')
        >>> d['libraries']
-       set([u'glib-2.0', u'gtk+-2.0'])
+       [u'gtk+-2.0', u'glib-2.0']
+
+   The ``pkgconfig.parse`` function return a dictonary of list.
+   The lists returned are an accurate representations of the equivalent
+   ``pkg-config`` call, both in content and order.
+
+If ``pkg-config`` is not on the path, raises ``EnvironmentError``.
 
 The ``pkgconfig`` module is licensed under the MIT license.
+
+
+Changelog
+---------
+
+Version 1.2.1 and 1.2.2
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Bug fix releases released on December 1st and 2nd 2016.
+
+- Include the ``data`` folder in the distribution in order to run tests
+- Improve the tests
+
+
+Version 1.2.0
+~~~~~~~~~~~~~
+
+Released on November 30th 2016.
+
+- Potential break: switch from result set to list
+- Expose --list-all query
+- Added support for PKG_CONFIG environment variable
+
+
+Version 1.1.0
+~~~~~~~~~~~~~
+
+Released on November 6th 2013.
+
+- Multiple packages can now be parsed with a single call to ``.parse``.
+
+
+Version 1.0.0
+~~~~~~~~~~~~~
+
+First release on September 8th 2013.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkgconfig-1.1.0/data/fake-gtk+-3.0.pc 
new/pkgconfig-1.2.2/data/fake-gtk+-3.0.pc
--- old/pkgconfig-1.1.0/data/fake-gtk+-3.0.pc   1970-01-01 01:00:00.000000000 
+0100
+++ new/pkgconfig-1.2.2/data/fake-gtk+-3.0.pc   2016-12-02 10:33:36.000000000 
+0100
@@ -0,0 +1,14 @@
+prefix=/usr
+exec_prefix=/usr
+libdir=/usr/lib_gtk_foo
+includedir=/usr/include
+targets=x11 broadway
+
+gtk_binary_version=3.0.0
+gtk_host=x86_64-suse-linux-gnu
+
+Name: GTK+
+Description: GTK+ Graphical UI Library
+Version: 3.2.1
+Libs: -L${libdir} -lgtk-3 
+Cflags: -I${includedir}/gtk-3.0  -DGSEAL_ENABLE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkgconfig-1.1.0/data/fake-python.pc 
new/pkgconfig-1.2.2/data/fake-python.pc
--- old/pkgconfig-1.1.0/data/fake-python.pc     1970-01-01 01:00:00.000000000 
+0100
+++ new/pkgconfig-1.2.2/data/fake-python.pc     2016-12-02 10:33:36.000000000 
+0100
@@ -0,0 +1,13 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib_python_foo
+includedir=${prefix}/include
+
+Name: Python
+Description: Python library
+Requires: 
+Version: 2.7
+Libs.private: -lpthread -ldl  -lutil
+Libs: -L${libdir} -lpython2.7
+Cflags: -I${includedir}/python2.7 
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkgconfig-1.1.0/pkgconfig/pkgconfig.py 
new/pkgconfig-1.2.2/pkgconfig/pkgconfig.py
--- old/pkgconfig-1.1.0/pkgconfig/pkgconfig.py  2013-11-06 15:13:19.000000000 
+0100
+++ new/pkgconfig-1.2.2/pkgconfig/pkgconfig.py  2016-12-02 10:33:36.000000000 
+0100
@@ -22,9 +22,11 @@
 """pkgconfig is a Python module to interface with the pkg-config command line
 tool."""
 
+import os
 import subprocess
 import re
 import collections
+from functools import wraps
 
 
 def _compare_versions(v1, v2):
@@ -51,6 +53,7 @@
 
 
 def _convert_error(func):
+    @wraps(func)
     def _wrapper(*args, **kwargs):
         try:
             return func(*args, **kwargs)
@@ -62,7 +65,8 @@
 
 @_convert_error
 def _query(package, option):
-    cmd = 'pkg-config {0} {1}'.format(option, package).split()
+    pkg_config_exe = os.environ.get('PKG_CONFIG', None) or 'pkg-config'
+    cmd = '{0} {1} {2}'.format(pkg_config_exe, option, package).split()
     proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
                             stderr=subprocess.PIPE)
     out, err = proc.communicate()
@@ -72,19 +76,32 @@
 
 @_convert_error
 def exists(package):
-    """Return True if package information is available."""
-    cmd = 'pkg-config --exists {0}'.format(package).split()
+    """
+    Return True if package information is available.
+
+    If ``pkg-config`` not on path, raises ``EnvironmentError``.
+    """
+    pkg_config_exe = os.environ.get('PKG_CONFIG', None) or 'pkg-config'
+    cmd = '{0} --exists {1}'.format(pkg_config_exe, package).split()
     return subprocess.call(cmd) == 0
 
 
 @_convert_error
 def requires(package):
-    """Return a list of package names that is required by the package"""
+    """
+    Return a list of package names that is required by the package.
+
+    If ``pkg-config`` not on path, raises ``EnvironmentError``.
+    """
     return _query(package, '--print-requires').split('\n')
 
 
 def cflags(package):
-    """Return the CFLAGS string returned by pkg-config."""
+    """
+    Return the CFLAGS string returned by pkg-config.
+
+    If ``pkg-config`` not on path, raises ``EnvironmentError``.
+    """
     return _query(package, '--cflags')
 
 
@@ -108,6 +125,8 @@
     False
     >>> installed('foo', '>= 0.0.4')
     True
+
+    If ``pkg-config`` not on path, raises ``EnvironmentError``.
     """
     if not exists(package):
         return False
@@ -152,9 +171,11 @@
     Builds a dictionary containing the 'libraries', the 'library_dirs',
     the 'include_dirs', and the 'define_macros' that are presented by
     pkg-config. *package* is a string with space-delimited package names.
+
+    If ``pkg-config`` not on path, raises ``EnvironmentError``.
     """
     def parse_package(package):
-        result = collections.defaultdict(set)
+        result = collections.defaultdict(list)
 
         # Execute the query to pkg-config and clean the result.
         out = _query(package, '--cflags --libs')
@@ -164,27 +185,29 @@
         for token in out.split():
             key = _PARSE_MAP.get(token[:2])
             if key:
-                result[key].add(token[2:].strip())
+                result[key].append(token[2:].strip())
 
         # Iterate and clean define macros.
-        macros = set()
+        macros = list()
         for declaration in result['define_macros']:
             macro = tuple(declaration.split('='))
             if len(macro) == 1:
                 macro += '',
 
-            macros.add(macro)
+            macros.append(macro)
 
         result['define_macros'] = macros
 
         # Return parsed configuration.
         return result
 
-    # Go through all package names and update the result dict accordingly.
-    result = collections.defaultdict(set)
+    # Return the result of parse_package directly.
+    # We don't need to loop over the packages
+
+    return parse_package(packages)
 
-    for package in packages.split():
-        for k, v in parse_package(package).items():
-            result[k].update(v)
 
-    return result
+def list_all():
+    """Return a list of all packages found by pkg-config."""
+    packages = [line.split()[0] for line in _query('', 
'--list-all').split('\n')]
+    return packages
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkgconfig-1.1.0/pkgconfig.egg-info/PKG-INFO 
new/pkgconfig-1.2.2/pkgconfig.egg-info/PKG-INFO
--- old/pkgconfig-1.1.0/pkgconfig.egg-info/PKG-INFO     2013-11-06 
15:15:45.000000000 +0100
+++ new/pkgconfig-1.2.2/pkgconfig.egg-info/PKG-INFO     2016-12-02 
10:35:04.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: pkgconfig
-Version: 1.1.0
+Version: 1.2.2
 Summary: Interface Python with pkg-config
 Home-page: http://github.com/matze/pkgconfig
 Author: Matthias Vogelgesang
@@ -17,6 +17,10 @@
         
         It can be used to
         
+        -  find all pkg-config packages ::
+        
+               >>> packages = pkgconfig.list_all()
+        
         -  check if a package exists ::
         
                >>> pkgconfig.exists('glib-2.0')
@@ -39,8 +43,50 @@
         
                >>> d = pkgconfig.parse('glib-2.0 gtk+-2.0')
                >>> d['libraries']
-               set([u'glib-2.0', u'gtk+-2.0'])
+               [u'gtk+-2.0', u'glib-2.0']
+        
+           The ``pkgconfig.parse`` function return a dictonary of list.
+           The lists returned are an accurate representations of the equivalent
+           ``pkg-config`` call, both in content and order.
+        
+        If ``pkg-config`` is not on the path, raises ``EnvironmentError``.
         
         The ``pkgconfig`` module is licensed under the MIT license.
         
+        
+        Changelog
+        ---------
+        
+        Version 1.2.1 and 1.2.2
+        ~~~~~~~~~~~~~~~~~~~~~~~
+        
+        Bug fix releases released on December 1st and 2nd 2016.
+        
+        - Include the ``data`` folder in the distribution in order to run tests
+        - Improve the tests
+        
+        
+        Version 1.2.0
+        ~~~~~~~~~~~~~
+        
+        Released on November 30th 2016.
+        
+        - Potential break: switch from result set to list
+        - Expose --list-all query
+        - Added support for PKG_CONFIG environment variable
+        
+        
+        Version 1.1.0
+        ~~~~~~~~~~~~~
+        
+        Released on November 6th 2013.
+        
+        - Multiple packages can now be parsed with a single call to ``.parse``.
+        
+        
+        Version 1.0.0
+        ~~~~~~~~~~~~~
+        
+        First release on September 8th 2013.
+        
 Platform: UNKNOWN
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkgconfig-1.1.0/pkgconfig.egg-info/SOURCES.txt 
new/pkgconfig-1.2.2/pkgconfig.egg-info/SOURCES.txt
--- old/pkgconfig-1.1.0/pkgconfig.egg-info/SOURCES.txt  2013-11-06 
15:15:45.000000000 +0100
+++ new/pkgconfig-1.2.2/pkgconfig.egg-info/SOURCES.txt  2016-12-02 
10:35:04.000000000 +0100
@@ -2,9 +2,13 @@
 MANIFEST.in
 README.rst
 setup.py
+test.py
+data/fake-gtk+-3.0.pc
+data/fake-python.pc
 pkgconfig/__init__.py
 pkgconfig/pkgconfig.py
 pkgconfig.egg-info/PKG-INFO
 pkgconfig.egg-info/SOURCES.txt
 pkgconfig.egg-info/dependency_links.txt
+pkgconfig.egg-info/pbr.json
 pkgconfig.egg-info/top_level.txt
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkgconfig-1.1.0/pkgconfig.egg-info/pbr.json 
new/pkgconfig-1.2.2/pkgconfig.egg-info/pbr.json
--- old/pkgconfig-1.1.0/pkgconfig.egg-info/pbr.json     1970-01-01 
01:00:00.000000000 +0100
+++ new/pkgconfig-1.2.2/pkgconfig.egg-info/pbr.json     2016-12-02 
10:35:04.000000000 +0100
@@ -0,0 +1 @@
+{"is_release": false, "git_version": "bcc07b4"}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkgconfig-1.1.0/setup.py new/pkgconfig-1.2.2/setup.py
--- old/pkgconfig-1.1.0/setup.py        2013-11-06 15:14:54.000000000 +0100
+++ new/pkgconfig-1.2.2/setup.py        2016-12-02 10:33:53.000000000 +0100
@@ -1,6 +1,6 @@
 from setuptools import setup
 
-VERSION = '1.1.0'
+VERSION = '1.2.2'
 
 setup(
     name='pkgconfig',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkgconfig-1.1.0/test.py new/pkgconfig-1.2.2/test.py
--- old/pkgconfig-1.1.0/test.py 1970-01-01 01:00:00.000000000 +0100
+++ new/pkgconfig-1.2.2/test.py 2016-12-02 10:33:36.000000000 +0100
@@ -0,0 +1,57 @@
+import os
+import pkgconfig
+import nose.tools as nt
+
+os.environ['PKG_CONFIG_PATH'] = os.path.abspath('./data')
+PACKAGE_NAME = 'fake-gtk+-3.0'
+
+
+def test_exists():
+    nt.assert_true(pkgconfig.exists(PACKAGE_NAME))
+
+
+def test_version():
+    assertions = {
+        '3.2.1': True,
+        '==3.2.1': True,
+        '==3.2.2': False,
+        '> 2.2': True,
+        '> 3.4': False,
+        '<= 3.3.5': True,
+        '< 2.3': False
+    }
+
+    for version, val in assertions.items():
+        nt.assert_true(pkgconfig.installed(PACKAGE_NAME, version) == val)
+
+
+def test_cflags():
+    flags = pkgconfig.cflags(PACKAGE_NAME)
+
+    for flag in flags.split(' '):
+        nt.assert_true(flag in ('-DGSEAL_ENABLE', '-I/usr/include/gtk-3.0'))
+
+
+def test_libs():
+    flags = pkgconfig.libs(PACKAGE_NAME)
+
+    for flag in flags.split(' '):
+        nt.assert_true(flag in ('-L/usr/lib_gtk_foo', '-lgtk-3'))
+
+
+def test_parse():
+    config = pkgconfig.parse("fake-gtk+-3.0 fake-python")
+
+    nt.assert_true(('GSEAL_ENABLE', '') in config['define_macros'])
+    nt.assert_true('/usr/include/gtk-3.0' in config['include_dirs'])
+    nt.assert_true('/usr/lib_gtk_foo' in config['library_dirs'])
+    nt.assert_true('/usr/lib_python_foo' in config['library_dirs'])
+    nt.assert_true('gtk-3' in config['libraries'])
+
+    nt.assert_true('/usr/include/python2.7' in config['include_dirs'])
+
+
+def test_listall():
+    packages = pkgconfig.list_all()
+    nt.assert_true('fake-gtk+-3.0' in packages)
+    nt.assert_true('fake-python' in packages)


Reply via email to