Patch some mistakes (according to flake8)

This commit is contained in:
Valentin Niess
2025-05-20 23:27:20 +02:00
parent 331fc6ab7f
commit 60aec8ba25
13 changed files with 28 additions and 53 deletions

View File

@@ -1,17 +1,17 @@
from dataclasses import dataclass
import glob
import os
import re
from typing import Optional, Tuple
from typing import Optional
from ..utils.deps import PREFIX
from ..utils.fs import copy_file, copy_tree, make_tree, remove_file, remove_tree
from ..utils.log import debug, log
from ..utils.fs import copy_file, make_tree, remove_file
from ..utils.log import log
from ..utils.template import copy_template, load_template
@dataclass(frozen=True)
class Appifier:
'''Helper class for bundling AppImage specific files'''
'''Path to AppDir root.'''
appdir: str
@@ -34,8 +34,8 @@ class Appifier:
'''Path to SSL certification file.'''
cert_src: Optional[str]=None
def appify(self):
'''Bundle Appimage specific files'''
python_x_y = f'python{self.version.short()}'
pip_x_y = f'pip{self.version.short()}'
@@ -227,6 +227,7 @@ export TKPATH="${{TK_LIBRARY}}"'''.format(
else:
return ''
def set_executable_patch(version, pkgpath, patch):
'''Set a runtime patch for sys.executable name
'''

View File

@@ -6,10 +6,7 @@ import sys
from ..utils.compat import decode
from ..utils.deps import ensure_appimagetool
from ..utils.docker import docker_run
from ..utils.fs import copy_tree
from ..utils.log import debug, log
from ..utils.tmp import TemporaryDirectory
__all__ = ['build_appimage']
@@ -36,7 +33,7 @@ def build_appimage(appdir=None, destination=None):
appimage_pattern = re.compile('should be packaged as ([^ ]+[.]AppImage)')
stdout, appimage = [], None
stdout = []
while True:
out = decode(p.stdout.readline())
stdout.append(out)

View File

@@ -6,10 +6,11 @@ import sys
from .appify import Appifier
from ..manylinux import PythonVersion
from ..utils.deps import EXCLUDELIST, PATCHELF, PREFIX, ensure_excludelist, \
from ..utils.deps import EXCLUDELIST, PATCHELF, ensure_excludelist, \
ensure_patchelf
from ..utils.fs import copy_file, copy_tree, make_tree, remove_file, remove_tree
from ..utils.log import debug, log
from ..utils.fs import copy_file, copy_tree, make_tree, remove_file, \
remove_tree
from ..utils.log import log
from ..utils.system import ldd, system
@@ -55,7 +56,6 @@ def patch_binary(path, libdir, recursive=True):
continue
target = libdir + '/' + name
if not os.path.exists(target):
libname = os.path.basename(dep)
copy_file(dep, target)
if recursive:
patch_binary(target, libdir, recursive=True)