From 4d563e9294529e6a47afe992cb7a8c900958afec Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 26 Mar 2020 21:14:06 +0100 Subject: Moving debian specific patches to corresponding subdirectory. Signed-off-by: Daniel Baumann --- ...dfp-with-Python2-read_file-function-to-fi.patch | 40 ---------------------- .../debian/0001-fix-test-with-python3.patch | 33 ++++++++++++++++++ debian/patches/series | 2 +- 3 files changed, 34 insertions(+), 41 deletions(-) delete mode 100644 debian/patches/0001-replace-readfp-with-Python2-read_file-function-to-fi.patch create mode 100644 debian/patches/debian/0001-fix-test-with-python3.patch diff --git a/debian/patches/0001-replace-readfp-with-Python2-read_file-function-to-fi.patch b/debian/patches/0001-replace-readfp-with-Python2-read_file-function-to-fi.patch deleted file mode 100644 index dde4da9..0000000 --- a/debian/patches/0001-replace-readfp-with-Python2-read_file-function-to-fi.patch +++ /dev/null @@ -1,40 +0,0 @@ -Forwarded: https://github.com/jorisroovers/gitlint/pull/104 -From 84145c703a25acad5f2378535c642c5abc299fbe Mon Sep 17 00:00:00 2001 -From: Gianfranco Costamagna -Date: Thu, 26 Sep 2019 10:48:14 +0200 -Subject: [PATCH] replace readfp with Python2 read_file function, to fix a test - failure: - -====================================================================== -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 --git a/gitlint/config.py b/gitlint/config.py -index fdc5e85..654523d 100644 ---- a/gitlint/config.py -+++ b/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): --- -2.17.1 - diff --git a/debian/patches/debian/0001-fix-test-with-python3.patch b/debian/patches/debian/0001-fix-test-with-python3.patch new file mode 100644 index 0000000..4844467 --- /dev/null +++ b/debian/patches/debian/0001-fix-test-with-python3.patch @@ -0,0 +1,33 @@ +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/series b/debian/patches/series index 3fede26..65e35c4 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1 @@ -0001-replace-readfp-with-Python2-read_file-function-to-fi.patch +debian/0001-fix-test-with-python3.patch -- cgit v1.2.3