mirror of
https://github.com/niess/python-appimage.git
synced 2026-03-14 04:10:15 +01:00
Patch some mistakes (according to flake8)
This commit is contained in:
@@ -8,7 +8,7 @@ import stat
|
||||
import struct
|
||||
|
||||
from ...appimage import build_appimage
|
||||
from ...utils.compat import decode, find_spec
|
||||
from ...utils.compat import find_spec
|
||||
from ...utils.deps import PREFIX
|
||||
from ...utils.fs import copy_file, copy_tree, make_tree, remove_file, remove_tree
|
||||
from ...utils.log import log
|
||||
@@ -33,6 +33,7 @@ def _unpack_args(args):
|
||||
_tag_pattern = re.compile('python([^-]+)[-]([^.]+)[.]AppImage')
|
||||
_linux_pattern = re.compile('manylinux([0-9]+)_' + platform.machine())
|
||||
|
||||
|
||||
def execute(appdir, name=None, python_version=None, linux_tag=None,
|
||||
python_tag=None, base_image=None, in_tree_build=False,
|
||||
extra_data=None):
|
||||
@@ -311,8 +312,6 @@ def execute(appdir, name=None, python_version=None, linux_tag=None,
|
||||
shebang = '#! /bin/bash'
|
||||
|
||||
entrypoint = load_template(entrypoint_path, **dictionary)
|
||||
python_pkg = 'AppDir/opt/python{0:}/lib/python{0:}'.format(
|
||||
python_version)
|
||||
dictionary = {'entrypoint': entrypoint,
|
||||
'shebang': shebang}
|
||||
if os.path.exists('AppDir/AppRun'):
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
import glob
|
||||
import os
|
||||
from pathlib import Path
|
||||
import platform
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
from ...appimage import build_appimage, relocate_python
|
||||
from ...appimage import build_appimage
|
||||
from ...manylinux import Arch, Downloader, ImageExtractor, LinuxTag, \
|
||||
PythonExtractor
|
||||
from ...utils.docker import docker_run
|
||||
from ...utils.fs import copy_tree
|
||||
from ...utils.manylinux import format_appimage_name, format_tag
|
||||
from ...utils.tmp import TemporaryDirectory
|
||||
|
||||
|
||||
@@ -23,17 +17,6 @@ def _unpack_args(args):
|
||||
return args.tag, args.abi
|
||||
|
||||
|
||||
def _get_appimage_name(abi, tag):
|
||||
'''Format the Python AppImage name using the ABI and OS tags
|
||||
'''
|
||||
# Read the Python version from the desktop file
|
||||
desktop = glob.glob('AppDir/python*.desktop')[0]
|
||||
fullversion = desktop[13:-8]
|
||||
|
||||
# Finish building the AppImage on the host. See below.
|
||||
return format_appimage_name(abi, fullversion, tag)
|
||||
|
||||
|
||||
def execute(tag, abi):
|
||||
'''Build a Python AppImage using a Manylinux image
|
||||
'''
|
||||
|
||||
@@ -19,6 +19,6 @@ def execute(*args):
|
||||
bindir = os.path.dirname(deps.PATCHELF)
|
||||
for binary in args:
|
||||
installed = getattr(deps, 'ensure_' + binary)()
|
||||
words = 'has been' if installed else 'already'
|
||||
words = 'has been' if installed else 'already'
|
||||
log('INSTALL',
|
||||
'{:} {:} installed in {:}'.format(binary, words, bindir))
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import os
|
||||
|
||||
from ..utils import deps
|
||||
from ..utils.log import log
|
||||
|
||||
|
||||
__all__ = ['execute']
|
||||
|
||||
Reference in New Issue
Block a user