From a0eb6d51877b72f86d07fece6fb44affea925348 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Tue, 18 Oct 2022 19:24:08 +0100 Subject: [PATCH 1/5] Align documentation of debug in man pages Linked to: b3967f75 ("Correct documentation of --debug in linkchecker(1)", 2022-09-30) --- doc/src/man/linkchecker.rst | 2 +- doc/src/man/linkcheckerrc.rst | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/src/man/linkchecker.rst b/doc/src/man/linkchecker.rst index fd4a38ed..d802f3f8 100644 --- a/doc/src/man/linkchecker.rst +++ b/doc/src/man/linkchecker.rst @@ -157,7 +157,7 @@ Application .. option:: -D STRING, --debug=STRING Print debugging output for the given logger. - Available loggers are cmdline, checking, cache, plugin and all. + Available debug loggers are cmdline, checking, cache, plugin and all. all is an alias for all available loggers. This option can be given multiple times to debug with more than one logger. diff --git a/doc/src/man/linkcheckerrc.rst b/doc/src/man/linkcheckerrc.rst index cab02d28..b9b4087f 100644 --- a/doc/src/man/linkcheckerrc.rst +++ b/doc/src/man/linkcheckerrc.rst @@ -220,10 +220,9 @@ Application """"""""""" **debug=**\ *STRING*\ [**,**\ *STRING*...] - Print debugging output for the given modules. Available debug - modules are **cmdline**, **checking**, **cache**, **dns**, - **thread**, **plugins** and **all**. Specifying **all** is an alias - for specifying all available loggers. + Print debugging output for the given logger. Available debug + loggers are **cmdline**, **checking**, **cache**, **plugin** and **all**. + **all** is an alias for all available loggers. Command line option: :option:`--debug` Quiet From ef2d571761c497064f8cfee1c95cc362937ef6f5 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Tue, 18 Oct 2022 19:24:08 +0100 Subject: [PATCH 2/5] Support building wheel from sdist Build hook is also called for the wheel since: 38dea6b7 ("Fix install with pip git+https", 2022-09-13) --- tools/hatch_build.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/hatch_build.py b/tools/hatch_build.py index 50c80bc1..0e3a1e5f 100644 --- a/tools/hatch_build.py +++ b/tools/hatch_build.py @@ -41,9 +41,12 @@ class CustomBuildHook(BuildHookInterface): committer_date = committer_year = "unknown" try: cp = subprocess.run(["git", "log", "-n 1", "HEAD", "--format=%cs"], - capture_output=True, text=True) - except FileNotFoundError: - pass + capture_output=True, check=True, text=True) + except (FileNotFoundError, subprocess.CalledProcessError): + # support building wheel from sdist + if Path(*RELEASE_PY).is_file(): + self.app.display_warning("_release.py already exists") + return else: if cp and cp.stdout: committer_date = cp.stdout.strip() From deac09d2c1ba3398b882615fc03a0e9f87410041 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Tue, 18 Oct 2022 19:24:08 +0100 Subject: [PATCH 3/5] Clarify note in TestConfig --- tests/configuration/test_config.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/configuration/test_config.py b/tests/configuration/test_config.py index 26f5fc4e..959c7e05 100644 --- a/tests/configuration/test_config.py +++ b/tests/configuration/test_config.py @@ -36,8 +36,7 @@ class TestConfig(TestBase): """Test configuration parsing.""" def test_confparse(self): - # Tests must either cover every possiblity or - # use a value other than the default + # Tests must not use the default value only config = linkcheck.configuration.Configuration() files = [get_file("config0.ini")] config.read(files) From 9631c314dd9e3def7530a0eed37ad0cbba3d7144 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Tue, 18 Oct 2022 19:24:08 +0100 Subject: [PATCH 4/5] Use \d in regexp in TestDecorators.test_timeit2() --- tests/test_decorators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_decorators.py b/tests/test_decorators.py index 428424b9..b729e376 100644 --- a/tests/test_decorators.py +++ b/tests/test_decorators.py @@ -45,4 +45,4 @@ class TestDecorators(unittest.TestCase): return 42 self.assertEqual(f(), 42) - self.assertRegex(log.getvalue(), r"f took 1\.0. seconds") + self.assertRegex(log.getvalue(), r"f took 1\.0\d seconds") From e32c76aa5c1809fa5fefa7e417a459cc76e75e4b Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Tue, 18 Oct 2022 19:24:08 +0100 Subject: [PATCH 5/5] Make text logger outro "checked" translatable --- linkcheck/logger/text.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linkcheck/logger/text.py b/linkcheck/logger/text.py index 394d0d9a..e4c697ae 100644 --- a/linkcheck/logger/text.py +++ b/linkcheck/logger/text.py @@ -230,7 +230,7 @@ class TextLogger(_Logger): self.write( _n("in %d URL", "in %d URLs", self.stats.num_urls) % self.stats.num_urls ) - self.write(" checked. ") + self.write(_(" checked.") + " ") warning_text = ( _n("%d warning found", "%d warnings found", self.stats.warnings_printed) % self.stats.warnings_printed