From f7fc609abe1cf8fa1dc0767f0c25a182fadd3ece Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 13 Aug 2022 17:54:50 +0000 Subject: [PATCH] [CI] Format code with Black --- src/diagnosers/80-apps.py | 4 +++- src/migrations/0021_migrate_to_bullseye.py | 25 ++++++++++++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/diagnosers/80-apps.py b/src/diagnosers/80-apps.py index 353620cdc..c4c7f48eb 100644 --- a/src/diagnosers/80-apps.py +++ b/src/diagnosers/80-apps.py @@ -64,7 +64,9 @@ class MyDiagnoser(Diagnoser): yunohost_version_req = ( app["manifest"].get("requirements", {}).get("yunohost", "").strip(">= ") ) - if yunohost_version_req.startswith("2.") or yunohost_version_req.startswith("3."): + if yunohost_version_req.startswith("2.") or yunohost_version_req.startswith( + "3." + ): yield ("error", "diagnosis_apps_outdated_ynh_requirement") deprecated_helpers = [ diff --git a/src/migrations/0021_migrate_to_bullseye.py b/src/migrations/0021_migrate_to_bullseye.py index ce7d25262..5d624c01a 100644 --- a/src/migrations/0021_migrate_to_bullseye.py +++ b/src/migrations/0021_migrate_to_bullseye.py @@ -194,20 +194,31 @@ class MyMigration(Migration): os.system("mkdir -p /etc/systemd/system/dhcpcd.service.d") write_to_file( "/etc/systemd/system/dhcpcd.service.d/wait.conf", - '[Service]\nExecStart=\nExecStart=/usr/sbin/dhcpcd -w' + "[Service]\nExecStart=\nExecStart=/usr/sbin/dhcpcd -w", ) # # Another boring fix for the super annoying libc6-dev: Breaks libgcc-8-dev # https://forum.yunohost.org/t/20617 # - if os.system("grep -A10 'ynh-deps' /var/lib/dpkg/status | grep -q 'Depends:.*build-essential'") == 0: - logger.info("Attempting to fix the build-essential / libc6-dev / libgcc-8-dev hell ...") + if ( + os.system( + "grep -A10 'ynh-deps' /var/lib/dpkg/status | grep -q 'Depends:.*build-essential'" + ) + == 0 + ): + logger.info( + "Attempting to fix the build-essential / libc6-dev / libgcc-8-dev hell ..." + ) os.system("cp /var/lib/dpkg/status /root/dpkg_status.bkp") # This removes the dependency to build-essential from $app-ynh-deps - os.system("perl -i~ -0777 -pe 's/(Package: .*-ynh-deps\\n(.+:.+\\n)+Depends:.*)(build-essential, ?)(.*)/$1$4/g' /var/lib/dpkg/status") + os.system( + "perl -i~ -0777 -pe 's/(Package: .*-ynh-deps\\n(.+:.+\\n)+Depends:.*)(build-essential, ?)(.*)/$1$4/g' /var/lib/dpkg/status" + ) self.apt("build-essential", verb="remove") - os.system("LC_ALL=C DEBIAN_FRONTEND=noninteractive APT_LISTCHANGES_FRONTEND=none apt autoremove --assume-yes") + os.system( + "LC_ALL=C DEBIAN_FRONTEND=noninteractive APT_LISTCHANGES_FRONTEND=none apt autoremove --assume-yes" + ) self.apt("gcc-8 libgcc-8-dev", verb="remove") # @@ -302,7 +313,9 @@ class MyMigration(Migration): # Clean the mess logger.info(m18n.n("migration_0021_cleaning_up")) - os.system("LC_ALL=C DEBIAN_FRONTEND=noninteractive APT_LISTCHANGES_FRONTEND=none apt autoremove --assume-yes") + os.system( + "LC_ALL=C DEBIAN_FRONTEND=noninteractive APT_LISTCHANGES_FRONTEND=none apt autoremove --assume-yes" + ) os.system("apt clean --assume-yes") #