From d51550da8482199e53425f936bc923147eadc47f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 20 Jul 2016 13:36:42 +0200 Subject: [PATCH] Remove ambiguous imports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make all imports either use full package name starting with `pungi` or use explicitly relative import. This will avoid issues when importing a module that shadows another module on PYTHONPATH. Signed-off-by: Lubomír Sedlář --- pungi/multilib.py | 4 ++-- pungi/phases/__init__.py | 32 ++++++++++++++++---------------- pungi/phases/gather/__init__.py | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pungi/multilib.py b/pungi/multilib.py index 687bc335..ab4853a4 100755 --- a/pungi/multilib.py +++ b/pungi/multilib.py @@ -18,8 +18,8 @@ import re import fnmatch -import pathmatch +import pungi.pathmatch import pungi.gather @@ -72,7 +72,7 @@ def read_runtime_patterns_from_file(path): def expand_runtime_patterns(patterns): - pm = pathmatch.PathMatch() + pm = pungi.pathmatch.PathMatch() result = [] for path, pattern in patterns: for root in ("", "/opt/*/*/root"): diff --git a/pungi/phases/__init__.py b/pungi/phases/__init__.py index dfc1bbd6..d42e117b 100644 --- a/pungi/phases/__init__.py +++ b/pungi/phases/__init__.py @@ -16,19 +16,19 @@ # phases in runtime order -from init import InitPhase # noqa -from pkgset import PkgsetPhase # noqa -from gather import GatherPhase # noqa -from createrepo import CreaterepoPhase # noqa -from product_img import ProductimgPhase # noqa -from buildinstall import BuildinstallPhase # noqa -from extra_files import ExtraFilesPhase # noqa -from createiso import CreateisoPhase # noqa -from live_images import LiveImagesPhase # noqa -from image_build import ImageBuildPhase # noqa -from test import TestPhase # noqa -from image_checksum import ImageChecksumPhase # noqa -from livemedia_phase import LiveMediaPhase # noqa -from ostree import OSTreePhase # noqa -from ostree_installer import OstreeInstallerPhase # noqa -from osbs import OSBSPhase # noqa +from .init import InitPhase # noqa +from .pkgset import PkgsetPhase # noqa +from .gather import GatherPhase # noqa +from .createrepo import CreaterepoPhase # noqa +from .product_img import ProductimgPhase # noqa +from .buildinstall import BuildinstallPhase # noqa +from .extra_files import ExtraFilesPhase # noqa +from .createiso import CreateisoPhase # noqa +from .live_images import LiveImagesPhase # noqa +from .image_build import ImageBuildPhase # noqa +from .test import TestPhase # noqa +from .image_checksum import ImageChecksumPhase # noqa +from .livemedia_phase import LiveMediaPhase # noqa +from .ostree import OSTreePhase # noqa +from .ostree_installer import OstreeInstallerPhase # noqa +from .osbs import OSBSPhase # noqa diff --git a/pungi/phases/gather/__init__.py b/pungi/phases/gather/__init__.py index d14559f7..2f12e58b 100644 --- a/pungi/phases/gather/__init__.py +++ b/pungi/phases/gather/__init__.py @@ -24,7 +24,7 @@ from kobo.rpmlib import parse_nvra from productmd.rpms import Rpms from pungi.wrappers.scm import get_file_from_scm -from link import link_files +from .link import link_files from pungi.util import get_arch_variant_data, get_arch_data from pungi.phases.base import PhaseBase