commit python-unidiff for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-unidiff for openSUSE:Factory checked in at 2024-01-03 12:24:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-unidiff (Old) and /work/SRC/openSUSE:Factory/.python-unidiff.new.28375 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-unidiff" Wed Jan 3 12:24:11 2024 rev:11 rq:1135623 version:0.7.5 Changes: -------- --- /work/SRC/openSUSE:Factory/python-unidiff/python-unidiff.changes 2022-06-28 15:23:10.858014815 +0200 +++ /work/SRC/openSUSE:Factory/.python-unidiff.new.28375/python-unidiff.changes 2024-01-03 12:24:15.989895542 +0100 @@ -1,0 +2,8 @@ +Fri Dec 29 09:56:02 UTC 2023 - Dirk Müller <dmueller@suse.com> + +- update to 0.7.5: + * Fixed issue with spaces in filename when using custom git + prefix. + * Support binary patch format. + +------------------------------------------------------------------- Old: ---- v0.7.4.tar.gz New: ---- v0.7.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-unidiff.spec ++++++ --- /var/tmp/diff_new_pack.cgc39Z/_old 2024-01-03 12:24:16.633919072 +0100 +++ /var/tmp/diff_new_pack.cgc39Z/_new 2024-01-03 12:24:16.633919072 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-unidiff # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,16 +16,17 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%{?sle15_python_module_pythons} Name: python-unidiff -Version: 0.7.4 +Version: 0.7.5 Release: 0 Summary: Unified diff parsing/metadata extraction library License: MIT Group: Development/Languages/Python URL: https://github.com/matiasb/python-unidiff Source: https://github.com/matiasb/python-unidiff/archive/v%{version}.tar.gz -BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires(post): update-alternatives @@ -43,10 +44,10 @@ %setup -q -n python-unidiff-%{version} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_clone -a %{buildroot}%{_bindir}/unidiff %python_expand %fdupes %{buildroot}%{$python_sitelib} @@ -63,5 +64,6 @@ %doc HISTORY README.rst %license LICENSE %python_alternative %{_bindir}/unidiff -%{python_sitelib}/* +%{python_sitelib}/unidiff +%{python_sitelib}/unidiff-%{version}.dist-info ++++++ v0.7.4.tar.gz -> v0.7.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-unidiff-0.7.4/.travis.yml new/python-unidiff-0.7.5/.travis.yml --- old/python-unidiff-0.7.4/.travis.yml 2022-06-26 22:11:08.000000000 +0200 +++ new/python-unidiff-0.7.5/.travis.yml 2023-03-10 02:03:38.000000000 +0100 @@ -1,8 +1,8 @@ language: python python: - - "2.7" - - "3.6" - "3.7" - "3.8" - "3.9" + - "3.10" + - "3.11" script: ./run_tests.sh diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-unidiff-0.7.4/AUTHORS new/python-unidiff-0.7.5/AUTHORS --- old/python-unidiff-0.7.4/AUTHORS 2022-06-26 22:11:08.000000000 +0200 +++ new/python-unidiff-0.7.5/AUTHORS 2023-03-10 02:03:38.000000000 +0100 @@ -32,3 +32,5 @@ * Ronuk Raval (`@rraval`) * anthony sottile (`@asottile-sentry`) * (`@cpackham-atlnz`) + * David Leen (`@dleen`) + * Martin Liška (`@marxin`) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-unidiff-0.7.4/HISTORY new/python-unidiff-0.7.5/HISTORY --- old/python-unidiff-0.7.4/HISTORY 2022-06-26 22:11:08.000000000 +0200 +++ new/python-unidiff-0.7.5/HISTORY 2023-03-10 02:03:38.000000000 +0100 @@ -1,6 +1,12 @@ History ------- +0.7.5 - 2023-03-09 +------------------ + +* Fixed issue with spaces in filename when using custom git prefix. +* Support binary patch format. + 0.7.4 - 2022-06-26 ------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-unidiff-0.7.4/setup.py new/python-unidiff-0.7.5/setup.py --- old/python-unidiff-0.7.4/setup.py 2022-06-26 22:11:08.000000000 +0200 +++ new/python-unidiff-0.7.5/setup.py 2023-03-10 02:03:38.000000000 +0100 @@ -45,12 +45,11 @@ classifiers=[ 'Intended Audience :: Developers', 'Development Status :: 4 - Beta', - "Programming Language :: Python :: 2", - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], test_suite='tests', ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-unidiff-0.7.4/tests/samples/binary.diff new/python-unidiff-0.7.5/tests/samples/binary.diff --- old/python-unidiff-0.7.4/tests/samples/binary.diff 1970-01-01 01:00:00.000000000 +0100 +++ new/python-unidiff-0.7.5/tests/samples/binary.diff 2023-03-10 02:03:38.000000000 +0100 @@ -0,0 +1,23 @@ +From 62ea0eaf7e00170a8fca79f665442f9f44725956 Mon Sep 17 00:00:00 2001 +From: Martin Liska <mliska@suse.cz> +Date: Fri, 9 Dec 2022 12:05:32 +0100 +Subject: [PATCH] add pixel + +--- + 1x1.png | Bin 0 -> 95 bytes + 1 file changed, 0 insertions(+), 0 deletions(-) + create mode 100644 1x1.png + +diff --git a/1x1.png b/1x1.png +new file mode 100644 +index 0000000000000000000000000000000000000000..1914264c08781d1f30ee0b8482bccf44586f2dc1 +GIT binary patch +literal 95 +zcmeAS@N?(olHy`uVBq!ia0vp^j3CU&3?x-=hn)ga%mF?ju0VQumF+E%TuG2$FoVOh +l8)-lem#2$k2*>s01R$G<f$@>z9%CSj!PC{xWt~$(697H@6ZHT9 + +literal 0 +HcmV?d00001 + +-- +2.38.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-unidiff-0.7.4/tests/samples/git_filenames_with_spaces_prefix.diff new/python-unidiff-0.7.5/tests/samples/git_filenames_with_spaces_prefix.diff --- old/python-unidiff-0.7.4/tests/samples/git_filenames_with_spaces_prefix.diff 1970-01-01 01:00:00.000000000 +0100 +++ new/python-unidiff-0.7.5/tests/samples/git_filenames_with_spaces_prefix.diff 2023-03-10 02:03:38.000000000 +0100 @@ -0,0 +1,7 @@ +diff --git src://foo bar/baz dst://foo bar/baz +new file mode 100644 +index 00000000000..0a72e5064c8 +--- /dev/null ++++ dst://foo bar/baz +@@ -0,0 +1,1 @@ ++blah diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-unidiff-0.7.4/tests/test_parser.py new/python-unidiff-0.7.5/tests/test_parser.py --- old/python-unidiff-0.7.4/tests/test_parser.py 2022-06-26 22:11:08.000000000 +0200 +++ new/python-unidiff-0.7.5/tests/test_parser.py 2023-03-10 02:03:38.000000000 +0100 @@ -325,6 +325,18 @@ self.assertTrue(res[0].is_added_file) self.assertEqual(res[0].path, 'has spaces/t.sql') + def test_parse_filename_prefix_with_spaces(self): + filename = os.path.join(self.samples_dir, 'samples/git_filenames_with_spaces_prefix.diff') + with open(filename) as f: + res = PatchSet(f) + + self.assertEqual(len(res), 1) + + self.assertEqual(res[0].source_file, '/dev/null') + self.assertEqual(res[0].target_file, 'dst://foo bar/baz') + self.assertTrue(res[0].is_added_file) + self.assertEqual(res[0].path, 'dst://foo bar/baz') + def test_deleted_file(self): filename = os.path.join(self.samples_dir, 'samples/git_delete.diff') with open(filename) as f: @@ -422,6 +434,16 @@ self.assertEqual(hunk_positions, expected_hunk_positions) + def test_binary_patch(self): + utf8_file = os.path.join(self.samples_dir, 'samples/binary.diff') + with open(utf8_file, 'r') as diff_file: + res = PatchSet(diff_file) + self.assertEqual(len(res), 1) + patch = res[0] + self.assertEqual(patch.source_file, '/dev/null') + self.assertEqual(patch.target_file, 'b/1x1.png') + self.assertTrue(patch.is_binary_file) + self.assertTrue(patch.is_added_file) class TestVCSSamples(unittest.TestCase): """Tests for real examples from VCS.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-unidiff-0.7.4/unidiff/__version__.py new/python-unidiff-0.7.5/unidiff/__version__.py --- old/python-unidiff-0.7.4/unidiff/__version__.py 2022-06-26 22:11:08.000000000 +0200 +++ new/python-unidiff-0.7.5/unidiff/__version__.py 2023-03-10 02:03:38.000000000 +0100 @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # The MIT License (MIT) -# Copyright (c) 2014-2022 Matias Bordese +# Copyright (c) 2014-2023 Matias Bordese # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -21,4 +21,4 @@ # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE # OR OTHER DEALINGS IN THE SOFTWARE. -__version__ = '0.7.4' +__version__ = '0.7.5' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-unidiff-0.7.4/unidiff/constants.py new/python-unidiff-0.7.5/unidiff/constants.py --- old/python-unidiff-0.7.4/unidiff/constants.py 2022-06-26 22:11:08.000000000 +0200 +++ new/python-unidiff-0.7.5/unidiff/constants.py 2023-03-10 02:03:38.000000000 +0100 @@ -38,6 +38,8 @@ # check diff git line for git renamed files support RE_DIFF_GIT_HEADER = re.compile( r'^diff --git (?P<source>a/[^\t\n]+) (?P<target>b/[^\t\n]+)') +RE_DIFF_GIT_HEADER_URI_LIKE = re.compile( + r'^diff --git (?P<source>.*://[^\t\n]+) (?P<target>.*://[^\t\n]+)') RE_DIFF_GIT_HEADER_NO_PREFIX = re.compile( r'^diff --git (?P<source>[^\t\n]+) (?P<target>[^\t\n]+)') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-unidiff-0.7.4/unidiff/patch.py new/python-unidiff-0.7.5/unidiff/patch.py --- old/python-unidiff-0.7.4/unidiff/patch.py 2022-06-26 22:11:08.000000000 +0200 +++ new/python-unidiff-0.7.5/unidiff/patch.py 2023-03-10 02:03:38.000000000 +0100 @@ -40,6 +40,7 @@ LINE_VALUE_NO_NEWLINE, RE_DIFF_GIT_DELETED_FILE, RE_DIFF_GIT_HEADER, + RE_DIFF_GIT_HEADER_URI_LIKE, RE_DIFF_GIT_HEADER_NO_PREFIX, RE_DIFF_GIT_NEW_FILE, RE_HUNK_BODY_LINE, @@ -479,7 +480,9 @@ line = line.decode(encoding) # check for a git file rename - is_diff_git_header = RE_DIFF_GIT_HEADER.match(line) or RE_DIFF_GIT_HEADER_NO_PREFIX.match(line) + is_diff_git_header = RE_DIFF_GIT_HEADER.match(line) or \ + RE_DIFF_GIT_HEADER_URI_LIKE.match(line) or \ + RE_DIFF_GIT_HEADER_NO_PREFIX.match(line) if is_diff_git_header: patch_info = PatchInfo() source_file = is_diff_git_header.group('source') @@ -581,6 +584,12 @@ patch_info = None current_file = None continue + + if line == 'GIT binary patch\n': + current_file.is_binary_file = True + patch_info = None + current_file = None + continue patch_info.append(line)
participants (1)
-
Source-Sync