diff --git a/python_appimage/__main__.py b/python_appimage/__main__.py index 96e3a92..d7f2cbe 100644 --- a/python_appimage/__main__.py +++ b/python_appimage/__main__.py @@ -4,7 +4,7 @@ import logging import os import sys -from .deps import fetch_all +from .utils.deps import fetch_all __all__ = ['main'] @@ -50,7 +50,7 @@ def main(): sys.exit(0) # Call the AppImage builder - builder = import_module('.' + args.builder, package=__package__) + builder = import_module('.builders.' + args.builder, package=__package__) builder.build(*builder._unpack_args(args)) diff --git a/python_appimage/actions/__init__.py b/python_appimage/actions/__init__.py new file mode 100644 index 0000000..2846400 --- /dev/null +++ b/python_appimage/actions/__init__.py @@ -0,0 +1,5 @@ +from .build import build_appimage +from .relocate import patch_binary, relocate_python + + +__all__ = ['build_appimage', 'patch_binary', 'relocate_python'] diff --git a/python_appimage/build.py b/python_appimage/actions/build.py similarity index 86% rename from python_appimage/build.py rename to python_appimage/actions/build.py index 34613b8..998f340 100644 --- a/python_appimage/build.py +++ b/python_appimage/actions/build.py @@ -2,11 +2,11 @@ import os import subprocess import sys -from .deps import APPIMAGETOOL, ensure_appimagetool -from .docker import docker_run -from .fs import copy_tree -from .log import debug, log -from .tmp import TemporaryDirectory +from ..utils.deps import APPIMAGETOOL, 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'] diff --git a/python_appimage/relocate.py b/python_appimage/actions/relocate.py similarity index 96% rename from python_appimage/relocate.py rename to python_appimage/actions/relocate.py index 3551cb7..e4ac1a1 100644 --- a/python_appimage/relocate.py +++ b/python_appimage/actions/relocate.py @@ -4,11 +4,11 @@ import re import shutil import sys -from .deps import EXCLUDELIST, PATCHELF, PREFIX, ensure_excludelist, \ - ensure_patchelf -from .fs import make_tree, copy_file, copy_tree, remove_file, remove_tree -from .log import debug, log -from .system import ldd, system +from ..utils.deps import EXCLUDELIST, PATCHELF, PREFIX, ensure_excludelist, \ + ensure_patchelf +from ..utils.fs import make_tree, copy_file, copy_tree, remove_file, remove_tree +from ..utils.log import debug, log +from ..utils.system import ldd, system __all__ = ["patch_binary", "relocate_python"] diff --git a/python_appimage/builders/__init__.py b/python_appimage/builders/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/python_appimage/local.py b/python_appimage/builders/local.py similarity index 89% rename from python_appimage/local.py rename to python_appimage/builders/local.py index 9126a62..8696b12 100644 --- a/python_appimage/local.py +++ b/python_appimage/builders/local.py @@ -2,9 +2,8 @@ import glob import os import shutil -from .build import build_appimage -from .relocate import relocate_python -from .tmp import TemporaryDirectory +from ..actions import build_appimage, relocate_python +from ..utils.tmp import TemporaryDirectory __all__ = ['build'] diff --git a/python_appimage/manylinux.py b/python_appimage/builders/manylinux.py similarity index 92% rename from python_appimage/manylinux.py rename to python_appimage/builders/manylinux.py index f08b2aa..6f6a766 100644 --- a/python_appimage/manylinux.py +++ b/python_appimage/builders/manylinux.py @@ -4,11 +4,10 @@ import platform import shutil import sys -from .build import build_appimage -from .docker import docker_run -from .fs import copy_tree -from .relocate import relocate_python -from .tmp import TemporaryDirectory +from ..actions import build_appimage, relocate_python +from ..utils.docker import docker_run +from ..utils.fs import copy_tree +from ..utils.tmp import TemporaryDirectory __all__ = ['build'] @@ -42,7 +41,7 @@ def build(tag, abi, contained=False): python = '/opt/python/' + abi + '/bin/python' pwd = os.getcwd() - dirname = os.path.abspath(os.path.dirname(__file__)) + dirname = os.path.abspath(os.path.dirname(__file__) + '/..') with TemporaryDirectory() as tmpdir: copy_tree(dirname, 'python_appimage') diff --git a/python_appimage/utils/__init__.py b/python_appimage/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/python_appimage/deps.py b/python_appimage/utils/deps.py similarity index 98% rename from python_appimage/deps.py rename to python_appimage/utils/deps.py index 790bc66..ae3eab2 100644 --- a/python_appimage/deps.py +++ b/python_appimage/utils/deps.py @@ -17,7 +17,7 @@ __all__ = ['APPIMAGETOOL', 'EXCLUDELIST', 'PATCHELF', 'PREFIX', _ARCH = platform.machine() -PREFIX = os.path.abspath(os.path.dirname(__file__)) +PREFIX = os.path.abspath(os.path.dirname(__file__) + '/..') '''Package installation prefix''' APPIMAGETOOL = PREFIX + '/bin/appimagetool.' + _ARCH diff --git a/python_appimage/docker.py b/python_appimage/utils/docker.py similarity index 100% rename from python_appimage/docker.py rename to python_appimage/utils/docker.py diff --git a/python_appimage/fs.py b/python_appimage/utils/fs.py similarity index 100% rename from python_appimage/fs.py rename to python_appimage/utils/fs.py diff --git a/python_appimage/log.py b/python_appimage/utils/log.py similarity index 100% rename from python_appimage/log.py rename to python_appimage/utils/log.py diff --git a/python_appimage/system.py b/python_appimage/utils/system.py similarity index 100% rename from python_appimage/system.py rename to python_appimage/utils/system.py diff --git a/python_appimage/tmp.py b/python_appimage/utils/tmp.py similarity index 100% rename from python_appimage/tmp.py rename to python_appimage/utils/tmp.py diff --git a/python_appimage/url.py b/python_appimage/utils/url.py similarity index 100% rename from python_appimage/url.py rename to python_appimage/utils/url.py