mirror of
https://github.com/truenas/scale-build.git
synced 2025-12-20 02:49:28 +00:00
Add flake8 configuration
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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']
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user