Hello community, here is the log from the commit of package python-kmatch for openSUSE:Factory checked in at 2019-07-24 20:36:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-kmatch (Old) and /work/SRC/openSUSE:Factory/.python-kmatch.new.4126 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-kmatch" Wed Jul 24 20:36:09 2019 rev:4 rq:718124 version:0.3.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-kmatch/python-kmatch.changes 2018-12-24 11:39:03.949575955 +0100 +++ /work/SRC/openSUSE:Factory/.python-kmatch.new.4126/python-kmatch.changes 2019-07-24 20:36:10.434569881 +0200 @@ -1,0 +2,6 @@ +Wed Jul 24 08:26:05 UTC 2019 - Tomáš Chvátal <[email protected]> + +- Update to 0.3.0: + * no upstream changelog + +------------------------------------------------------------------- Old: ---- kmatch-0.2.1.tar.gz New: ---- kmatch-0.3.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-kmatch.spec ++++++ --- /var/tmp/diff_new_pack.YfOOiq/_old 2019-07-24 20:36:11.034569816 +0200 +++ /var/tmp/diff_new_pack.YfOOiq/_new 2019-07-24 20:36:11.034569816 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-kmatch # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # 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-kmatch -Version: 0.2.1 +Version: 0.3.0 Release: 0 Summary: A language for matching/validating/filtering Python dictionaries License: MIT @@ -30,9 +30,8 @@ BuildRequires: python-rpm-macros # SECTION test requirements BuildRequires: %{python_module coverage >= 3.7.1} -BuildRequires: %{python_module mock} +BuildRequires: %{python_module mock >= 1.0.1} BuildRequires: %{python_module nose >= 1.3.0} -BuildRequires: python-mock >= 1.0.1 # /SECTION BuildArch: noarch ++++++ kmatch-0.2.1.tar.gz -> kmatch-0.3.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmatch-0.2.1/CONTRIBUTORS new/kmatch-0.3.0/CONTRIBUTORS --- old/kmatch-0.2.1/CONTRIBUTORS 2015-11-06 16:26:17.000000000 +0100 +++ new/kmatch-0.3.0/CONTRIBUTORS 2018-08-09 22:03:12.000000000 +0200 @@ -1,3 +1,3 @@ -Wes Kendall ([email protected]) -Micah Hausler ([email protected]) +Wes Kendall ([email protected]) +Micah Hausler ([email protected]) Wes Okes ([email protected]) \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmatch-0.2.1/LICENSE new/kmatch-0.3.0/LICENSE --- old/kmatch-0.2.1/LICENSE 2015-11-05 20:08:52.000000000 +0100 +++ new/kmatch-0.3.0/LICENSE 2018-08-09 22:03:12.000000000 +0200 @@ -1,20 +1,20 @@ -The MIT License (MIT) - -Copyright (c) 2014 Ambition - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +The MIT License (MIT) + +Copyright (c) 2014 Ambition + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmatch-0.2.1/MANIFEST.in new/kmatch-0.3.0/MANIFEST.in --- old/kmatch-0.2.1/MANIFEST.in 2015-11-05 20:08:52.000000000 +0100 +++ new/kmatch-0.3.0/MANIFEST.in 2018-08-09 22:03:12.000000000 +0200 @@ -1,3 +1,3 @@ -include README.rst -include CONTRIBUTORS -include LICENSE +include README.rst +include CONTRIBUTORS +include LICENSE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmatch-0.2.1/PKG-INFO new/kmatch-0.3.0/PKG-INFO --- old/kmatch-0.2.1/PKG-INFO 2018-04-06 23:30:13.000000000 +0200 +++ new/kmatch-0.3.0/PKG-INFO 2019-07-11 19:26:05.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: kmatch -Version: 0.2.1 +Version: 0.3.0 Summary: A language for matching/validating/filtering Python dictionaries Home-page: https://github.com/ambitioninc/kmatch Author: Wes Kendall @@ -48,10 +48,9 @@ Keywords: matching,dictionaries,filtering,validation Platform: UNKNOWN Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3.3 -Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmatch-0.2.1/README.rst new/kmatch-0.3.0/README.rst --- old/kmatch-0.2.1/README.rst 2015-11-05 20:08:52.000000000 +0100 +++ new/kmatch-0.3.0/README.rst 2018-08-09 22:03:12.000000000 +0200 @@ -1,38 +1,38 @@ -.. image:: https://travis-ci.org/ambitioninc/kmatch.png - :target: https://travis-ci.org/ambitioninc/kmatch - -.. image:: https://coveralls.io/repos/ambitioninc/kmatch/badge.png?branch=develop - :target: https://coveralls.io/r/ambitioninc/kmatch?branch=develop - -.. image:: https://pypip.in/v/kmatch/badge.png - :target: https://crate.io/packages/kmatch/ - :alt: Latest PyPI version - -.. image:: https://pypip.in/d/kmatch/badge.png - :target: https://crate.io/packages/kmatch/ - :alt: Number of PyPI downloads - - -kmatch -====== - -A language for matching/validating/filtering Python dictionaries - -Installation ------------- -To install the latest release, type:: - - pip install kmatch - -To install the latest code directly from source, type:: - - pip install git+git://github.com/ambitioninc/kmatch.git - -Documentation -------------- - -Full documentation is available at http://kmatch.readthedocs.org - -License -------- -MIT License (see LICENSE) +.. image:: https://travis-ci.org/ambitioninc/kmatch.png + :target: https://travis-ci.org/ambitioninc/kmatch + +.. image:: https://coveralls.io/repos/ambitioninc/kmatch/badge.png?branch=develop + :target: https://coveralls.io/r/ambitioninc/kmatch?branch=develop + +.. image:: https://pypip.in/v/kmatch/badge.png + :target: https://crate.io/packages/kmatch/ + :alt: Latest PyPI version + +.. image:: https://pypip.in/d/kmatch/badge.png + :target: https://crate.io/packages/kmatch/ + :alt: Number of PyPI downloads + + +kmatch +====== + +A language for matching/validating/filtering Python dictionaries + +Installation +------------ +To install the latest release, type:: + + pip install kmatch + +To install the latest code directly from source, type:: + + pip install git+git://github.com/ambitioninc/kmatch.git + +Documentation +------------- + +Full documentation is available at http://kmatch.readthedocs.org + +License +------- +MIT License (see LICENSE) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmatch-0.2.1/kmatch/__init__.py new/kmatch-0.3.0/kmatch/__init__.py --- old/kmatch-0.2.1/kmatch/__init__.py 2015-11-05 20:08:52.000000000 +0100 +++ new/kmatch-0.3.0/kmatch/__init__.py 2018-08-09 22:03:12.000000000 +0200 @@ -1,4 +1,4 @@ -# flake8: noqa -from .version import __version__ -from .kmatch import K -from .mixins import KmatchTestMixin +# flake8: noqa +from .version import __version__ +from .kmatch import K +from .mixins import KmatchTestMixin diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmatch-0.2.1/kmatch/kmatch.py new/kmatch-0.3.0/kmatch/kmatch.py --- old/kmatch-0.2.1/kmatch/kmatch.py 2018-04-06 23:29:59.000000000 +0200 +++ new/kmatch-0.3.0/kmatch/kmatch.py 2019-07-10 23:28:52.000000000 +0200 @@ -76,7 +76,7 @@ """ if self._is_value_filter(p) and p[0] == '=~': try: - p[2] = re.compile(p[2]) + p[2] = re.compile(p[2], re.DOTALL) except: # Python doesn't document exactly what exceptions re.compile throws raise ValueError('Bad regex - {0}'.format(p[2])) elif self._is_operator(p): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmatch-0.2.1/kmatch/mixins.py new/kmatch-0.3.0/kmatch/mixins.py --- old/kmatch-0.2.1/kmatch/mixins.py 2015-11-05 20:08:52.000000000 +0100 +++ new/kmatch-0.3.0/kmatch/mixins.py 2018-08-09 22:03:12.000000000 +0200 @@ -1,46 +1,46 @@ -from .kmatch import K - - -class KmatchTestMixin(object): - """ - A mixin for test classes to perform kmatch validation on dictionaries - """ - def assertKmatches(self, pattern, value, suppress_key_errors=False): - """ - Assert that the value matches the kmatch pattern. - - :type pattern: list - :param pattern: The kmatch pattern - - :type value: dict - :param value: The dictionary to evaluate - - :type suppress_key_errors: bool - :param suppress_key_errors: Suppress KeyError exceptions on filters and return False instead. False by default - - :raises: - * :class:`KeyError <exceptions.KeyError>` if key from pattern does not exist in input value and the \ - suppress_key_errors class variable is False - * :class:`AssertionError <exceptions.AssertionError>` if the value **does not** match the pattern - """ - assert K(pattern, suppress_key_errors=suppress_key_errors).match(value) - - def assertNotKmatches(self, pattern, value, suppress_key_errors=True): - """ - Assert that the value does **not** matches the kmatch pattern. - - :type pattern: list - :param pattern: The kmatch pattern - - :type value: dict - :param value: The dictionary to evaluate - - :type suppress_key_errors: bool - :param suppress_key_errors: Suppress KeyError exceptions on filters and return False instead. True by default - - :raises: - * :class:`KeyError <exceptions.KeyError>` if key from pattern does not exist in input value and the \ - suppress_key_errors class variable is False - * :class:`AssertionError <exceptions.AssertionError>` if the value **does match** the pattern - """ - assert not K(pattern, suppress_key_errors=suppress_key_errors).match(value) +from .kmatch import K + + +class KmatchTestMixin(object): + """ + A mixin for test classes to perform kmatch validation on dictionaries + """ + def assertKmatches(self, pattern, value, suppress_key_errors=False): + """ + Assert that the value matches the kmatch pattern. + + :type pattern: list + :param pattern: The kmatch pattern + + :type value: dict + :param value: The dictionary to evaluate + + :type suppress_key_errors: bool + :param suppress_key_errors: Suppress KeyError exceptions on filters and return False instead. False by default + + :raises: + * :class:`KeyError <exceptions.KeyError>` if key from pattern does not exist in input value and the \ + suppress_key_errors class variable is False + * :class:`AssertionError <exceptions.AssertionError>` if the value **does not** match the pattern + """ + assert K(pattern, suppress_key_errors=suppress_key_errors).match(value) + + def assertNotKmatches(self, pattern, value, suppress_key_errors=True): + """ + Assert that the value does **not** matches the kmatch pattern. + + :type pattern: list + :param pattern: The kmatch pattern + + :type value: dict + :param value: The dictionary to evaluate + + :type suppress_key_errors: bool + :param suppress_key_errors: Suppress KeyError exceptions on filters and return False instead. True by default + + :raises: + * :class:`KeyError <exceptions.KeyError>` if key from pattern does not exist in input value and the \ + suppress_key_errors class variable is False + * :class:`AssertionError <exceptions.AssertionError>` if the value **does match** the pattern + """ + assert not K(pattern, suppress_key_errors=suppress_key_errors).match(value) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmatch-0.2.1/kmatch/tests/kmatch_tests.py new/kmatch-0.3.0/kmatch/tests/kmatch_tests.py --- old/kmatch-0.2.1/kmatch/tests/kmatch_tests.py 2018-04-06 23:29:59.000000000 +0200 +++ new/kmatch-0.3.0/kmatch/tests/kmatch_tests.py 2019-07-10 23:28:52.000000000 +0200 @@ -62,6 +62,9 @@ def test_basic_regex_true(self): self.assertTrue(K(['=~', 'f', '^hi$']).match({'f': 'hi'})) + def test_multiline_regex_true(self): + self.assertTrue(K(['=~', 'f', '.*hi.*']).match({'f': 'foo\nhi'})) + def test_basic_regex_false(self): self.assertFalse(K(['=~', 'f', '^hi$']).match({'f': ' hi'})) @@ -357,19 +360,19 @@ ] ]) - @patch('kmatch.kmatch.re.compile', spec_set=True, side_effect=lambda x: '{0}_compiled'.format(x)) + @patch('kmatch.kmatch.re.compile', spec_set=True, side_effect=lambda x, flags: '{0}_compiled'.format(x)) def test_unnested(self, mock_compile): k = K(['=~', 'field', 'hi']) self.assertEquals(mock_compile.call_count, 1) self.assertEquals(k._compiled_pattern, ['=~', 'field', 'hi_compiled']) - @patch('kmatch.kmatch.re.compile', spec_set=True, side_effect=lambda x: '{0}_compiled'.format(x)) + @patch('kmatch.kmatch.re.compile', spec_set=True, side_effect=lambda x, flags: '{0}_compiled'.format(x)) def test_nested_list_of_single_dict(self, mock_compile): k = K(['!', ['=~', 'field', 'hi']]) self.assertEquals(mock_compile.call_count, 1) self.assertEquals(k._compiled_pattern, ['!', ['=~', 'field', 'hi_compiled']]) - @patch('kmatch.kmatch.re.compile', spec_set=True, side_effect=lambda x: '{0}_compiled'.format(x)) + @patch('kmatch.kmatch.re.compile', spec_set=True, side_effect=lambda x, flags: '{0}_compiled'.format(x)) def test_nested_list_of_lists(self, mock_compile): k = K(['&', [['=~', 'f', 'hi'], ['=~', 'f', 'hello']]]) self.assertEquals(mock_compile.call_count, 2) @@ -377,7 +380,7 @@ k._compiled_pattern, ['&', [['=~', 'f', 'hi_compiled'], ['=~', 'f', 'hello_compiled']]]) - @patch('kmatch.kmatch.re.compile', spec_set=True, side_effect=lambda x: '{0}_compiled'.format(x)) + @patch('kmatch.kmatch.re.compile', spec_set=True, side_effect=lambda x, flags: '{0}_compiled'.format(x)) def test_triply_nested_list_of_dicts(self, mock_compile): k = K(['&', [ ['=~', 'f', 'hi'], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmatch-0.2.1/kmatch/tests/mixin_tests.py new/kmatch-0.3.0/kmatch/tests/mixin_tests.py --- old/kmatch-0.2.1/kmatch/tests/mixin_tests.py 2015-11-05 20:08:52.000000000 +0100 +++ new/kmatch-0.3.0/kmatch/tests/mixin_tests.py 2018-08-09 22:03:12.000000000 +0200 @@ -1,39 +1,39 @@ -import unittest - -from kmatch import KmatchTestMixin - - -class MixinTestUsingMixin(KmatchTestMixin, unittest.TestCase): - - def test_matches(self): - """ - Test .assertMatches() using the mixin on a true match - """ - self.assertKmatches(['<=', 'f', 0], {'f': -1}) - - def test_matches_raises_error(self): - """ - Test .assertMatches() using the mixin on a false match - """ - with self.assertRaises(AssertionError): - self.assertKmatches(['<=', 'f', 0], {'f': 1}) - - def test_not_matches(self): - """ - Test .assertNotMatches() using the mixin on a false match - """ - self.assertNotKmatches(['<=', 'f', 0], {'f': 1}) - - def test_not_matches_no_key_error(self): - """ - Test .assertNotMatches() using the mixin on a false match - """ - self.assertNotKmatches(['<=', 'f', 0], {'g': 1}) - self.assertNotKmatches(['<=', 'f', 0], {'f': 1}) - - def test_not_matches_raises_error(self): - """ - Test .assertNotMatches() using the mixin raises an error on a match - """ - with self.assertRaises(AssertionError): - self.assertNotKmatches(['<=', 'f', 0], {'f': -1}) +import unittest + +from kmatch import KmatchTestMixin + + +class MixinTestUsingMixin(KmatchTestMixin, unittest.TestCase): + + def test_matches(self): + """ + Test .assertMatches() using the mixin on a true match + """ + self.assertKmatches(['<=', 'f', 0], {'f': -1}) + + def test_matches_raises_error(self): + """ + Test .assertMatches() using the mixin on a false match + """ + with self.assertRaises(AssertionError): + self.assertKmatches(['<=', 'f', 0], {'f': 1}) + + def test_not_matches(self): + """ + Test .assertNotMatches() using the mixin on a false match + """ + self.assertNotKmatches(['<=', 'f', 0], {'f': 1}) + + def test_not_matches_no_key_error(self): + """ + Test .assertNotMatches() using the mixin on a false match + """ + self.assertNotKmatches(['<=', 'f', 0], {'g': 1}) + self.assertNotKmatches(['<=', 'f', 0], {'f': 1}) + + def test_not_matches_raises_error(self): + """ + Test .assertNotMatches() using the mixin raises an error on a match + """ + with self.assertRaises(AssertionError): + self.assertNotKmatches(['<=', 'f', 0], {'f': -1}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmatch-0.2.1/kmatch/version.py new/kmatch-0.3.0/kmatch/version.py --- old/kmatch-0.2.1/kmatch/version.py 2018-04-06 23:29:59.000000000 +0200 +++ new/kmatch-0.3.0/kmatch/version.py 2019-07-10 23:29:15.000000000 +0200 @@ -1 +1 @@ -__version__ = '0.2.1' +__version__ = '0.3.0' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmatch-0.2.1/kmatch.egg-info/PKG-INFO new/kmatch-0.3.0/kmatch.egg-info/PKG-INFO --- old/kmatch-0.2.1/kmatch.egg-info/PKG-INFO 2018-04-06 23:30:09.000000000 +0200 +++ new/kmatch-0.3.0/kmatch.egg-info/PKG-INFO 2019-07-11 19:26:04.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: kmatch -Version: 0.2.1 +Version: 0.3.0 Summary: A language for matching/validating/filtering Python dictionaries Home-page: https://github.com/ambitioninc/kmatch Author: Wes Kendall @@ -48,10 +48,9 @@ Keywords: matching,dictionaries,filtering,validation Platform: UNKNOWN Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3.3 -Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmatch-0.2.1/setup.cfg new/kmatch-0.3.0/setup.cfg --- old/kmatch-0.2.1/setup.cfg 2018-04-06 23:30:13.000000000 +0200 +++ new/kmatch-0.3.0/setup.cfg 2019-07-11 19:26:05.000000000 +0200 @@ -13,5 +13,4 @@ [egg_info] tag_build = tag_date = 0 -tag_svn_revision = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmatch-0.2.1/setup.py new/kmatch-0.3.0/setup.py --- old/kmatch-0.2.1/setup.py 2018-04-06 23:14:00.000000000 +0200 +++ new/kmatch-0.3.0/setup.py 2018-08-09 22:08:11.000000000 +0200 @@ -1,51 +1,50 @@ -# import multiprocessing to avoid this bug (http://bugs.python.org/issue15881#msg170215) -import multiprocessing -assert multiprocessing -import re -from setuptools import setup, find_packages - - -def get_version(): - """ - Extracts the version number from the version.py file. - """ - VERSION_FILE = 'kmatch/version.py' - mo = re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]', open(VERSION_FILE, 'rt').read(), re.M) - if mo: - return mo.group(1) - else: - raise RuntimeError('Unable to find version string in {0}.'.format(VERSION_FILE)) - - -setup( - name='kmatch', - version=get_version(), - description='A language for matching/validating/filtering Python dictionaries', - long_description=open('README.rst').read(), - url='https://github.com/ambitioninc/kmatch', - author='Wes Kendall', - author_email='[email protected]', - keywords='matching, dictionaries, filtering, validation', - packages=find_packages(), - classifiers=[ - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: MIT License', - 'Operating System :: OS Independent', - 'Development Status :: 5 - Production/Stable', - ], - license='MIT', - install_requires=[], - include_package_data=True, - test_suite='nose.collector', - tests_require=[ - 'nose>=1.3.0', - 'coverage>=3.7.1', - 'mock>=1.0.1', - ], - zip_safe=False, -) +# import multiprocessing to avoid this bug (http://bugs.python.org/issue15881#msg170215) +import multiprocessing +assert multiprocessing +import re +from setuptools import setup, find_packages + + +def get_version(): + """ + Extracts the version number from the version.py file. + """ + VERSION_FILE = 'kmatch/version.py' + mo = re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]', open(VERSION_FILE, 'rt').read(), re.M) + if mo: + return mo.group(1) + else: + raise RuntimeError('Unable to find version string in {0}.'.format(VERSION_FILE)) + + +setup( + name='kmatch', + version=get_version(), + description='A language for matching/validating/filtering Python dictionaries', + long_description=open('README.rst').read(), + url='https://github.com/ambitioninc/kmatch', + author='Wes Kendall', + author_email='[email protected]', + keywords='matching, dictionaries, filtering, validation', + packages=find_packages(), + classifiers=[ + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Operating System :: OS Independent', + 'Development Status :: 5 - Production/Stable', + ], + license='MIT', + install_requires=[], + include_package_data=True, + test_suite='nose.collector', + tests_require=[ + 'nose>=1.3.0', + 'coverage>=3.7.1', + 'mock>=1.0.1', + ], + zip_safe=False, +)
