Bug#1064707: devscripts: FTBFS: AssertionError: black found code that needs reformatting:

2024-03-12 Thread Simon McVittie
On Sun, 25 Feb 2024 at 20:36:58 +0100, Lucas Nussbaum wrote:
> > FAIL: test_black (devscripts.test.test_black.BlackTestCase.test_black)
> > Test: Run black code formatter on Python source code.

I think lint checks like this one should be run by contributors and CI
when targeting the main branch, but skipped when building or testing
a released, production-ready .deb package - they're just too fragile
against new versions of the lint tool that move the goalposts.

smcv



Bug#1064707: devscripts: FTBFS: AssertionError: black found code that needs reformatting:

2024-02-25 Thread Lucas Nussbaum
Source: devscripts
Version: 2.23.7
Severity: serious
Justification: FTBFS
Tags: trixie sid ftbfs
User: lu...@debian.org
Usertags: ftbfs-20240224 ftbfs-trixie

Hi,

During a rebuild of all packages in sid, your package failed to build
on amd64.


Relevant part (hopefully):
> ==
> FAIL: test_black (devscripts.test.test_black.BlackTestCase.test_black)
> Test: Run black code formatter on Python source code.
> --
> Traceback (most recent call last):
>   File "/<>/scripts/devscripts/test/test_black.py", line 43, in 
> test_black
> self.fail(
> AssertionError: black found code that needs reformatting:
> --- reproducible-check2023-04-02 17:44:26+00:00
> +++ reproducible-check2024-02-24 22:54:57.358173+00:00
> @@ -198,13 +198,13 @@
>  
>  # We may have installed a binNMU version locally so we need 
> to
>  # strip these off when looking up against the JSON of 
> results.
>  version = re.sub(r"\+b\d+$", "", pkg_ver.version)
>  
> -result[
> -(pkg.shortname, pkg_ver.architecture, version)
> -] = pkg_ver.source_name
> +result[(pkg.shortname, pkg_ver.architecture, version)] = (
> +pkg_ver.source_name
> +)
>  
>  self.log.debug("Parsed %d installed binary packages", len(result))
>  
>  return result
> 
> --
> Ran 21 tests in 13.726s
> 
> FAILED (failures=1)
> Test failed: 
> error: Test failed:  failures=1>
> make[3]: *** [Makefile:102: test_py] Error 1
> make[3]: Leaving directory '/<>/scripts'
> make[2]: *** [Makefile:68: test_scripts] Error 2
> make[2]: Leaving directory '/<>'
> make[1]: *** [Makefile:43: test] Error 2
> make[1]: Leaving directory '/<>'
> dh_auto_test: error: make -j8 test returned exit code 2


The full build log is available from:
http://qa-logs.debian.net/2024/02/24/devscripts_2.23.7_unstable.log

All bugs filed during this archive rebuild are listed at:
https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=ftbfs-20240224;users=lu...@debian.org
or:
https://udd.debian.org/bugs/?release=na=ign=7=7=only=ftbfs-20240224=lu...@debian.org=1=1=1=1#results

A list of current common problems and possible solutions is available at
http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!

If you reassign this bug to another package, please mark it as 'affects'-ing
this package. See https://www.debian.org/Bugs/server-control#affects

If you fail to reproduce this, please provide a build log and diff it with mine
so that we can identify if something relevant changed in the meantime.