Source: unattended-upgrades
Version: 2.12
Severity: serious
Tags: ftbfs

With python3-flake8 7.3.0-1, unattended-upgrades fails to build:

______________________ TestFlake8Clean.test_flake8_clean _______________________

self = <test.test_flake8.TestFlake8Clean testMethod=test_flake8_clean>

    def test_flake8_clean(self):
        top_src_dir = os.path.join(os.path.dirname(__file__), "..")
        targets = [
            top_src_dir,
            os.path.join(top_src_dir, "unattended-upgrade"),
            os.path.join(top_src_dir, "unattended-upgrade-shutdown"),
        ]
>       subprocess.check_call(
            [
                "flake8",
                # use max-line-length=88 for upcoming "black" compatibility
                "--max-line-length=88",
                # E402 ignored because we need to import/config apt_pkg before
                #      importing unattended_upgrade
                # W503 ignored because some lines with binary operators are long
                "--ignore=E402,W503",
            ]
            + targets
        )

/build/reproducible-path/unattended-upgrades-2.12/test/test_flake8.py:16:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

popenargs = (['flake8', '--max-line-length=88', '--ignore=E402,W503', 
'/build/reproducible-path/unattended-upgrades-2.12/test/..',...test/../unattended-upgrade',
 
'/build/reproducible-path/unattended-upgrades-2.12/test/../unattended-upgrade-shutdown'],)
kwargs = {}, retcode = 1
cmd = ['flake8', '--max-line-length=88', '--ignore=E402,W503', 
'/build/reproducible-path/unattended-upgrades-2.12/test/..', 
...2/test/../unattended-upgrade', 
'/build/reproducible-path/unattended-upgrades-2.12/test/../unattended-upgrade-shutdown']

    def check_call(*popenargs, **kwargs):
        """Run command with arguments.  Wait for command to complete.  If
        the exit code was zero then return, otherwise raise
        CalledProcessError.  The CalledProcessError object will have the
        return code in the returncode attribute.

        The arguments are the same as for the call function.  Example:

        check_call(["ls", "-l"])
        """
        retcode = call(*popenargs, **kwargs)
        if retcode:
            cmd = kwargs.get("args")
            if cmd is None:
                cmd = popenargs[0]
>           raise CalledProcessError(retcode, cmd)
E           subprocess.CalledProcessError: Command '['flake8', 
'--max-line-length=88', '--ignore=E402,W503', 
'/build/reproducible-path/unattended-upgrades-2.12/test/..', 
'/build/reproducible-path/unattended-upgrades-2.12/test/../unattended-upgrade', 
'/build/reproducible-path/unattended-upgrades-2.12/test/../unattended-upgrade-shutdown']'
 returned non-zero exit status 1.

/usr/lib/python3.13/subprocess.py:419: CalledProcessError
----------------------------- Captured stdout call -----------------------------
/build/reproducible-path/unattended-upgrades-2.12/test/../unattended-upgrade:878:5:
 F824 `global logged_msgs` is unused: name is never assigned in scope
/build/reproducible-path/unattended-upgrades-2.12/test/../unattended_upgrade.py:878:5:
 F824 `global logged_msgs` is unused: name is never assigned in scope


I generally think that flake8 and other similar linters should be run in 
CI jobs but not at package build time; there's no need for them to 
prevent the package from building.  But please at least fix this failure 
(which is just a matter of removing the "global logged_msgs" line 
pointed to here) so that the new python-flake8 can migrate to testing.

Thanks,

-- 
Colin Watson (he/him)                              [[email protected]]

Reply via email to