Add flake8 configuration

This commit is contained in:
Waqar Ahmed
2021-04-21 05:20:00 +05:00
committed by Waqar Ahmed
parent d3e2921458
commit 5ab8f699a8
5 changed files with 7 additions and 7 deletions

View File

@@ -25,8 +25,8 @@ def checkout_sources():
# but need to test building of a series of repos with the same experimental branch # but need to test building of a series of repos with the same experimental branch
# #
if TRY_BRANCH_OVERRIDE: if TRY_BRANCH_OVERRIDE:
cp = run(['git', 'ls-remote', package.origin]) cp = run(['git', 'ls-remote', package.origin], check=False)
if re.findall(fr'/{TRY_BRANCH_OVERRIDE}$', cp.stdout.decode()): if cp.returncode == 0 and re.findall(fr'/{TRY_BRANCH_OVERRIDE}\n', cp.stdout.decode(), re.M):
gh_override = TRY_BRANCH_OVERRIDE gh_override = TRY_BRANCH_OVERRIDE
package.checkout(gh_override) package.checkout(gh_override)

View File

@@ -12,7 +12,7 @@ def setup_chroot_basedir(basecache_type, logger=None):
shutil.rmtree(CHROOT_BASEDIR, ignore_errors=True) shutil.rmtree(CHROOT_BASEDIR, ignore_errors=True)
os.makedirs(TMPFS, exist_ok=True) os.makedirs(TMPFS, exist_ok=True)
run( run(
['mount', '-t', 'tmpfs', '-o', f'size=12G', 'tmpfs', TMPFS], ['mount', '-t', 'tmpfs', '-o', 'size=12G', 'tmpfs', TMPFS],
logger=logger logger=logger
) )
restore_basecache(basecache_type, CHROOT_BASEDIR, logger) restore_basecache(basecache_type, CHROOT_BASEDIR, logger)

View File

@@ -95,7 +95,7 @@ def custom_rootfs_setup(rootfs_logger):
tmp_systemd = os.path.join(CHROOT_BASEDIR, 'tmp/systemd') tmp_systemd = os.path.join(CHROOT_BASEDIR, 'tmp/systemd')
os.makedirs(tmp_systemd) os.makedirs(tmp_systemd)
run_in_chroot( run_in_chroot(
f'/usr/lib/systemd/system-generators/systemd-sysv-generator /tmp/systemd /tmp/systemd /tmp/systemd', '/usr/lib/systemd/system-generators/systemd-sysv-generator /tmp/systemd /tmp/systemd /tmp/systemd',
rootfs_logger rootfs_logger
) )
for unit_file in filter(lambda f: f.endswith('.service'), os.listdir(tmp_systemd)): for unit_file in filter(lambda f: f.endswith('.service'), os.listdir(tmp_systemd)):
@@ -125,7 +125,7 @@ def clean_rootfs(rootfs_logger):
) )
# Remove any temp build depends # Remove any temp build depends
run_in_chroot('apt autoremove -y', rootfs_logger, f'Failed atp autoremove') run_in_chroot('apt autoremove -y', rootfs_logger, 'Failed atp autoremove')
# We install the nvidia-kernel-dkms package which causes a modprobe file to be written # We install the nvidia-kernel-dkms package which causes a modprobe file to be written
# (i.e /etc/modprobe.d/nvidia.conf). This file tries to modprobe all the associated # (i.e /etc/modprobe.d/nvidia.conf). This file tries to modprobe all the associated

View File

@@ -166,5 +166,3 @@ class BuildPackageMixin:
@property @property
def deflags(self): def deflags(self):
return [f'-j{self.jobs if self.jobs else os.cpu_count()}', '-us', '-uc', '-b'] return [f'-j{self.jobs if self.jobs else os.cpu_count()}', '-us', '-uc', '-b']

2
setup.cfg Normal file
View File

@@ -0,0 +1,2 @@
[flake8]
max-line-length=120