Hello community, here is the log from the commit of package python-unify for openSUSE:Factory checked in at 2019-09-11 10:34:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-unify (Old) and /work/SRC/openSUSE:Factory/.python-unify.new.7948 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-unify" Wed Sep 11 10:34:59 2019 rev:4 rq:729741 version:0.5 Changes: -------- --- /work/SRC/openSUSE:Factory/python-unify/python-unify.changes 2019-06-06 18:16:31.236700114 +0200 +++ /work/SRC/openSUSE:Factory/.python-unify.new.7948/python-unify.changes 2019-09-11 10:35:00.563302915 +0200 @@ -1,0 +2,7 @@ +Tue Sep 10 09:32:34 UTC 2019 - Tomáš Chvátal <[email protected]> + +- Update to 0.5: + * Provide license + * minor fixes + +------------------------------------------------------------------- Old: ---- v0.4.tar.gz New: ---- v0.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-unify.spec ++++++ --- /var/tmp/diff_new_pack.udxIlc/_old 2019-09-11 10:35:01.055302773 +0200 +++ /var/tmp/diff_new_pack.udxIlc/_new 2019-09-11 10:35:01.063302771 +0200 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-unify -Version: 0.4 +Version: 0.5 Release: 0 Summary: Tool to modify strings to use the same quotes License: MIT @@ -29,13 +29,13 @@ BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros +Requires: python-setuptools Requires: python-untokenize BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module pytest} BuildRequires: %{python_module untokenize} # /SECTION -Requires: python-setuptools %python_subpackages %description @@ -61,6 +61,7 @@ mv %{buildroot}%{_bindir}/unify %{buildroot}%{_bindir}/unify_quotes %files %{python_files} +%license LICENSE %doc README.rst README.suse %python3_only %{_bindir}/unify_quotes %{python_sitelib}/* ++++++ v0.4.tar.gz -> v0.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unify-0.4/.pre-commit-hooks.yaml new/unify-0.5/.pre-commit-hooks.yaml --- old/unify-0.4/.pre-commit-hooks.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/unify-0.5/.pre-commit-hooks.yaml 2019-08-07 15:44:00.000000000 +0200 @@ -0,0 +1,7 @@ +- id: unify + name: unify + entry: unify + language: python + types: [python] + require_serial: true + args: ["--in-place"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unify-0.4/.travis.yml new/unify-0.5/.travis.yml --- old/unify-0.4/.travis.yml 2017-11-21 04:07:22.000000000 +0100 +++ new/unify-0.5/.travis.yml 2019-08-07 15:44:00.000000000 +0200 @@ -2,7 +2,6 @@ python: - "2.7" - - "3.3" - "3.4" - "3.5" - "3.6" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unify-0.4/LICENSE new/unify-0.5/LICENSE --- old/unify-0.4/LICENSE 1970-01-01 01:00:00.000000000 +0100 +++ new/unify-0.5/LICENSE 2019-08-07 15:44:00.000000000 +0200 @@ -0,0 +1,19 @@ +Copyright (C) 2013-2018 Steven Myint + +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/unify-0.4/MANIFEST.in new/unify-0.5/MANIFEST.in --- old/unify-0.4/MANIFEST.in 2017-11-21 04:07:22.000000000 +0100 +++ new/unify-0.5/MANIFEST.in 2019-08-07 15:44:00.000000000 +0200 @@ -1 +1,2 @@ +include LICENSE include README.rst diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unify-0.4/Makefile new/unify-0.5/Makefile --- old/unify-0.4/Makefile 2017-11-21 04:07:22.000000000 +0100 +++ new/unify-0.5/Makefile 2019-08-07 15:44:00.000000000 +0200 @@ -4,6 +4,7 @@ pylint \ --reports=no \ --disable=invalid-name \ + --disable=inconsistent-return-statements \ --rcfile=/dev/null \ unify.py setup.py rstcheck README.rst diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unify-0.4/setup.py new/unify-0.5/setup.py --- old/unify-0.4/setup.py 2017-11-21 04:07:22.000000000 +0100 +++ new/unify-0.5/setup.py 2019-08-07 15:44:00.000000000 +0200 @@ -14,6 +14,7 @@ for line in input_file: if line.startswith('__version__'): return ast.parse(line).body[0].value.s + return None with open('README.rst') as readme: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unify-0.4/test_unify.py new/unify-0.5/test_unify.py --- old/unify-0.4/test_unify.py 2017-11-21 04:07:22.000000000 +0100 +++ new/unify-0.5/test_unify.py 2019-08-07 15:44:00.000000000 +0200 @@ -103,6 +103,88 @@ preferred_quote="'")) +class TestUnitsWithRawStrings(unittest.TestCase): + """Test for r-prefix raw string handling.""" + + def test_unify_quotes(self): + self.assertEqual("r'foo'", + unify.unify_quotes('r"foo"', + preferred_quote="'")) + + self.assertEqual('r"foo"', + unify.unify_quotes('r"foo"', + preferred_quote='"')) + + self.assertEqual('r"foo"', + unify.unify_quotes("r'foo'", + preferred_quote='"')) + + def test_unify_quotes_should_avoid_some_cases(self): + self.assertEqual('''r"foo's"''', + unify.unify_quotes('''r"foo's"''', + preferred_quote="'")) + + self.assertEqual('''r"""\\t"""''', + unify.unify_quotes('''r"""\\t"""''', + preferred_quote="'")) + + def test_format_code(self): + self.assertEqual("x = r'abc' \\\nr'next'\n", + unify.format_code('x = r"abc" \\\nr"next"\n', + preferred_quote="'")) + + def test_format_code_with_backslash_in_comment(self): + self.assertEqual("x = r'abc' #\\\nr'next'\n", + unify.format_code('x = r"abc" #\\\nr"next"\n', + preferred_quote="'")) + + def test_format_code_with_syntax_error(self): + self.assertEqual('foo(r"Tabs \t, new lines \n."\n', + unify.format_code('foo(r"Tabs \t, new lines \n."\n', + preferred_quote="'")) + + +class TestUnitsWithUnicodeStrings(unittest.TestCase): + """Test for u-prefix unicode string handling.""" + + def test_unify_quotes(self): + self.assertEqual("u'foo'", + unify.unify_quotes('u"foo"', + preferred_quote="'")) + + self.assertEqual('u"foo"', + unify.unify_quotes('u"foo"', + preferred_quote='"')) + + self.assertEqual('u"foo"', + unify.unify_quotes("u'foo'", + preferred_quote='"')) + + def test_unify_quotes_should_avoid_some_cases(self): + self.assertEqual('''u"foo's"''', + unify.unify_quotes('''u"foo's"''', + preferred_quote="'")) + + self.assertEqual('''u"""foo"""''', + unify.unify_quotes('''u"""foo"""''', + preferred_quote="'")) + + def test_format_code(self): + self.assertEqual("x = u'abc' \\\nu'next'\n", + unify.format_code('x = u"abc" \\\nu"next"\n', + preferred_quote="'")) + + def test_format_code_with_backslash_in_comment(self): + self.assertEqual("x = u'abc' #\\\nu'next'\n", + unify.format_code('x = u"abc" #\\\nu"next"\n', + preferred_quote="'")) + + def test_format_code_with_syntax_error(self): + self.assertEqual('foo(u"abc"\n', + unify.format_code('foo(u"abc"\n', + preferred_quote="'")) + + class TestUnitsWithByteStrings(unittest.TestCase): """ Tests for python3 byte string handling.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unify-0.4/unify.py new/unify-0.5/unify.py --- old/unify-0.4/unify.py 2017-11-21 04:07:22.000000000 +0100 +++ new/unify-0.5/unify.py 2019-08-07 15:44:00.000000000 +0200 @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Copyright (C) 2013-2017 Steven Myint +# Copyright (C) 2013-2018 Steven Myint # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -36,7 +36,7 @@ import untokenize -__version__ = '0.4' +__version__ = '0.5' try: @@ -85,6 +85,8 @@ allowed_starts = { '': bad_quote, 'f': 'f' + bad_quote, + 'r': 'r' + bad_quote, + 'u': 'u' + bad_quote, 'b': 'b' + bad_quote } @@ -163,6 +165,8 @@ return True + return False + def _main(argv, standard_out, standard_error): """Run quotes unifying on files. @@ -214,7 +218,7 @@ def main(): # pragma: no cover - """Main entry point.""" + """Return exit status.""" try: # Exit on broken pipe. signal.signal(signal.SIGPIPE, signal.SIG_DFL)
