From 543da3af12cc1859e5d2d229d159faa5dc5e8145 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 19 Apr 2020 13:46:19 +0200 Subject: Removing fix-test-with-python3.patch, not needed anymore. Signed-off-by: Daniel Baumann --- .../debian/0001-fix-test-with-python3.patch | 33 ---------------------- debian/patches/debian/0001-python3-hook.patch | 15 ++++++++++ debian/patches/debian/0002-python3-hook.patch | 15 ---------- debian/patches/series | 3 +- 4 files changed, 16 insertions(+), 50 deletions(-) delete mode 100644 debian/patches/debian/0001-fix-test-with-python3.patch create mode 100644 debian/patches/debian/0001-python3-hook.patch delete mode 100644 debian/patches/debian/0002-python3-hook.patch diff --git a/debian/patches/debian/0001-fix-test-with-python3.patch b/debian/patches/debian/0001-fix-test-with-python3.patch deleted file mode 100644 index 4844467..0000000 --- a/debian/patches/debian/0001-fix-test-with-python3.patch +++ /dev/null @@ -1,33 +0,0 @@ -Author: Gianfranco Costamagna -Description: replace readfp with Python2 read_file function, to fix a test failure: - https://github.com/jorisroovers/gitlint/pull/104 - -====================================================================== -FAIL: test_config_file (test_cli.CLITests) -Test for --config option ----------------------------------------------------------------------- -Traceback (most recent call last): - File "/usr/lib/python3.7/unittest/mock.py", line 1248, in patched - return func(*args, **keywargs) - File "/<>/gitlint/tests/test_cli.py", line 372, in test_config_file - self.assertEqual(result.output, "") -AssertionError: "/<>/git[197 chars]od\n" != '' -- /<>/gitlint/config.py:366: DeprecationWarning: This method will be removed in future versions. Use 'parser.read_file()' instead. -- parser.readfp(config_file, filename) # pylint: disable=deprecated-method ---- - gitlint/config.py | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff -Naurp gitlint.orig/gitlint/config.py gitlint/gitlint/config.py ---- gitlint.orig/gitlint/config.py -+++ gitlint/gitlint/config.py -@@ -428,8 +428,7 @@ class LintConfigBuilder(object): - parser = ConfigParser() - - with io.open(filename, encoding=DEFAULT_ENCODING) as config_file: -- # readfp() is deprecated in python 3.2+, but compatible with 2.7 -- parser.readfp(config_file, filename) # pylint: disable=deprecated-method -+ parser.read_file(config_file) - - for section_name in parser.sections(): - for option_name, option_value in parser.items(section_name): diff --git a/debian/patches/debian/0001-python3-hook.patch b/debian/patches/debian/0001-python3-hook.patch new file mode 100644 index 0000000..74cdcea --- /dev/null +++ b/debian/patches/debian/0001-python3-hook.patch @@ -0,0 +1,15 @@ +Author: Daniel Baumann +Description: Using python3 in commit-msg hook (Closes: #891538). + +diff -Naurp gitlint.orig/gitlint/files/commit-msg gitlint/gitlint/files/commit-msg +--- gitlint.orig/gitlint/files/commit-msg ++++ gitlint/gitlint/files/commit-msg +@@ -26,7 +26,7 @@ fi + + run_gitlint(){ + echo "gitlint: checking commit message..." +- python -m gitlint.cli --staged --msg-filename "$1" ++ python3 -m gitlint.cli --staged --msg-filename "$1" + gitlint_exit_code=$? + } + diff --git a/debian/patches/debian/0002-python3-hook.patch b/debian/patches/debian/0002-python3-hook.patch deleted file mode 100644 index 74cdcea..0000000 --- a/debian/patches/debian/0002-python3-hook.patch +++ /dev/null @@ -1,15 +0,0 @@ -Author: Daniel Baumann -Description: Using python3 in commit-msg hook (Closes: #891538). - -diff -Naurp gitlint.orig/gitlint/files/commit-msg gitlint/gitlint/files/commit-msg ---- gitlint.orig/gitlint/files/commit-msg -+++ gitlint/gitlint/files/commit-msg -@@ -26,7 +26,7 @@ fi - - run_gitlint(){ - echo "gitlint: checking commit message..." -- python -m gitlint.cli --staged --msg-filename "$1" -+ python3 -m gitlint.cli --staged --msg-filename "$1" - gitlint_exit_code=$? - } - diff --git a/debian/patches/series b/debian/patches/series index 3bfdd92..bc40938 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1 @@ -debian/0001-fix-test-with-python3.patch -debian/0002-python3-hook.patch +debian/0001-python3-hook.patch -- cgit v1.2.3